0:00 / 0:00
#haskell#algebraicdatatypes#lens
How to Define Data Types
NYC Haskell User's Group
1.7K subscribers • 23 videos on Hallway
- Recommended by 2 people: 1 on Lobsters and 1 in engineering communities.
- Presented by Stephen Compall
Intermediate. Assumes working knowledge.
4.1K views11 years ago2 recommendations
Programming languagesSoftware designHaskellFunctional programming
Stephen Compall shares rules of thumb and best practices for defining algebraic data types in Haskell to minimize boilerplate.
Stephen Compall New York Haskell Meetup April 22, 2015 It's one thing to know about the numerous features for defining datatypes in Haskell; it's another to know when to use each one, to maximize the utility of your datatype definitions and minimize boilerplate code for working with them. In this talk, we will define a set of "rules of thumb" for writing datatype definitions; these rules, inspired by Edward Kmett's practices and 100% lens-friendly, will scale with you as you grow from beginner to experienced Haskell programmer. Slides: nocandysw.com/how-to-define-data-types.pdf Code: code.launchpad.net/~scompall/+junk/how-to-define-data-types-…Why it's here
2 people recommend thisMoments people linked to
u/gelisamin r/haskell • Mentions
On “Can't Figure Out Importing Functions From Module”
Ah! So the problem is not that `System.Directory` doesn't export `isFile`, the problem is that there are two separate packages which expose a module named `System.Directory`, only one of which exports `isFile`. You were looking at the documentation for one and compiling with the other. It's a confusing situation, but fortunately most packages pick a unique module prefix for their module names, so this confusing situation doesn't occur too often. I imagine that the system-fileio package chose to use the same module name as the directory package because they wanted to be a drop-in replacement for directory? Except this wouldn't really work, since the exported function names aren't the same. We…