This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
- Haskell is a functional programming language.
-- Data decls could be in their own module for qualified import? | |
-- Alternatively, there might be a solution in GHC 8's duplicate record fields... | |
-- Only thing to update to add fields is the accessor functions | |
-- Test with an int and a str | |
data Test = MkTest Integer String deriving (Eq,Show) | |
number :: Access Integer Test | |
number f (MkTest n s) = (f n, MkTest (f n) s) |
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.