View gist:b6288738f1b3712d2294
1 2 3 4 5 6 7 8 9 10
statements needs these new arguments
:: HashMap Text (Set Global) -> -- all imported term names
HashMap Text (Set Global) -> -- all imported type names
...
 
-- we can 'resolve/filter' an import clause with something like:
resolveTermImports :: Monad m =>
Import Global -> -- the import, obvs
HashMap Text Global -> -- map of all the term globals in the module
HashMap Text Global -> -- appropriately filtered result
View gist:3499e09bcc12fb83d3a9
1 2 3 4 5 6 7 8 9 10
wholeModule :: (MonadPlus m, TokenParsing m) =>
ModuleHead (Import Text, Module) a -> m Module
wholeModule mh = do
resImps <- (mh^.moduleHeadImports) `forM` \(imp, md) ->
let termNms = moduleTermNames md
typeNms = moduleTypeNames md
resolver = resolveGlobal termNms typeNms
in (importScope'.importScopeExplicits.traverse) resolver imp
stmts <- evalStateT statements (importedFixities $ mh^.moduleHeadImports)
assembleModule (mh^.moduleName) resImps stmts
View gist:b3291f936a0d11b1305a
1 2 3 4 5 6 7 8 9 10
Right (Module {
mn = mkModuleName "ermine" "Test2",
_moduleImports = [Import {
_importPrivacy = Private,
_importModule = mkModuleName "ermine" "Test",
_importAs = Nothing,
_importScope = Using [Explicit {_explicitGlobal = glob Idfix (mkModuleName "ermine" "Test") "x", _explicitIsType = False,
_explicitLocal = Nothing}]}],
_moduleFixities = [],
_moduleData = [],
View Cycle.hs
1 2 3 4 5
injectCycle :: ModuleGraph -> Gen ModuleGraph
injectCycle g = do
ks <- infiniteListOf (elements $ HM.keys g)
let cycl = zip ks (takeWhile (head ks /=) (tail ks) ++ [head ks])
return $ foldl (flip addDep) g cycl
View gist:8c0d234bf393db460786
1 2 3 4 5 6 7 8 9 10
[(Import
{_importPrivacy = Private,
_importModule = mkModuleName "ermine" "Test",
_importAs = Nothing,
_importScope = Using [
Explicit {_explicitGlobal = "x", _explicitIsType = False, _explicitLocal = Nothing},
Explicit {_explicitGlobal = "y", _explicitIsType = False, _explicitLocal = Nothing}
]
},
View gist:3e661697c0eaa801335f
1 2 3 4 5 6 7 8 9 10
Resolving dependencies...
Notice: installing into a sandbox located at
C:\Users\Joshua\Documents\GitHub\ermine\.cabal-sandbox
Configuring ermine-0.6...
Building ermine-0.6...
Failed to install ermine-0.6
Last 10 lines of the build log ( C:\Users\Joshua\Documents\GitHub\ermine\.cabal-sandbox\logs\ermine-0.6.log ):
Loading package file-embed-0.0.8 ... linking ... done.
Loading package dlist-0.7.1 ... linking ... done.
Loading package syb-0.4.4 ... linking ... done.
View gist:b01b763f78faff55ae52
1 2 3 4 5
injectCycle :: ModuleGraph -> Gen ModuleGraph
injectCycle g = do
ks <- infiniteListOf (elements $ HM.keys g)
let cycl = zip ks (takeWhile (head ks /=) (tail ks) ++ [head ks])
return $ foldl (flip addDep) g cycl
View gist:327df601b748783bd3e3
1 2 3 4 5 6 7 8 9 10
type ModuleName = Int
type ModuleGraph = HM.HashMap Int (HS.HashSet Int)
 
singletonGraph :: Int -> [Int] -> ModuleGraph
singletonGraph i ds = HM.singleton i (HS.fromList ds)
 
arbModuleName :: Gen ModuleName
arbModuleName = oneof (map return [0..100])
 
arbModuleGraph :: Gen ModuleGraph
View gist:16d82506ff6f60991841
1 2 3 4 5 6 7
MacBook-Pro:ermine joshcough$ cabal test
cabal: You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.2, now Cabal-1.22.0.0).
MacBook-Pro:ermine joshcough$ cabal configure --enable-tests
Resolving dependencies...
Configuring ermine-0.6...
MacBook-Pro:ermine joshcough$ cabal test
cabal: You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.2, now Cabal-1.22.0.0).
View gist:a88def2a9f962fe9e808
1 2 3 4 5 6 7 8 9 10
<joshcough> hello. i just asked this on #haskell, and edwardk suggested i ask it here instead. im wondering why there aren't osx binaries for 7.8.4 (and if i can do anything to help fix that)
[16:30:32] <carter> joshcough: because there ARE, just that hvr or thoughtpolice haven't uploaded an "official" build
[16:30:38] <carter> joshcough: you can use my build if you want
[16:30:58] <carter> for some reason i had to build a haddock in userland for docs to work though
[16:31:02] <joshcough> ok. do you have it somewhere that i could point to?
[16:31:04] <joshcough> and thanks
[16:31:24] <joshcough> hm.
[16:31:28] <carter> http://www.wellposed.com.s3.amazonaws.com/opensource/ghc/releasebuild-unofficial/ghc-7.8.4-x86_64-apple-darwin.tar.bz2
[16:31:40] <carter> if you look on the ghc-devs thread you'll see a link to that + a hash
[16:31:44] <carter> i forget what the hash is
Something went wrong with that request. Please try again.