Last active
December 27, 2015 10:09
Revisions
-
robstewart57 revised this gist
Nov 4, 2013 . 1 changed file with 33 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,3 +18,36 @@ main = do initializeNativeTarget xs <- simpleFunction notFirstClass xs [1,2,3] >>= print {- ERROR NotFirstClass.hs:10:13: No instance for (IsFirstClass [Int8]) arising from a use of `createNamedFunction' Possible fix: add an instance declaration for (IsFirstClass [Int8]) In the expression: createNamedFunction ExternalLinkage "test" In a stmt of a 'do' block: test <- createNamedFunction ExternalLinkage "test" $ \ x -> do { ret x } In the expression: do { test <- createNamedFunction ExternalLinkage "test" $ \ x -> do { ... }; let _ = ...; return test } NotFirstClass.hs:19:11: No instance for (Generic [Int8]) arising from a use of `simpleFunction' Possible fix: add an instance declaration for (Generic [Int8]) In a stmt of a 'do' block: xs <- simpleFunction notFirstClass In the expression: do { initializeNativeTarget; xs <- simpleFunction notFirstClass; xs [1, 2, ....] >>= print } In an equation for `main': main = do { initializeNativeTarget; xs <- simpleFunction notFirstClass; xs [1, ....] >>= print } Failed, modules loaded: none. -} -
robstewart57 created this gist
Nov 4, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ module Main where import Data.Int import LLVM.Core import LLVM.ExecutionEngine notFirstClass :: CodeGenModule (Function ([Int8] -> IO [Int8])) notFirstClass = do test <- createNamedFunction ExternalLinkage "test" $ \x -> do ret x let _ = test :: Function ([Int8] -> IO [Int8]) return test main :: IO () main = do initializeNativeTarget xs <- simpleFunction notFirstClass xs [1,2,3] >>= print