-
-
Save max630/1505056 to your computer and use it in GitHub Desktop.
Уточнение типа по мере продвижения по файлу
This file contains 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 #-} | |
module H where | |
import Language.Haskell.TH | |
f = [42] | |
$(do | |
i <- reify (mkName "f") | |
runIO (print i) | |
sequence [dataD (cxt []) (mkName "A") [] [normalC (mkName "A") []] []]) | |
main = do | |
case f :: [Integer] of | |
[42] -> print "A" | |
_ -> print "B" | |
$(do | |
i <- reify (mkName "f") | |
runIO (print i) | |
sequence [dataD (cxt []) (mkName "B") [] [normalC (mkName "B") []] []]) |
This file contains 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
VarI H.f (AppT ListT (VarT t_1946157057)) Nothing (Fixity 9 InfixL) | |
VarI H.f (AppT ListT (ConT GHC.Integer.Type.Integer)) Nothing (Fixity 9 InfixL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment