Created
October 1, 2013 14:10
-
-
Save qoelet/6779027 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- the below will fail | |
data Type1 = Type1 { title :: String, another :: Integer } | |
data Type2 = Type2 { title :: String, random :: Integer } | |
-- with an error of "Multiple declarations of 'title'" or something along the lines | |
-- Thread on Stackoverflow: http://stackoverflow.com/questions/5367167/haskell-record-syntax | |
-- My simple cheap workaround was to seperate them into different sub-module files (obviously not scalable) | |
-- Thanks to Chris Forno (http://jekor.com/) who directed me to possible ways (and new brain food!) | |
-- 1. Template Haskell (http://www.haskell.org/haskellwiki/Template_Haskell) | |
-- 2. Lenses (https://github.com/ekmett/lens) | |
-- Also found TDNR: | |
-- http://www.haskell.org/haskellwiki/TypeDirectedNameResolution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment