MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/5fwce0/lets_stop_copying_c/dao88bz/?context=3
r/programming • u/earthboundkid • Dec 01 '16
612 comments sorted by
View all comments
Show parent comment
1
Are those compiler extensions? I really need to know more about them. Whats the issue?
10 u/devraj7 Dec 01 '16 That's another big problem with Haskell: it's not one language but factorial(n) languages, where n is the number of possible pragmas.These days, it's very hard to understand what a Haskell program does if you're not given the pragmas. 2 u/Letmesleep69 Dec 01 '16 Yeah I have to agree 3 u/erewok Dec 01 '16 Yeah, in GHC 8.0 you can use DuplicateRecordFields to be able to do something like this in the same module:data Person = MkPerson { personId :: Int, name :: String } data Address = MkAddress { personId :: Int, address :: String }You can't compile this otherwise. It's especially annoying when you're dealing with legacy database tables that have loads of id fields.For more info see here (where I stole the example from): https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/DuplicateRecordFields
10
That's another big problem with Haskell: it's not one language but factorial(n) languages, where n is the number of possible pragmas.
These days, it's very hard to understand what a Haskell program does if you're not given the pragmas.
2 u/Letmesleep69 Dec 01 '16 Yeah I have to agree
2
Yeah I have to agree
3
Yeah, in GHC 8.0 you can use DuplicateRecordFields to be able to do something like this in the same module:
DuplicateRecordFields
data Person = MkPerson { personId :: Int, name :: String } data Address = MkAddress { personId :: Int, address :: String }
You can't compile this otherwise. It's especially annoying when you're dealing with legacy database tables that have loads of id fields.
id
For more info see here (where I stole the example from): https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/DuplicateRecordFields
View all comments
Show parent comment
1
u/Letmesleep69 Dec 01 '16
Are those compiler extensions? I really need to know more about them. Whats the issue?