dice.camp is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon server for RPG folks to hang out and talk. Not owned by a billionaire.

Administered by:

Server stats:

1.8K
active users

#haskell

15 posts14 participants0 posts today

via Upenn
(1) Tell us about a noteworthy time that you applied PBT.
(a) What kinds of properties did you test?
(b) How did you generate test inputs?
(c) How did you evaluate the effectiveness of your testing?
(d) What did you do to shrink your failing inputs?
(2) Which parts of the PBT process are the most difficult?
(3) What role does PBT play in your development workflow?
(4) To whom would you recommend PBT?
(5) In what contexts is PBT most useful?
(6) Is there anything that would make PBT more useful to you?
The script was designed to attain depth by encouraging reflection
on real, memorable experiences with PBT. It evolved somewhat
over the course of the study, allowing us to validate interesting or
unexpected observations from earlier interviews.
A separate script was used with maintainers:
(1) Have you seen the type of adoption that you want from your
PBT tools?
(2) How can QuickCheck be improved?
(3) What do you think it would take to get everyone at Jane
Street using PBT? Would that be a good thing?
(4) What do you hope we’ll learn from this study?
#Haskell
cis.upenn.edu/~bcpierce/papers

Hey my Haskell curious friends. When I got started I picked up a copy of Learn You a Haskell. It's good but for someone who thought that functional programming meant breaking your c code into functions, it's a bit like sipping from the fire hose. I picked up a copy of Haskell: The Craft of Functional Programming. It's got a lot more background on how to think about Functional Programming. Paper copies are cheap but you can get a copy here for free: haskellcraft.com/craft3e/Home. #haskell #programming

www.haskellcraft.comHaskell: the Craft of Functional Programming
Replied in thread

@rzeta0 I'm a #haskell developer rather than a type theory person, but I can have a go:

On a simple level, an Algebraic Data Type can be broken down into Sum Types, and Product Types

Sum Types look like

data Sum =  ConstructorA TypeA | ConstructorB TypeB

Product types, which look like

data Product = Product TypeC TypeD

If you think about the cardinality of these kinds of types, in the sense of "the number of distinct values that they can have", then "cardinality(Sum) = cardinality(TypeA) + cardinality(TypeB)" and "cardinality(Product) = cardinality(TypeC) * cardinality(TypeD)".

That's the relationship to "Algebra"

Feels somewhat strange that I shifted completely from #haskell to #rustlang at work, as well as for most private toy projects.

On the other hand I still following the development and esp. enjoy reading about #haskell beginners "click moments" here in #feediverse ... Not to be meant "arrogant" in anyway, but feels like beeing an older Jedi and seeing when the force becomes 💪 in young padawans :)

#Haskell has list comprehensions, like Python, Erlang, etc:
```
[(x, y) | x <- [1,2,3], y <- [4,5,6]]
```
returns
```
[(1,4),(1,5),(1,6),(2,4),(2,5),(2,6),(3,4),(3,5),(3,6)]
```
(cartesian product of lists)

However, you can also do the same thing using `do` syntax:
```
do x <- [1,2,3]
y <- [4,5,6]
return (x, y)
```
And the equivalent, using infix operators:
```
(,) <$> [1,2,3] <*> [4,5,6]
```
I kinda love this; it composes easily and doesn't require additional syntactic constructs.

Replied in thread

@rzeta0 the helper in this case is of course your lambda. That's part of what foldr does: it replaces every instance of (:) with something else. One possible complication is that xs is the result of the rest of the fold, it has to be if you think about the type of fold a bit.

This isn't an _efficient_ way to reverse a list, by the way, it's quadratic in runtime and space! (This gets back to the fact that efficient use of concatination associates to the right, not left.)

You can define efficient reversals in terms of foldl'. This shouldn't be too difficult.

If you want another riddle, foldl can be expressed in terms of foldr. Here's an asymptotically efficient reversal in terms of foldr:

reverse xs = foldr (\x f acc -> f (x : acc)) id xs []

Have to say, for better or worse (as in, the vague OO-ification of Haskell), DuplicateRecordFields and OverloadedRecordDot are changing how I write #Haskell these days. I wasn't sure for a long time but overall is good.

Added unfolds to the #Haskell version and improved the test coverage to 75%, though I lost coverage on the gfold/gfoldHMu

gitlab.com/bss03/nested/-/blob

Still good work for the evening, I think.

Anyone out there have a good example of using a gfold / gunfold where the functor arguments to Ran/Lan are distinct? I don't remember any from the paper I'm working from, tho I will check again.

GitLabhs/Nested.hs · main · Boyd Stephen Smith Jr. / nested · GitLabGitLab.com