Created
September 13, 2016 17:21
-
-
Save mwotton/0255118a6b391361d43a9e190efdae04 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
{-# LANGUAGE TemplateHaskell #-} | |
import Data.Data | |
import qualified Data.Set as HS | |
import Data.Time | |
import Language.Haskell.TH.Syntax | |
foo :: (Data a) => a -> () | |
foo _ = () | |
table = $(do r <- runIO (HS.fromList . lines <$> readFile "/usr/share/dict/words") | |
[|r|] ) | |
main = do | |
r <- HS.fromList . lines <$> readFile "/usr/share/dict/words" | |
print (foo r) | |
print $ HS.member "foo" table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Am a bit confused by this - do I need to explicitly derive Lift for Data.Set? if so, what use is the defaulting in the Lift class?