Search is not available for this dataset
repo_name string | path string | license string | full_code string | full_size int64 | uncommented_code string | uncommented_size int64 | function_only_code string | function_only_size int64 | is_commented bool | is_signatured bool | n_ast_errors int64 | ast_max_depth int64 | n_whitespaces int64 | n_ast_nodes int64 | n_ast_terminals int64 | n_ast_nonterminals int64 | loc int64 | cycloplexity int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lukemaurer/sequent-core | src/Language/SequentCore/LiftLambdas.hs | bsd-3-clause | getDecEnv :: LiftM DecEnv
getDecEnv = RWS.get | 45 | getDecEnv :: LiftM DecEnv
getDecEnv = RWS.get | 45 | getDecEnv = RWS.get | 19 | false | true | 0 | 5 | 6 | 16 | 8 | 8 | null | null |
shlevy/ghc | compiler/utils/Outputable.hs | bsd-3-clause | pprTraceDebug :: String -> SDoc -> a -> a
pprTraceDebug str doc x
| debugIsOn && hasPprDebug unsafeGlobalDynFlags = pprTrace str doc x
| otherwise = x | 192 | pprTraceDebug :: String -> SDoc -> a -> a
pprTraceDebug str doc x
| debugIsOn && hasPprDebug unsafeGlobalDynFlags = pprTrace str doc x
| otherwise = x | 192 | pprTraceDebug str doc x
| debugIsOn && hasPprDebug unsafeGlobalDynFlags = pprTrace str doc x
| otherwise = x | 150 | false | true | 1 | 9 | 68 | 58 | 27 | 31 | null | null |
frantisekfarka/ghc-dsi | compiler/codeGen/StgCmmExtCode.hs | bsd-3-clause | -- | Add a new label to the list of local declarations.
addLabel :: FastString -> BlockId -> ExtCode
addLabel name block_id = addDecl name (LabelN block_id) | 156 | addLabel :: FastString -> BlockId -> ExtCode
addLabel name block_id = addDecl name (LabelN block_id) | 100 | addLabel name block_id = addDecl name (LabelN block_id) | 55 | true | true | 0 | 8 | 26 | 42 | 19 | 23 | null | null |
imeckler/mote | Mote/GhcUtil.hs | bsd-3-clause | toSpan UnhelpfulSpan {} = error "Unhelpful span." | 49 | toSpan UnhelpfulSpan {} = error "Unhelpful span." | 49 | toSpan UnhelpfulSpan {} = error "Unhelpful span." | 49 | false | false | 0 | 5 | 6 | 17 | 7 | 10 | null | null |
jtobin/lazy-langevin | Numeric/MCMC/RiemannianLangevin.hs | bsd-3-clause | localMean :: Monad m
=> [Double] -- Current state
-> ViewsOptions m [Double] -- Localized mean of proposal distribution
localMean t = do
Options _ c _ _ e <- ask
return $! zipWith (+) t (map (* (0.5 * e^(2 :: Int))) (c t))
| 267 | localMean :: Monad m
=> [Double] -- Current state
-> ViewsOptions m [Double]
localMean t = do
Options _ c _ _ e <- ask
return $! zipWith (+) t (map (* (0.5 * e^(2 :: Int))) (c t))
| 224 | localMean t = do
Options _ c _ _ e <- ask
return $! zipWith (+) t (map (* (0.5 * e^(2 :: Int))) (c t))
| 111 | true | true | 0 | 14 | 89 | 107 | 56 | 51 | null | null |
Solonarv/OctoTactics | OctoTactics/Data/Direction.hs | mit | move NorthEast (x, y) = (x + 1, y - 1) | 38 | move NorthEast (x, y) = (x + 1, y - 1) | 38 | move NorthEast (x, y) = (x + 1, y - 1) | 38 | false | false | 0 | 6 | 10 | 33 | 17 | 16 | null | null |
garetxe/cabal | Cabal/Distribution/Simple.hs | bsd-3-clause | defaultTestHook :: Args -> PackageDescription -> LocalBuildInfo
-> UserHooks -> TestFlags -> IO ()
defaultTestHook args pkg_descr localbuildinfo _ flags =
test args pkg_descr localbuildinfo flags | 215 | defaultTestHook :: Args -> PackageDescription -> LocalBuildInfo
-> UserHooks -> TestFlags -> IO ()
defaultTestHook args pkg_descr localbuildinfo _ flags =
test args pkg_descr localbuildinfo flags | 215 | defaultTestHook args pkg_descr localbuildinfo _ flags =
test args pkg_descr localbuildinfo flags | 100 | false | true | 0 | 11 | 45 | 56 | 27 | 29 | null | null |
shlevy/ghc | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | bsd-3-clause | -- \"Runs\" the 'Q' monad. Normal users of Template Haskell
-- should not need this function, as the splice brackets @$( ... )@
-- are the usual way of running a 'Q' computation.
--
-- This function is primarily used in GHC internals, and for debugging
-- splices by running them in 'IO'.
--
-- Note that many functions ... | 619 | runQ :: Quasi m => Q a -> m a
runQ (Q m) = m | 44 | runQ (Q m) = m | 14 | true | true | 0 | 7 | 112 | 52 | 29 | 23 | null | null |
bkach/HaskellRaycaster | src/RayCaster/Quaternion.hs | apache-2.0 | conjugate :: Quaternion -> Quaternion
conjugate (Quaternion w vector) = Quaternion w (neg vector) | 97 | conjugate :: Quaternion -> Quaternion
conjugate (Quaternion w vector) = Quaternion w (neg vector) | 97 | conjugate (Quaternion w vector) = Quaternion w (neg vector) | 59 | false | true | 0 | 7 | 13 | 37 | 18 | 19 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/AttachInternetGateway.hs | mpl-2.0 | -- | 'AttachInternetGatewayResponse' constructor.
attachInternetGatewayResponse :: AttachInternetGatewayResponse
attachInternetGatewayResponse = AttachInternetGatewayResponse | 174 | attachInternetGatewayResponse :: AttachInternetGatewayResponse
attachInternetGatewayResponse = AttachInternetGatewayResponse | 124 | attachInternetGatewayResponse = AttachInternetGatewayResponse | 61 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
ejlilley/AbstractMusic | Shortcuts.hs | gpl-3.0 | dotted (AbstractDur2 r) = AbstractDur2 (r * (3%2)) | 50 | dotted (AbstractDur2 r) = AbstractDur2 (r * (3%2)) | 50 | dotted (AbstractDur2 r) = AbstractDur2 (r * (3%2)) | 50 | false | false | 0 | 9 | 7 | 32 | 16 | 16 | null | null |
fpco/fay | src/Fay/Compiler/Print.hs | bsd-3-clause | printCons (Special {}) = error "qname2String Special" | 53 | printCons (Special {}) = error "qname2String Special" | 53 | printCons (Special {}) = error "qname2String Special" | 53 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
nathyong/microghc-ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcGetTyVar_maybe :: Type -> Maybe TyVar
tcGetTyVar_maybe ty | Just ty' <- tcView ty = tcGetTyVar_maybe ty' | 106 | tcGetTyVar_maybe :: Type -> Maybe TyVar
tcGetTyVar_maybe ty | Just ty' <- tcView ty = tcGetTyVar_maybe ty' | 106 | tcGetTyVar_maybe ty | Just ty' <- tcView ty = tcGetTyVar_maybe ty' | 66 | false | true | 0 | 9 | 16 | 44 | 18 | 26 | null | null |
ptitfred/slidecoding | src/Slidecoding/SlidesWriter.hs | gpl-3.0 | joinSections :: Maybe Port -> Presentation -> [(FilePath, Pandoc)] -> String
joinSections port presentation slides = renderHtml (template port design' title' document)
where document = titleSlide <> content
content = mconcatWith writeSection slides
meta' = metadata presentation
title... | 435 | joinSections :: Maybe Port -> Presentation -> [(FilePath, Pandoc)] -> String
joinSections port presentation slides = renderHtml (template port design' title' document)
where document = titleSlide <> content
content = mconcatWith writeSection slides
meta' = metadata presentation
title... | 435 | joinSections port presentation slides = renderHtml (template port design' title' document)
where document = titleSlide <> content
content = mconcatWith writeSection slides
meta' = metadata presentation
titleSlide = writeSection (titleSection presentation)
title' = title m... | 358 | false | true | 5 | 9 | 108 | 118 | 59 | 59 | null | null |
Mortomes/wyah | untyedlambda/src/pretty.hs | gpl-3.0 | ppexpr :: Expr -> String
ppexpr = render . ppr 0 | 48 | ppexpr :: Expr -> String
ppexpr = render . ppr 0 | 48 | ppexpr = render . ppr 0 | 23 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
yliu120/K3 | src/Language/K3/Codegen/CPP/Preprocessing.hs | apache-2.0 | mangleReservedNames' (Node (ELetIn i :@: as) cs)
| i `elem` cppReservedNames = Node (ELetIn (mangleName i) :@: as) mcs
| otherwise = Node (ELetIn i :@: as) mcs
where
mcs = mangleReservedNames' <$> cs | 213 | mangleReservedNames' (Node (ELetIn i :@: as) cs)
| i `elem` cppReservedNames = Node (ELetIn (mangleName i) :@: as) mcs
| otherwise = Node (ELetIn i :@: as) mcs
where
mcs = mangleReservedNames' <$> cs | 213 | mangleReservedNames' (Node (ELetIn i :@: as) cs)
| i `elem` cppReservedNames = Node (ELetIn (mangleName i) :@: as) mcs
| otherwise = Node (ELetIn i :@: as) mcs
where
mcs = mangleReservedNames' <$> cs | 213 | false | false | 1 | 11 | 47 | 95 | 46 | 49 | null | null |
mudphone/ProgrammingInHaskell | src/Ch4.hs | bsd-3-clause | False `disj1` True = True | 25 | False `disj1` True = True | 25 | False `disj1` True = True | 25 | false | false | 0 | 5 | 4 | 18 | 8 | 10 | null | null |
yuvallanger/threepenny-gui | src/Graphics/UI/Threepenny/Core.hs | bsd-3-clause | -- | Align given elements in a rectangular grid.
--
-- Layout is achieved by using the CSS @display:table@ property.
-- The following element tree will be generated
--
-- > <div class="table">
-- > <div class="table-row">
-- > <div class="table-cell"> ... </div>
-- > <div class="table-cell"> ... </div>
--... | 1,175 | grid :: [[UI Element]] -> UI Element
grid mrows = do
rows0 <- mapM (sequence) mrows
rows <- forM rows0 $ \row0 -> do
row <- forM row0 $ \entry ->
wrap "table-cell" [entry]
wrap "table-row" row
wrap "table" rows
where
wrap c xs = mkElement... | 581 | grid mrows = do
rows0 <- mapM (sequence) mrows
rows <- forM rows0 $ \row0 -> do
row <- forM row0 $ \entry ->
wrap "table-cell" [entry]
wrap "table-row" row
wrap "table" rows
where
wrap c xs = mkElement "div" # set (attr "class") c #+ map ele... | 541 | true | true | 0 | 16 | 284 | 168 | 89 | 79 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/HTools/Program/Hbal.hs | bsd-2-clause | selectGroup :: Options -> Group.List -> Node.List -> Instance.List
-> IO (String, (Node.List, Instance.List))
selectGroup opts gl nlf ilf = do
let ngroups = Cluster.splitCluster nlf ilf
when (length ngroups > 1 && isNothing (optGroup opts)) $ do
hPutStrLn stderr "Found multiple node groups:"
map... | 1,272 | selectGroup :: Options -> Group.List -> Node.List -> Instance.List
-> IO (String, (Node.List, Instance.List))
selectGroup opts gl nlf ilf = do
let ngroups = Cluster.splitCluster nlf ilf
when (length ngroups > 1 && isNothing (optGroup opts)) $ do
hPutStrLn stderr "Found multiple node groups:"
map... | 1,272 | selectGroup opts gl nlf ilf = do
let ngroups = Cluster.splitCluster nlf ilf
when (length ngroups > 1 && isNothing (optGroup opts)) $ do
hPutStrLn stderr "Found multiple node groups:"
mapM_ (hPutStrLn stderr . (" " ++) . Group.name .
flip Container.find gl . fst) ngroups
exitErr "Aborting."
... | 1,150 | false | true | 0 | 20 | 370 | 407 | 194 | 213 | null | null |
derekmcloughlin/BridgeBuddyServer | library/BridgeBuddy/Cards.hs | apache-2.0 | playingTricksInHonours _ = 0 | 35 | playingTricksInHonours _ = 0 | 35 | playingTricksInHonours _ = 0 | 35 | false | false | 0 | 4 | 10 | 10 | 4 | 6 | null | null |
JoeyEremondi/haskelm | src/Language/Elm/TH/Util.hs | bsd-3-clause | --translate newName into our new monad
liftNewName :: String -> SQ Name
liftNewName s = do
oldState <- S.get
let num = currentNum oldState
name <- S.lift $ newName $ s ++ "__xxfreshxx__" ++ show num
S.put $ oldState {currentNum = num + 1}
return name | 260 | liftNewName :: String -> SQ Name
liftNewName s = do
oldState <- S.get
let num = currentNum oldState
name <- S.lift $ newName $ s ++ "__xxfreshxx__" ++ show num
S.put $ oldState {currentNum = num + 1}
return name | 221 | liftNewName s = do
oldState <- S.get
let num = currentNum oldState
name <- S.lift $ newName $ s ++ "__xxfreshxx__" ++ show num
S.put $ oldState {currentNum = num + 1}
return name | 188 | true | true | 0 | 12 | 55 | 98 | 46 | 52 | null | null |
Kyly/liquidhaskell | tests/test.hs | bsd-3-clause | benchTests
= group "Benchmarks" [
testGroup "text" <$> dirTests "benchmarks/text-0.11.2.3" textIgnored ExitSuccess
, testGroup "bytestring" <$> dirTests "benchmarks/bytestring-0.9.2.1" [] ExitSuccess
, testGroup "esop" <$> dirTests "benchmarks/esop2013-submis... | 817 | benchTests
= group "Benchmarks" [
testGroup "text" <$> dirTests "benchmarks/text-0.11.2.3" textIgnored ExitSuccess
, testGroup "bytestring" <$> dirTests "benchmarks/bytestring-0.9.2.1" [] ExitSuccess
, testGroup "esop" <$> dirTests "benchmarks/esop2013-submis... | 817 | benchTests
= group "Benchmarks" [
testGroup "text" <$> dirTests "benchmarks/text-0.11.2.3" textIgnored ExitSuccess
, testGroup "bytestring" <$> dirTests "benchmarks/bytestring-0.9.2.1" [] ExitSuccess
, testGroup "esop" <$> dirTests "benchmarks/esop2013-submis... | 817 | false | false | 1 | 10 | 238 | 158 | 74 | 84 | null | null |
badi/super-user-spark | src/Constants.hs | mit | copyKindSymbol :: String
copyKindSymbol = "c->" | 47 | copyKindSymbol :: String
copyKindSymbol = "c->" | 47 | copyKindSymbol = "c->" | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_AU3_STRING :: Int
wxSTC_AU3_STRING = 7 | 44 | wxSTC_AU3_STRING :: Int
wxSTC_AU3_STRING = 7 | 44 | wxSTC_AU3_STRING = 7 | 20 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
sgillespie/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar,
isMetaTyVar, isAmbiguousTyVar,
isFmvTyVar, isFskTyVar, isFlattenTyVar :: TcTyVar -> Bool
isTyConableTyVar tv
-- True of a meta-type variable that can be filled in
-- with a type constructor application; in particular,
-- not a SigTv
= ... | 470 | isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar,
isMetaTyVar, isAmbiguousTyVar,
isFmvTyVar, isFskTyVar, isFlattenTyVar :: TcTyVar -> Bool
isTyConableTyVar tv
-- True of a meta-type variable that can be filled in
-- with a type constructor application; in particular,
-- not a SigTv
= A... | 469 | isTyConableTyVar tv
-- True of a meta-type variable that can be filled in
-- with a type constructor application; in particular,
-- not a SigTv
= ASSERT2( isTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_info = SigTv } -> False
_ -> Tr... | 322 | false | true | 0 | 10 | 135 | 81 | 48 | 33 | null | null |
cchalmers/dense | src/Data/Dense/Boxed.hs | bsd-3-clause | -- | Create an array from a 'vector' and a 'layout'. Throws an error if
-- the vector is not the right shape.
fromVectorInto_ :: Shape f => Layout f -> Vector a -> BArray f a
fromVectorInto_ = G.fromVectorInto_ | 212 | fromVectorInto_ :: Shape f => Layout f -> Vector a -> BArray f a
fromVectorInto_ = G.fromVectorInto_ | 100 | fromVectorInto_ = G.fromVectorInto_ | 35 | true | true | 0 | 8 | 41 | 41 | 20 | 21 | null | null |
GaloisInc/saw-script | heapster-saw/src/Verifier/SAW/Heapster/archival/Permissions.hs | bsd-3-clause | -- Prove x=e2 when x:eq(e1) is in the context by proving e1=e2
proveEqH perms vars s (PExpr_Var x) e2
| ValPerm_Eq e1 <- getPerm perms x
= applyEqProof (\diff -> EqProof_CastEq (extendContext' diff x)
(extendContext' diff e1)) $
proveEq perms vars s e1 e2 | 290 | proveEqH perms vars s (PExpr_Var x) e2
| ValPerm_Eq e1 <- getPerm perms x
= applyEqProof (\diff -> EqProof_CastEq (extendContext' diff x)
(extendContext' diff e1)) $
proveEq perms vars s e1 e2 | 227 | proveEqH perms vars s (PExpr_Var x) e2
| ValPerm_Eq e1 <- getPerm perms x
= applyEqProof (\diff -> EqProof_CastEq (extendContext' diff x)
(extendContext' diff e1)) $
proveEq perms vars s e1 e2 | 227 | true | false | 0 | 12 | 78 | 89 | 42 | 47 | null | null |
spechub/Hets | CASL/Overload.hs | gpl-2.0 | cmpSubsort :: Sign f e -> POrder SORT
cmpSubsort sign s1 s2 =
if s1 == s2 then Just EQ else
let l1 = supersortsOf s1 sign
l2 = supersortsOf s2 sign
b = Set.member s1 l2 in
if Set.member s2 l1 then
Just $ if b then EQ else LT
else if b then Just GT else Nothing | 300 | cmpSubsort :: Sign f e -> POrder SORT
cmpSubsort sign s1 s2 =
if s1 == s2 then Just EQ else
let l1 = supersortsOf s1 sign
l2 = supersortsOf s2 sign
b = Set.member s1 l2 in
if Set.member s2 l1 then
Just $ if b then EQ else LT
else if b then Just GT else Nothing | 300 | cmpSubsort sign s1 s2 =
if s1 == s2 then Just EQ else
let l1 = supersortsOf s1 sign
l2 = supersortsOf s2 sign
b = Set.member s1 l2 in
if Set.member s2 l1 then
Just $ if b then EQ else LT
else if b then Just GT else Nothing | 262 | false | true | 0 | 11 | 98 | 126 | 62 | 64 | null | null |
three/codeworld | codeworld-compiler/src/Compile.hs | apache-2.0 | withTimeout :: Int -> IO a -> IO (Maybe a)
withTimeout micros action = do
result <- newEmptyMVar
killer <- forkIO $ threadDelay micros >> putMVar result Nothing
runner <- forkIO $ action >>= putMVar result . Just
r <- takeMVar result
killThread killer
killThread runner
return r | 306 | withTimeout :: Int -> IO a -> IO (Maybe a)
withTimeout micros action = do
result <- newEmptyMVar
killer <- forkIO $ threadDelay micros >> putMVar result Nothing
runner <- forkIO $ action >>= putMVar result . Just
r <- takeMVar result
killThread killer
killThread runner
return r | 306 | withTimeout micros action = do
result <- newEmptyMVar
killer <- forkIO $ threadDelay micros >> putMVar result Nothing
runner <- forkIO $ action >>= putMVar result . Just
r <- takeMVar result
killThread killer
killThread runner
return r | 263 | false | true | 0 | 10 | 75 | 116 | 50 | 66 | null | null |
advancedtelematic/quickcheck-state-machine-model | src/Test/StateMachine/Markov.hs | bsd-3-clause | historyObservations :: forall model cmd m resp state cmd_ prob. Ord state
=> Ord cmd_
=> (Generic state, GEnum FiniteEnum (Rep state), GBounded (Rep state))
=> StateMachine model cmd m resp
-> Markov state cmd_ prob
-> (... | 1,908 | historyObservations :: forall model cmd m resp state cmd_ prob. Ord state
=> Ord cmd_
=> (Generic state, GEnum FiniteEnum (Rep state), GBounded (Rep state))
=> StateMachine model cmd m resp
-> Markov state cmd_ prob
-> (... | 1,908 | historyObservations StateMachine { initModel, transition, postcondition } markov partition constructor
= go initModel Map.empty Map.empty . makeOperations . unHistory
where
go _model ss fs [] =
( enumMatrix @state (fromMaybe 0 . flip Map.lookup ss)
, enumMatrix @state (fromMaybe 0 . flip Map.lookup ... | 1,374 | false | true | 7 | 17 | 712 | 590 | 296 | 294 | null | null |
rueshyna/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/Projects/Update.hs | mpl-2.0 | -- | OAuth access token.
proAccessToken :: Lens' ProjectsUpdate (Maybe Text)
proAccessToken
= lens _proAccessToken
(\ s a -> s{_proAccessToken = a}) | 156 | proAccessToken :: Lens' ProjectsUpdate (Maybe Text)
proAccessToken
= lens _proAccessToken
(\ s a -> s{_proAccessToken = a}) | 131 | proAccessToken
= lens _proAccessToken
(\ s a -> s{_proAccessToken = a}) | 79 | true | true | 1 | 9 | 29 | 52 | 25 | 27 | null | null |
deweyvm/kayvee | src/Database/Kayvee/Common.hs | mit | hashPut :: String -> Pointer -> Put
hashPut s p = do
let (h0, h1, h2, h3) = makeHash s
putWord32be h0
putWord32be h1
putWord32be h2
putWord32be h3
putWord64be p | 184 | hashPut :: String -> Pointer -> Put
hashPut s p = do
let (h0, h1, h2, h3) = makeHash s
putWord32be h0
putWord32be h1
putWord32be h2
putWord32be h3
putWord64be p | 184 | hashPut s p = do
let (h0, h1, h2, h3) = makeHash s
putWord32be h0
putWord32be h1
putWord32be h2
putWord32be h3
putWord64be p | 148 | false | true | 0 | 10 | 53 | 79 | 35 | 44 | null | null |
mit-plv/riscv-semantics | src/Spec/Decode.hs | bsd-3-clause | bitwidth RV64I = 64 | 19 | bitwidth RV64I = 64 | 19 | bitwidth RV64I = 64 | 19 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
reiddraper/cauterize | src/Cauterize/Dynamic/Pretty.hs | bsd-3-clause | prettyDetails _ n (CDSynonym bid) = parens $ "synonym" <+> text n <+> prettyBuiltIn bid | 87 | prettyDetails _ n (CDSynonym bid) = parens $ "synonym" <+> text n <+> prettyBuiltIn bid | 87 | prettyDetails _ n (CDSynonym bid) = parens $ "synonym" <+> text n <+> prettyBuiltIn bid | 87 | false | false | 0 | 7 | 14 | 37 | 17 | 20 | null | null |
leonschoorl/sprockell | src/DemoCharIO.hs | mit | {-|
This program demonstrates the character IO system.
We ask the users name.
And print a custom greeting.
-}
prog :: [Instruction]
prog =
writeString "What is your name? " ++
[ Load (ImmValue $ ord '\n') regE -- ASCII code newline in regE for later reference
-- "beginInputLoop": 39
, Re... | 1,241 | prog :: [Instruction]
prog =
writeString "What is your name? " ++
[ Load (ImmValue $ ord '\n') regE -- ASCII code newline in regE for later reference
-- "beginInputLoop": 39
, ReadInstr charIO -- Request a character from stdin
, Receive regA -- Save it in reg... | 1,118 | prog =
writeString "What is your name? " ++
[ Load (ImmValue $ ord '\n') regE -- ASCII code newline in regE for later reference
-- "beginInputLoop": 39
, ReadInstr charIO -- Request a character from stdin
, Receive regA -- Save it in regA (as ASCII code)
... | 1,096 | true | true | 7 | 11 | 417 | 261 | 137 | 124 | null | null |
ezyang/ghc | compiler/simplCore/SimplEnv.hs | bsd-3-clause | addNewInScopeIds :: SimplEnv -> [CoreBndr] -> SimplEnv
-- The new Ids are guaranteed to be freshly allocated
addNewInScopeIds env@(SimplEnv { seInScope = in_scope, seIdSubst = id_subst }) vs
= env { seInScope = in_scope `extendInScopeSetList` vs,
seIdSubst = id_subst `delVarEnvList` vs } | 308 | addNewInScopeIds :: SimplEnv -> [CoreBndr] -> SimplEnv
addNewInScopeIds env@(SimplEnv { seInScope = in_scope, seIdSubst = id_subst }) vs
= env { seInScope = in_scope `extendInScopeSetList` vs,
seIdSubst = id_subst `delVarEnvList` vs } | 246 | addNewInScopeIds env@(SimplEnv { seInScope = in_scope, seIdSubst = id_subst }) vs
= env { seInScope = in_scope `extendInScopeSetList` vs,
seIdSubst = id_subst `delVarEnvList` vs } | 191 | true | true | 7 | 10 | 61 | 93 | 47 | 46 | null | null |
hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/haskell/snippet03.hs | gpl-3.0 | triples = do
z <- [1..]
x <- [1..z]
y <- [x..z]
guard (x^2 + y^2 == z^2)
return (x, y, z) | 109 | triples = do
z <- [1..]
x <- [1..z]
y <- [x..z]
guard (x^2 + y^2 == z^2)
return (x, y, z) | 109 | triples = do
z <- [1..]
x <- [1..z]
y <- [x..z]
guard (x^2 + y^2 == z^2)
return (x, y, z) | 109 | false | false | 0 | 13 | 41 | 84 | 42 | 42 | null | null |
GRACeFUL-project/haskelzinc | examples.hs | bsd-3-clause | apdata :: [Item]
knapdata = [
"n" =. int 6,
"capacity" =. int 13,
"profits" =. intArray [5, 9, 15, 10, 3, 6],
"weights" =. int 1 ... int 6]
| 149 | knapdata :: [Item]
knapdata = [
"n" =. int 6,
"capacity" =. int 13,
"profits" =. intArray [5, 9, 15, 10, 3, 6],
"weights" =. int 1 ... int 6] | 149 | knapdata = [
"n" =. int 6,
"capacity" =. int 13,
"profits" =. intArray [5, 9, 15, 10, 3, 6],
"weights" =. int 1 ... int 6] | 130 | false | true | 0 | 8 | 39 | 85 | 44 | 41 | null | null |
GaloisInc/halvm-ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | isTyCoArg _ = False | 31 | isTyCoArg _ = False | 31 | isTyCoArg _ = False | 31 | false | false | 0 | 4 | 15 | 10 | 4 | 6 | null | null |
ducis/haAni | hs/common/Graphics/Rendering/OpenGL/GL/Texturing/Environments.hs | gpl-2.0 | -- GL_COORD_REPLACE_NV
marshalTextureEnvTarget :: TextureEnvTarget -> GLenum
marshalTextureEnvTarget x = case x of
TextureEnv -> gl_TEXTURE_ENV
TextureFilterControl -> gl_TEXTURE_FILTER_CONTROL
PointSprite -> gl_POINT_SPRITE
-------------------------------------------------------------------------------- | 316 | marshalTextureEnvTarget :: TextureEnvTarget -> GLenum
marshalTextureEnvTarget x = case x of
TextureEnv -> gl_TEXTURE_ENV
TextureFilterControl -> gl_TEXTURE_FILTER_CONTROL
PointSprite -> gl_POINT_SPRITE
-------------------------------------------------------------------------------- | 292 | marshalTextureEnvTarget x = case x of
TextureEnv -> gl_TEXTURE_ENV
TextureFilterControl -> gl_TEXTURE_FILTER_CONTROL
PointSprite -> gl_POINT_SPRITE
-------------------------------------------------------------------------------- | 238 | true | true | 0 | 7 | 33 | 42 | 22 | 20 | null | null |
ksaveljev/hake-2 | src/Util/Binary.hs | bsd-3-clause | getFloat :: Get Float
getFloat = getFloat32le | 45 | getFloat :: Get Float
getFloat = getFloat32le | 45 | getFloat = getFloat32le | 23 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
TOSPIO/yi | src/library/Yi/Editor.hs | gpl-2.0 | -- | Return the windows that are currently open on the buffer whose
-- key is given
windowsOnBufferE :: BufferRef -> EditorM [Window]
windowsOnBufferE k = do
ts <- use tabsA
let tabBufEq = concatMap (\win -> [win | bufkey win == k]) . (^. tabWindowsA)
return $ concatMap tabBufEq ts
-- | bring the editor focus th... | 402 | windowsOnBufferE :: BufferRef -> EditorM [Window]
windowsOnBufferE k = do
ts <- use tabsA
let tabBufEq = concatMap (\win -> [win | bufkey win == k]) . (^. tabWindowsA)
return $ concatMap tabBufEq ts
-- | bring the editor focus the window with the given key.
--
-- Fails if no window with the given key is found. | 318 | windowsOnBufferE k = do
ts <- use tabsA
let tabBufEq = concatMap (\win -> [win | bufkey win == k]) . (^. tabWindowsA)
return $ concatMap tabBufEq ts
-- | bring the editor focus the window with the given key.
--
-- Fails if no window with the given key is found. | 268 | true | true | 0 | 17 | 81 | 93 | 48 | 45 | null | null |
spetz911/progames | _src/lab5.hs | mit | main :: IO ()
main = do
True <- GLFW.initialize
True <- GLFW.openWindow defaultDisplayOptions
{ displayOptions_width = 500
, displayOptions_height = 500}
GLFW.setWindowTitle "Chapter 2"
GL.clearColor $= Color4 1 1 1 1
-- initShaders
vs <- loadShader VertexShader $... | 1,495 | main :: IO ()
main = do
True <- GLFW.initialize
True <- GLFW.openWindow defaultDisplayOptions
{ displayOptions_width = 500
, displayOptions_height = 500}
GLFW.setWindowTitle "Chapter 2"
GL.clearColor $= Color4 1 1 1 1
-- initShaders
vs <- loadShader VertexShader $... | 1,495 | main = do
True <- GLFW.initialize
True <- GLFW.openWindow defaultDisplayOptions
{ displayOptions_width = 500
, displayOptions_height = 500}
GLFW.setWindowTitle "Chapter 2"
GL.clearColor $= Color4 1 1 1 1
-- initShaders
vs <- loadShader VertexShader $ "shaders" </>... | 1,481 | false | true | 0 | 12 | 339 | 454 | 206 | 248 | null | null |
Gabriel439/Haskell-Crunch-Library | test/Main.hs | bsd-3-clause | roundTrip :: (Eq a, Serializable a) => a -> Bool
roundTrip x = case decodeBytes (encodeBytes x) of
Left _ -> False
Right x' -> x' == x | 144 | roundTrip :: (Eq a, Serializable a) => a -> Bool
roundTrip x = case decodeBytes (encodeBytes x) of
Left _ -> False
Right x' -> x' == x | 144 | roundTrip x = case decodeBytes (encodeBytes x) of
Left _ -> False
Right x' -> x' == x | 95 | false | true | 0 | 8 | 37 | 68 | 33 | 35 | null | null |
bergey/panther | src/Ray/Core.hs | bsd-3-clause | getSampleLocs :: M (Array2D [V2 Double])
getSampleLocs = do
sampler <- view $ algorithms . imageSampler
n <- view $ algorithms . samplesPerPixel
pxs <- enumPixelCoords
ss <- traverse (sampler n) pxs
res <- view $ algorithms . resolution
return $ array (0, res - 1) $ zip pxs ss | 301 | getSampleLocs :: M (Array2D [V2 Double])
getSampleLocs = do
sampler <- view $ algorithms . imageSampler
n <- view $ algorithms . samplesPerPixel
pxs <- enumPixelCoords
ss <- traverse (sampler n) pxs
res <- view $ algorithms . resolution
return $ array (0, res - 1) $ zip pxs ss | 301 | getSampleLocs = do
sampler <- view $ algorithms . imageSampler
n <- view $ algorithms . samplesPerPixel
pxs <- enumPixelCoords
ss <- traverse (sampler n) pxs
res <- view $ algorithms . resolution
return $ array (0, res - 1) $ zip pxs ss | 260 | false | true | 0 | 11 | 73 | 125 | 59 | 66 | null | null |
takoeight0821/malgo | src/Malgo/Rename/RnEnv.hs | bsd-3-clause | varEnv :: Lens' RnEnv (HashMap PsId [Annotated Visibility RnId])
varEnv = lens _varEnv (\r x -> r {_varEnv = x}) | 112 | varEnv :: Lens' RnEnv (HashMap PsId [Annotated Visibility RnId])
varEnv = lens _varEnv (\r x -> r {_varEnv = x}) | 112 | varEnv = lens _varEnv (\r x -> r {_varEnv = x}) | 47 | false | true | 2 | 9 | 19 | 64 | 29 | 35 | null | null |
nevrenato/Hets_Fork | Common/Lexer.hs | gpl-2.0 | -- convert '"' to '\"' and "'" to "\'" (no support for ''')
scanString :: CharParser st String
scanString = flat (many (caslChar <|> (char '\'' >> return "\\\'")))
`enclosedBy` char '"' <?> "literal string" | 211 | scanString :: CharParser st String
scanString = flat (many (caslChar <|> (char '\'' >> return "\\\'")))
`enclosedBy` char '"' <?> "literal string" | 150 | scanString = flat (many (caslChar <|> (char '\'' >> return "\\\'")))
`enclosedBy` char '"' <?> "literal string" | 115 | true | true | 0 | 14 | 39 | 59 | 30 | 29 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag") | 63 | getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag") | 63 | getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag") | 63 | false | false | 0 | 7 | 18 | 17 | 8 | 9 | null | null |
danidiaz/process-streaming | src/System/Process/Streaming.hs | bsd-3-clause | {-| Like 'executeFallibly', but 'std_in' will be unbuffered if piped.
-}
executeInteractiveFallibly ::
CreateProcess
-> Streams e a
-> IO (Either e a)
executeInteractiveFallibly = executeFalliblyInternal (\h -> hSetBuffering h NoBuffering) | 259 | executeInteractiveFallibly ::
CreateProcess
-> Streams e a
-> IO (Either e a)
executeInteractiveFallibly = executeFalliblyInternal (\h -> hSetBuffering h NoBuffering) | 183 | executeInteractiveFallibly = executeFalliblyInternal (\h -> hSetBuffering h NoBuffering) | 88 | true | true | 0 | 10 | 50 | 54 | 26 | 28 | null | null |
vialette/ppattern-tmp | src/Data/Algorithm/PPattern/Geometry/ColorPoint.hs | mit | {-|
'mkBlank' makes a blank point from two coordinates.
-}
mkBlank :: Int -> Int -> ColorPoint
mkBlank x y = mkBlank' p
where
p = Point.mk x y
{-|
'mkPoint' makes a blank point from a point.
-} | 222 | mkBlank :: Int -> Int -> ColorPoint
mkBlank x y = mkBlank' p
where
p = Point.mk x y
{-|
'mkPoint' makes a blank point from a point.
-} | 153 | mkBlank x y = mkBlank' p
where
p = Point.mk x y
{-|
'mkPoint' makes a blank point from a point.
-} | 117 | true | true | 0 | 8 | 67 | 43 | 22 | 21 | null | null |
input-output-hk/pos-haskell-prototype | wallet/src/Cardano/Wallet/WalletLayer/Kernel/Accounts.hs | mit | filterHdAddress (FilterOp op NoFilters) = FilterOp (coerce op) NoFilters | 72 | filterHdAddress (FilterOp op NoFilters) = FilterOp (coerce op) NoFilters | 72 | filterHdAddress (FilterOp op NoFilters) = FilterOp (coerce op) NoFilters | 72 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
DanielJanzon/CryptoLab | CyclicGroup.hs | bsd-3-clause | xeuh u g x y a b = let
s = u - (div g y)*x
t = mod g y
in
xeuh x y s t a b | 156 | xeuh u g x y a b = let
s = u - (div g y)*x
t = mod g y
in
xeuh x y s t a b | 156 | xeuh u g x y a b = let
s = u - (div g y)*x
t = mod g y
in
xeuh x y s t a b | 156 | false | false | 0 | 12 | 110 | 69 | 33 | 36 | null | null |
spacekitteh/smcghc | compiler/utils/Serialized.hs | bsd-3-clause | serializeConstr (IntConstr i) = serializeWord8 2 . serializeInteger i | 72 | serializeConstr (IntConstr i) = serializeWord8 2 . serializeInteger i | 72 | serializeConstr (IntConstr i) = serializeWord8 2 . serializeInteger i | 72 | false | false | 0 | 7 | 11 | 25 | 11 | 14 | null | null |
aelve/ilist | bench/Functions.hs | bsd-3-clause | ifoldr_vec :: (Int -> a -> b -> b) -> b -> [a] -> b
ifoldr_vec f a xs = V.ifoldr f a (V.fromList xs) | 100 | ifoldr_vec :: (Int -> a -> b -> b) -> b -> [a] -> b
ifoldr_vec f a xs = V.ifoldr f a (V.fromList xs) | 100 | ifoldr_vec f a xs = V.ifoldr f a (V.fromList xs) | 48 | false | true | 0 | 9 | 24 | 65 | 33 | 32 | null | null |
Mathnerd314/lamdu | src/Lamdu/CodeEdit/Sugar/Convert/Apply.hs | gpl-3.0 | makeCollapsed ::
(MonadA m, Typeable1 m, Monoid a) =>
PayloadMM m a ->
Guid -> GetVar MStoredName m -> Bool ->
ExpressionU m a -> SugarM m (ExpressionU m a)
makeCollapsed exprPl g compact hasInfo fullExpression =
BodyCollapsed Collapsed
{ _cFuncGuid = g
, _cCompact = compact
, _cFullExprHasInfo = hasInf... | 670 | makeCollapsed ::
(MonadA m, Typeable1 m, Monoid a) =>
PayloadMM m a ->
Guid -> GetVar MStoredName m -> Bool ->
ExpressionU m a -> SugarM m (ExpressionU m a)
makeCollapsed exprPl g compact hasInfo fullExpression =
BodyCollapsed Collapsed
{ _cFuncGuid = g
, _cCompact = compact
, _cFullExprHasInfo = hasInf... | 670 | makeCollapsed exprPl g compact hasInfo fullExpression =
BodyCollapsed Collapsed
{ _cFuncGuid = g
, _cCompact = compact
, _cFullExprHasInfo = hasInfo
, _cFullExpression =
fullExpression
& SugarExpr.removeInferredTypes
& rPayload . plGuid .~ expandedGuid
& rPayload . plData .~ mempty
}
& Sug... | 505 | false | true | 4 | 14 | 138 | 215 | 107 | 108 | null | null |
jmitchell/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | fc_start NoFC = (0, 0) | 22 | fc_start NoFC = (0, 0) | 22 | fc_start NoFC = (0, 0) | 22 | false | false | 0 | 5 | 4 | 15 | 8 | 7 | null | null |
hvr/lens | src/Control/Lens/Lens.hs | bsd-3-clause | -- | A version of ('Control.Lens.Setter..~') that works on 'ALens'.
--
-- >>> ("hello","there") & _2 #~ "world"
-- ("hello","world")
( #~ ) :: ALens s t a b -> b -> s -> t
( #~ ) l b s = ipeek b (l sell s) | 205 | ( #~ ) :: ALens s t a b -> b -> s -> t
( #~ ) l b s = ipeek b (l sell s) | 72 | ( #~ ) l b s = ipeek b (l sell s) | 33 | true | true | 0 | 9 | 46 | 67 | 34 | 33 | null | null |
amccausl/Swish | Swish/HaskellRDF/BuiltInDatatypes.hs | lgpl-2.1 | findRDFDatatype :: ScopedName -> Maybe RDFDatatype
findRDFDatatype nam = mapFindMaybe nam (LookupMap allDatatypes) | 115 | findRDFDatatype :: ScopedName -> Maybe RDFDatatype
findRDFDatatype nam = mapFindMaybe nam (LookupMap allDatatypes) | 114 | findRDFDatatype nam = mapFindMaybe nam (LookupMap allDatatypes) | 63 | false | true | 0 | 7 | 13 | 32 | 15 | 17 | null | null |
hspec/HUnit | src/Test/HUnit/Lang.hs | bsd-3-clause | assertFailure ::
HasCallStack_
String -- ^ A message that is displayed with the assertion failure
-> IO a
assertFailure msg = msg `deepseq` E.throwIO (HUnitFailure location $ Reason msg) | 198 | assertFailure ::
HasCallStack_
String -- ^ A message that is displayed with the assertion failure
-> IO a
assertFailure msg = msg `deepseq` E.throwIO (HUnitFailure location $ Reason msg) | 198 | assertFailure msg = msg `deepseq` E.throwIO (HUnitFailure location $ Reason msg) | 80 | false | true | 0 | 9 | 40 | 50 | 24 | 26 | null | null |
sdiehl/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | -- | Takes a nested application expression and returns the function
-- being applied and the arguments to which it is applied
collectAnnArgs :: AnnExpr b a -> (AnnExpr b a, [AnnExpr b a])
collectAnnArgs expr
= go expr []
where
go (_, AnnApp f a) as = go f (a:as)
go e as = (e, as) | 306 | collectAnnArgs :: AnnExpr b a -> (AnnExpr b a, [AnnExpr b a])
collectAnnArgs expr
= go expr []
where
go (_, AnnApp f a) as = go f (a:as)
go e as = (e, as) | 180 | collectAnnArgs expr
= go expr []
where
go (_, AnnApp f a) as = go f (a:as)
go e as = (e, as) | 118 | true | true | 1 | 10 | 82 | 111 | 54 | 57 | null | null |
cnc-patch/disass | src/Language/Assembly/X86/Parse.hs | bsd-3-clause | parseGrp12 :: (Stream s m Word8, Monad m) => Word8 -> ParsecT s PState m Instr
parseGrp12 b = do
st <- getState
let opsize = if hasPrefix 0x66 st then OP128 else OP64
(op1, op2, mod, reg, rm) <- parseAddress32 opsize
case mod of
3 -> case reg of
2 -> mmxInstr op1 mod reg rm PSRLW
4 -> ... | 462 | parseGrp12 :: (Stream s m Word8, Monad m) => Word8 -> ParsecT s PState m Instr
parseGrp12 b = do
st <- getState
let opsize = if hasPrefix 0x66 st then OP128 else OP64
(op1, op2, mod, reg, rm) <- parseAddress32 opsize
case mod of
3 -> case reg of
2 -> mmxInstr op1 mod reg rm PSRLW
4 -> ... | 462 | parseGrp12 b = do
st <- getState
let opsize = if hasPrefix 0x66 st then OP128 else OP64
(op1, op2, mod, reg, rm) <- parseAddress32 opsize
case mod of
3 -> case reg of
2 -> mmxInstr op1 mod reg rm PSRLW
4 -> mmxInstr op1 mod reg rm PSRAW
6 -> mmxInstr op1 mod reg rm PSLLW
... | 383 | false | true | 0 | 13 | 141 | 186 | 91 | 95 | null | null |
LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Common/State.hs | bsd-3-clause | sgameModeId :: State -> ContentId ModeKind
sgameModeId = _sgameModeId | 69 | sgameModeId :: State -> ContentId ModeKind
sgameModeId = _sgameModeId | 69 | sgameModeId = _sgameModeId | 26 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
cdxr/haskell-interface | src/LoadModuleInterface.hs | bsd-3-clause | pkgKeyFromCabal :: Cabal.PackageKey -> PkgKey
pkgKeyFromCabal = PkgKey . Cabal.display | 86 | pkgKeyFromCabal :: Cabal.PackageKey -> PkgKey
pkgKeyFromCabal = PkgKey . Cabal.display | 86 | pkgKeyFromCabal = PkgKey . Cabal.display | 40 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
mmalvarez/frenetic-iptables | Pred.hs | bsd-3-clause | translateRule (Rule (Dstport port) a) =
"iptables -A INPUT --dports " ++ show port ++ " " ++ translateAction a | 112 | translateRule (Rule (Dstport port) a) =
"iptables -A INPUT --dports " ++ show port ++ " " ++ translateAction a | 112 | translateRule (Rule (Dstport port) a) =
"iptables -A INPUT --dports " ++ show port ++ " " ++ translateAction a | 112 | false | false | 0 | 9 | 21 | 41 | 19 | 22 | null | null |
cjp256/manager | xenmgr/Vm/Config.hs | gpl-2.0 | cpuidResponses :: VmConfig -> [String]
cpuidResponses cfg = map option (vmcfgCpuidResponses cfg) where
option (CpuidResponse r) = printf "cpuid=%s" r
-- Additional misc stuff in xenvm config | 195 | cpuidResponses :: VmConfig -> [String]
cpuidResponses cfg = map option (vmcfgCpuidResponses cfg) where
option (CpuidResponse r) = printf "cpuid=%s" r
-- Additional misc stuff in xenvm config | 195 | cpuidResponses cfg = map option (vmcfgCpuidResponses cfg) where
option (CpuidResponse r) = printf "cpuid=%s" r
-- Additional misc stuff in xenvm config | 156 | false | true | 0 | 7 | 31 | 53 | 27 | 26 | null | null |
nomeata/codeworld | codeworld-base/src/Internal/Color.hs | apache-2.0 | duller :: (Color, Number) -> Color
duller (c, d) = fromCWColor (CW.duller (toDouble d) (toCWColor c)) | 101 | duller :: (Color, Number) -> Color
duller (c, d) = fromCWColor (CW.duller (toDouble d) (toCWColor c)) | 101 | duller (c, d) = fromCWColor (CW.duller (toDouble d) (toCWColor c)) | 66 | false | true | 0 | 9 | 15 | 55 | 29 | 26 | null | null |
fpco/serial-bench | binary-0.4.3.1/src/Data/Binary/Get.hs | bsd-3-clause | shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i) | 60 | shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i) | 60 | shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i) | 60 | false | false | 0 | 7 | 9 | 37 | 18 | 19 | null | null |
olsner/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | extendModuleEnv :: ModuleEnv a -> Module -> a -> ModuleEnv a
extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert (NDModule m) x e) | 136 | extendModuleEnv :: ModuleEnv a -> Module -> a -> ModuleEnv a
extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert (NDModule m) x e) | 136 | extendModuleEnv (ModuleEnv e) m x = ModuleEnv (Map.insert (NDModule m) x e) | 75 | false | true | 0 | 9 | 22 | 63 | 30 | 33 | null | null |
oldmanmike/ghc | compiler/basicTypes/Name.hs | bsd-3-clause | nameSortStableString Internal = "$_in" | 38 | nameSortStableString Internal = "$_in" | 38 | nameSortStableString Internal = "$_in" | 38 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
zerobuzz/reasonable-lens | src/Control/Lens/TH.hs | mit | ----
-- types
createLensTypeSig :: [TyVarBndr] -> Name -> Type -> TypeQ
createLensTypeSig tvbs tn ty = do
--runIO $ trace1 tvbs tn ty
-- new var names
let an = type2List ty
nt1 <- mkNp "t1"
nt2 <- mkNp "t2" >>= \xs ->
return (map (jgName an) $ zip nt1 (map snd xs))
-- lens args
let lensArg1 = mkCon ... | 1,257 | createLensTypeSig :: [TyVarBndr] -> Name -> Type -> TypeQ
createLensTypeSig tvbs tn ty = do
--runIO $ trace1 tvbs tn ty
-- new var names
let an = type2List ty
nt1 <- mkNp "t1"
nt2 <- mkNp "t2" >>= \xs ->
return (map (jgName an) $ zip nt1 (map snd xs))
-- lens args
let lensArg1 = mkCon tn nt1
let le... | 1,242 | createLensTypeSig tvbs tn ty = do
--runIO $ trace1 tvbs tn ty
-- new var names
let an = type2List ty
nt1 <- mkNp "t1"
nt2 <- mkNp "t2" >>= \xs ->
return (map (jgName an) $ zip nt1 (map snd xs))
-- lens args
let lensArg1 = mkCon tn nt1
let lensArg2 = mkCon tn nt2
let lensArg3 = repNp ty nt1
let ... | 1,184 | true | true | 32 | 13 | 348 | 513 | 275 | 238 | null | null |
xicesky/sky-haskell-playground | src/Sky/Compositional/Demo1Basics.hs | bsd-3-clause | main :: IO ()
main = print $ (eval (desug sugExample :: ETerm) :: VTerm) | 72 | main :: IO ()
main = print $ (eval (desug sugExample :: ETerm) :: VTerm) | 72 | main = print $ (eval (desug sugExample :: ETerm) :: VTerm) | 58 | false | true | 0 | 9 | 14 | 38 | 20 | 18 | null | null |
polachok/hdict | src/StarDict/Format/Idx.hs | bsd-3-clause | zeroTerminatedUtf8String :: Get Text
zeroTerminatedUtf8String =
fmap (decodeUtf8 . mconcat . LBS.toChunks) getLazyByteStringNul | 131 | zeroTerminatedUtf8String :: Get Text
zeroTerminatedUtf8String =
fmap (decodeUtf8 . mconcat . LBS.toChunks) getLazyByteStringNul | 131 | zeroTerminatedUtf8String =
fmap (decodeUtf8 . mconcat . LBS.toChunks) getLazyByteStringNul | 94 | false | true | 0 | 8 | 16 | 38 | 17 | 21 | null | null |
ptol/oczor | src/Oczor/Syntax/Syntax.hs | mit | newTypeRecord :: [TypeExpr] -> TypeExpr
newTypeRecord = \case {[x] -> x; x -> TypeRecord x} | 91 | newTypeRecord :: [TypeExpr] -> TypeExpr
newTypeRecord = \case {[x] -> x; x -> TypeRecord x} | 91 | newTypeRecord = \case {[x] -> x; x -> TypeRecord x} | 51 | false | true | 0 | 8 | 14 | 41 | 23 | 18 | null | null |
haskell/haddock | haddock-api/src/Haddock/ModuleTree.hs | bsd-2-clause | addToTrees (s1:ss) m pkg srcPkg short (t@(Node s2 leaf node_pkg node_srcPkg node_short subs) : ts)
| s1 > s2 = t : addToTrees (s1:ss) m pkg srcPkg short ts
| s1 == s2 = Node s2 (leaf A.<|> (if null ss then Just m else Nothing)) this_pkg this_srcPkg this_short (addToTrees ss m pkg srcPkg short subs) : ts
| othe... | 537 | addToTrees (s1:ss) m pkg srcPkg short (t@(Node s2 leaf node_pkg node_srcPkg node_short subs) : ts)
| s1 > s2 = t : addToTrees (s1:ss) m pkg srcPkg short ts
| s1 == s2 = Node s2 (leaf A.<|> (if null ss then Just m else Nothing)) this_pkg this_srcPkg this_short (addToTrees ss m pkg srcPkg short subs) : ts
| othe... | 537 | addToTrees (s1:ss) m pkg srcPkg short (t@(Node s2 leaf node_pkg node_srcPkg node_short subs) : ts)
| s1 > s2 = t : addToTrees (s1:ss) m pkg srcPkg short ts
| s1 == s2 = Node s2 (leaf A.<|> (if null ss then Just m else Nothing)) this_pkg this_srcPkg this_short (addToTrees ss m pkg srcPkg short subs) : ts
| othe... | 537 | false | false | 5 | 11 | 114 | 261 | 125 | 136 | null | null |
alekar/hugs | packages/base/Data/Map.hs | bsd-3-clause | -- | /O(log n)/. Insert with a combining function.
-- @'insertWithKey' f key value mp@
-- will insert the pair (key, value) into @mp@ if key does
-- not exist in the map. If the key does exist, the function will
-- insert the pair @(key,f key new_value old_value)@.
-- Note that the key passed to f is the same key pass... | 788 | insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a
insertWithKey f kx x t
= case t of
Tip -> singleton kx x
Bin sy ky y l r
-> case compare kx ky of
LT -> balance ky y (insertWithKey f kx x l) r
GT -> balance ky y l (insertWithKey f kx x r)... | 445 | insertWithKey f kx x t
= case t of
Tip -> singleton kx x
Bin sy ky y l r
-> case compare kx ky of
LT -> balance ky y (insertWithKey f kx x l) r
GT -> balance ky y l (insertWithKey f kx x r)
EQ -> Bin sy kx (f kx x y) l r
-- | Same as 'insertWithKey',... | 368 | true | true | 2 | 10 | 229 | 198 | 98 | 100 | null | null |
yu-i9/thih | src/Thih/Static/Thih.hs | bsd-3-clause | tKind = TCon (Tycon "Kind" Star) | 32 | tKind = TCon (Tycon "Kind" Star) | 32 | tKind = TCon (Tycon "Kind" Star) | 32 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
ckaestne/CIDE | other/CaseStudies/fgl/orig_fgl-5.4.1.1/Data/Graph/Inductive/Graph.hs | gpl-3.0 | insNodes :: DynGraph gr => [LNode a] -> gr a b -> gr a b
insNodes vs g = foldr insNode g vs | 93 | insNodes :: DynGraph gr => [LNode a] -> gr a b -> gr a b
insNodes vs g = foldr insNode g vs | 93 | insNodes vs g = foldr insNode g vs | 34 | false | true | 0 | 8 | 24 | 54 | 25 | 29 | null | null |
nevrenato/HetsAlloy | OWL2/Parse.hs | gpl-2.0 | domainOrRange :: CharParser st DomainOrRange
domainOrRange = choice
$ map (\ f -> pkeyword (showDomainOrRange f) >> return f)
[ADomain, ARange] | 147 | domainOrRange :: CharParser st DomainOrRange
domainOrRange = choice
$ map (\ f -> pkeyword (showDomainOrRange f) >> return f)
[ADomain, ARange] | 147 | domainOrRange = choice
$ map (\ f -> pkeyword (showDomainOrRange f) >> return f)
[ADomain, ARange] | 102 | false | true | 3 | 10 | 24 | 60 | 28 | 32 | null | null |
massysett/penny | penny/lib/Penny/Copper/Copperize.hs | bsd-3-clause | -- | Fails if the 'Fields._origDate' field contains a bad date.
cEnt :: (Troika.Troika, Tranche.Postline a) -> Maybe (Posting Char ())
cEnt (tka, Tranche.Tranche _ pf) = case cTroika tka of
Nothing -> fmap Posting'PostingFields (cPostingFields pf)
Just trio -> fmap f (cPostingFields pf)
where
f = Posting'... | 442 | cEnt :: (Troika.Troika, Tranche.Postline a) -> Maybe (Posting Char ())
cEnt (tka, Tranche.Tranche _ pf) = case cTroika tka of
Nothing -> fmap Posting'PostingFields (cPostingFields pf)
Just trio -> fmap f (cPostingFields pf)
where
f = Posting'TrioMaybeFields
. TrioMaybeFields trio
. Posting... | 378 | cEnt (tka, Tranche.Tranche _ pf) = case cTroika tka of
Nothing -> fmap Posting'PostingFields (cPostingFields pf)
Just trio -> fmap f (cPostingFields pf)
where
f = Posting'TrioMaybeFields
. TrioMaybeFields trio
. PostingFieldsP'Opt
. Just
. PostingFieldsP mempty | 307 | true | true | 3 | 9 | 103 | 133 | 64 | 69 | null | null |
chocoluffy/courseography | hs/WebParsing/PrerequisiteParsing.hs | gpl-3.0 | parsePrerequisites :: Maybe T.Text -> Maybe T.Text
parsePrerequisites Nothing = Nothing | 87 | parsePrerequisites :: Maybe T.Text -> Maybe T.Text
parsePrerequisites Nothing = Nothing | 87 | parsePrerequisites Nothing = Nothing | 36 | false | true | 0 | 7 | 10 | 28 | 13 | 15 | null | null |
thoughtpolice/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | installMaybeExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()
installMaybeExecutableFile verbosity src dest = do
perms <- getPermissions src
if (executable perms) --only checks user x bit
then installExecutableFile verbosity src dest
else installOrdinaryFile verbosity src dest
-- | Given a rel... | 452 | installMaybeExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()
installMaybeExecutableFile verbosity src dest = do
perms <- getPermissions src
if (executable perms) --only checks user x bit
then installExecutableFile verbosity src dest
else installOrdinaryFile verbosity src dest
-- | Given a rel... | 452 | installMaybeExecutableFile verbosity src dest = do
perms <- getPermissions src
if (executable perms) --only checks user x bit
then installExecutableFile verbosity src dest
else installOrdinaryFile verbosity src dest
-- | Given a relative path to a file, copy it to the given directory, preserving
-- the r... | 379 | false | true | 0 | 9 | 79 | 79 | 39 | 40 | null | null |
robeverest/accelerate | Data/Array/Accelerate/Trafo/Sharing.hs | bsd-3-clause | incLayout (PushLayout lyt ix) = PushLayout (incLayout lyt) (SuccIdx ix) | 71 | incLayout (PushLayout lyt ix) = PushLayout (incLayout lyt) (SuccIdx ix) | 71 | incLayout (PushLayout lyt ix) = PushLayout (incLayout lyt) (SuccIdx ix) | 71 | false | false | 0 | 7 | 9 | 35 | 16 | 19 | null | null |
venkat24/codeworld | codeworld-prediction/src/CodeWorld/Prediction/Paper.hs | apache-2.0 | gameRate :: Double
gameRate = 1/6 | 33 | gameRate :: Double
gameRate = 1/6 | 33 | gameRate = 1/6 | 14 | false | true | 2 | 6 | 5 | 24 | 9 | 15 | null | null |
SergeyKrivohatskiy/fp_haskell | hw08/OldParser.hs | mit | parserTestFail :: (Eq a, Show a) => Parser lex a -> [lex] -> Test
parserTestFail (Parser p) s = TestCase $ assertBool "Parser should fail" $ null $ toList (p s) | 160 | parserTestFail :: (Eq a, Show a) => Parser lex a -> [lex] -> Test
parserTestFail (Parser p) s = TestCase $ assertBool "Parser should fail" $ null $ toList (p s) | 160 | parserTestFail (Parser p) s = TestCase $ assertBool "Parser should fail" $ null $ toList (p s) | 94 | false | true | 0 | 8 | 30 | 81 | 39 | 42 | null | null |
fredmorcos/attic | snippets/haskell/fib_2.hs | isc | fib 1 = 1 | 9 | fib 1 = 1 | 9 | fib 1 = 1 | 9 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
ssaavedra/liquidhaskell | benchmarks/containers-0.5.0.0/Data/Map/Base1.hs | bsd-3-clause | -- | /O(n+m)/. Intersection with a combining function.
-- Intersection is more efficient on (bigset \``intersection`\` smallset).
--
-- > let f k al ar = (show k) ++ ":" ++ al ++ "|" ++ ar
-- > intersectionWithKey f (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (7, "C")]) == singleton 5 "5:a|A"
intersectionWit... | 492 | intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c
intersectionWithKey f t1 t2 = mergeWithKey (\k x1 x2 -> Just $ f k x1 x2) (const Tip) (const Tip) t1 t2 | 187 | intersectionWithKey f t1 t2 = mergeWithKey (\k x1 x2 -> Just $ f k x1 x2) (const Tip) (const Tip) t1 t2 | 103 | true | true | 0 | 11 | 101 | 123 | 61 | 62 | null | null |
mk12/euler | haskell/Problem16.hs | mit | solve :: Int
solve = sum . digits $ 2 ^ 1000 | 44 | solve :: Int
solve = sum . digits $ 2 ^ 1000 | 44 | solve = sum . digits $ 2 ^ 1000 | 31 | false | true | 0 | 7 | 11 | 23 | 12 | 11 | null | null |
hguenther/smtlib2 | extras/composite/Language/SMTLib2/Composite/Container.hs | gpl-3.0 | withAccessor :: (Embed m e,Monad m)
=> Accessor a idx b e
-> a e
-> (Path a idx b e -> [e BoolType] -> b e -> m (b e))
-> m (a e)
withAccessor AccId x f = f PathId [] x | 220 | withAccessor :: (Embed m e,Monad m)
=> Accessor a idx b e
-> a e
-> (Path a idx b e -> [e BoolType] -> b e -> m (b e))
-> m (a e)
withAccessor AccId x f = f PathId [] x | 220 | withAccessor AccId x f = f PathId [] x | 38 | false | true | 0 | 15 | 95 | 119 | 57 | 62 | null | null |
nakaji-dayo/yesod-job-queue | Yesod/JobQueue.hs | bsd-3-clause | getJobQueueR :: JobHandler master Value
getJobQueueR = lift $ do
y <- getYesod
Right q <- liftIO $ listQueue y
returnJson $ object ["queue" .= q]
-- | enqueue new job | 179 | getJobQueueR :: JobHandler master Value
getJobQueueR = lift $ do
y <- getYesod
Right q <- liftIO $ listQueue y
returnJson $ object ["queue" .= q]
-- | enqueue new job | 179 | getJobQueueR = lift $ do
y <- getYesod
Right q <- liftIO $ listQueue y
returnJson $ object ["queue" .= q]
-- | enqueue new job | 139 | false | true | 3 | 11 | 43 | 67 | 29 | 38 | null | null |
siddhanathan/ghc | compiler/nativeGen/AsmCodeGen.hs | bsd-3-clause | generateJumpTables
:: NcgImpl statics instr jumpDest
-> [NatCmmDecl statics instr] -> [NatCmmDecl statics instr]
generateJumpTables ncgImpl xs = concatMap f xs
where f p@(CmmProc _ _ _ (ListGraph xs)) = p : concatMap g xs
f p = [p]
g (BasicBlock _ xs) = catMaybes (map (generateJu... | 451 | generateJumpTables
:: NcgImpl statics instr jumpDest
-> [NatCmmDecl statics instr] -> [NatCmmDecl statics instr]
generateJumpTables ncgImpl xs = concatMap f xs
where f p@(CmmProc _ _ _ (ListGraph xs)) = p : concatMap g xs
f p = [p]
g (BasicBlock _ xs) = catMaybes (map (generateJu... | 451 | generateJumpTables ncgImpl xs = concatMap f xs
where f p@(CmmProc _ _ _ (ListGraph xs)) = p : concatMap g xs
f p = [p]
g (BasicBlock _ xs) = catMaybes (map (generateJumpTableForInstr ncgImpl) xs)
-- -----------------------------------------------------------------------------
-- Shortcut branch... | 322 | false | true | 2 | 10 | 94 | 137 | 69 | 68 | null | null |
shapr/adventofcode2016 | src/Sixteen/Main.hs | bsd-3-clause | getCurve n i = take n $ foldr (:) [] $ head $ dropWhile (\c -> S.length c < n) (iterate grow i) | 95 | getCurve n i = take n $ foldr (:) [] $ head $ dropWhile (\c -> S.length c < n) (iterate grow i) | 95 | getCurve n i = take n $ foldr (:) [] $ head $ dropWhile (\c -> S.length c < n) (iterate grow i) | 95 | false | false | 0 | 11 | 22 | 65 | 32 | 33 | null | null |
matthewscottgordon/funk | src/Funk/CodeGen/GenIR.hs | apache-2.0 | exprIR (F.Call n argExprs) = callIR n argExprs | 46 | exprIR (F.Call n argExprs) = callIR n argExprs | 46 | exprIR (F.Call n argExprs) = callIR n argExprs | 46 | false | false | 0 | 7 | 7 | 25 | 11 | 14 | null | null |
sdiehl/ghc | compiler/GHC/Hs/Utils.hs | bsd-3-clause | unqualQuasiQuote :: RdrName
unqualQuasiQuote = mkRdrUnqual (mkVarOccFS (fsLit "quasiquote")) | 92 | unqualQuasiQuote :: RdrName
unqualQuasiQuote = mkRdrUnqual (mkVarOccFS (fsLit "quasiquote")) | 92 | unqualQuasiQuote = mkRdrUnqual (mkVarOccFS (fsLit "quasiquote")) | 64 | false | true | 0 | 9 | 8 | 26 | 13 | 13 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Bare/SymSort.hs | bsd-3-clause | addSymSortRef' sp rc i p (RProp _ (RHole r@(MkUReft _ (Pr [up]) _)))
| length xs == length ts
= RProp xts (RHole r)
| otherwise
= uError $ ErrPartPred sp (pprint rc) (pprint $ pname up) i (length xs) (length ts)
where
xts = safeZipWithError "addSymSortRef'" xs ts
xs = snd3 <$> pargs up
ts... | 340 | addSymSortRef' sp rc i p (RProp _ (RHole r@(MkUReft _ (Pr [up]) _)))
| length xs == length ts
= RProp xts (RHole r)
| otherwise
= uError $ ErrPartPred sp (pprint rc) (pprint $ pname up) i (length xs) (length ts)
where
xts = safeZipWithError "addSymSortRef'" xs ts
xs = snd3 <$> pargs up
ts... | 340 | addSymSortRef' sp rc i p (RProp _ (RHole r@(MkUReft _ (Pr [up]) _)))
| length xs == length ts
= RProp xts (RHole r)
| otherwise
= uError $ ErrPartPred sp (pprint rc) (pprint $ pname up) i (length xs) (length ts)
where
xts = safeZipWithError "addSymSortRef'" xs ts
xs = snd3 <$> pargs up
ts... | 340 | false | false | 7 | 15 | 92 | 180 | 83 | 97 | null | null |
danieldietrich/llrbtree | Data/Set/Splay.hs | bsd-3-clause | (===) :: Eq a => Splay a -> Splay a -> Bool
Leaf === Leaf = True | 86 | (===) :: Eq a => Splay a -> Splay a -> Bool
Leaf === Leaf = True | 86 | Leaf === Leaf = True | 42 | false | true | 0 | 8 | 38 | 40 | 19 | 21 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Internal/InlineC.hs | gpl-3.0 | epsGetEigenpair' :: EPS -> Int -> Vec -> Vec -> IO ((PetscScalar_,PetscScalar_),CInt)
epsGetEigenpair' eps i xr xi = withPtr2 $ \kr ki ->
epsGetEigenpair0' eps (toCInt i) kr ki xr xi | 184 | epsGetEigenpair' :: EPS -> Int -> Vec -> Vec -> IO ((PetscScalar_,PetscScalar_),CInt)
epsGetEigenpair' eps i xr xi = withPtr2 $ \kr ki ->
epsGetEigenpair0' eps (toCInt i) kr ki xr xi | 184 | epsGetEigenpair' eps i xr xi = withPtr2 $ \kr ki ->
epsGetEigenpair0' eps (toCInt i) kr ki xr xi | 98 | false | true | 0 | 11 | 32 | 81 | 42 | 39 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphPartition.hs | lgpl-2.1 | testCollect2 = testCollect1
== [ (1,[(1,'a'),(1,'c'),(1,'d')])
, (2,[(2,'b'),(2,'d')])
, (3,[(3,'d')])
] | 181 | testCollect2 = testCollect1
== [ (1,[(1,'a'),(1,'c'),(1,'d')])
, (2,[(2,'b'),(2,'d')])
, (3,[(3,'d')])
] | 181 | testCollect2 = testCollect1
== [ (1,[(1,'a'),(1,'c'),(1,'d')])
, (2,[(2,'b'),(2,'d')])
, (3,[(3,'d')])
] | 181 | false | false | 0 | 9 | 87 | 91 | 59 | 32 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'Season' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sStart'
--
-- * 'sEnd'
--
-- * 'sProrations'
season
:: Season
season =
Season'
{ _sStart = Nothing
, _sEnd = Nothing
, _sProrations =... | 334 | season
:: Season
season =
Season'
{ _sStart = Nothing
, _sEnd = Nothing
, _sProrations = Nothing
} | 122 | season =
Season'
{ _sStart = Nothing
, _sEnd = Nothing
, _sProrations = Nothing
} | 101 | true | true | 1 | 7 | 84 | 47 | 29 | 18 | null | null |
olsner/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | ppr_sig :: Name -> Type -> Doc
ppr_sig v ty = pprName' Applied v <+> dcolon <+> ppr ty | 86 | ppr_sig :: Name -> Type -> Doc
ppr_sig v ty = pprName' Applied v <+> dcolon <+> ppr ty | 86 | ppr_sig v ty = pprName' Applied v <+> dcolon <+> ppr ty | 55 | false | true | 0 | 7 | 18 | 40 | 19 | 21 | null | null |
spechub/Hets | OMDoc/OMDocInterface.hs | gpl-2.0 | mkOMSTR :: String -> OMString
mkOMSTR = OMSTR | 45 | mkOMSTR :: String -> OMString
mkOMSTR = OMSTR | 45 | mkOMSTR = OMSTR | 15 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.