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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
k0001/gtk2hs
|
tools/c2hs/gen/GenBind.hs
|
gpl-3.0
|
evalConstCExpr (CIndex _ _ at) =
illegalConstExprErr (posOf at) "array indexing"
| 82
|
evalConstCExpr (CIndex _ _ at) =
illegalConstExprErr (posOf at) "array indexing"
| 82
|
evalConstCExpr (CIndex _ _ at) =
illegalConstExprErr (posOf at) "array indexing"
| 82
| false
| false
| 0
| 7
| 12
| 30
| 14
| 16
| null | null |
byorgey/Idris-dev
|
src/Idris/REPL.hs
|
bsd-3-clause
|
getBC :: Opt -> Maybe String
getBC (BCAsm str) = Just str
| 57
|
getBC :: Opt -> Maybe String
getBC (BCAsm str) = Just str
| 57
|
getBC (BCAsm str) = Just str
| 28
| false
| true
| 0
| 9
| 11
| 34
| 15
| 19
| null | null |
ben-schulz/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
tldeclared (PInterface _ _ _ _ n _ _ _ _ ms cn _) = n : (map fst (maybeToList cn) ++ concatMap tldeclared ms)
| 113
|
tldeclared (PInterface _ _ _ _ n _ _ _ _ ms cn _) = n : (map fst (maybeToList cn) ++ concatMap tldeclared ms)
| 113
|
tldeclared (PInterface _ _ _ _ n _ _ _ _ ms cn _) = n : (map fst (maybeToList cn) ++ concatMap tldeclared ms)
| 113
| false
| false
| 0
| 10
| 28
| 65
| 31
| 34
| null | null |
kcharter/erl
|
Erl/EntityMap.hs
|
bsd-2-clause
|
intersection :: EntityMap a -> EntityMap a -> EntityMap a
intersection = lift2 DM.intersection
| 94
|
intersection :: EntityMap a -> EntityMap a -> EntityMap a
intersection = lift2 DM.intersection
| 94
|
intersection = lift2 DM.intersection
| 36
| false
| true
| 0
| 8
| 13
| 39
| 16
| 23
| null | null |
mightymoose/liquidhaskell
|
benchmarks/xmonad-0.10/XMonad/Core.hs
|
bsd-3-clause
|
-- | Conditionally run an action, using a 'X' event to decide
whenX :: X Bool -> X () -> X ()
whenX a f = a >>= \b -> when b f
| 126
|
whenX :: X Bool -> X () -> X ()
whenX a f = a >>= \b -> when b f
| 64
|
whenX a f = a >>= \b -> when b f
| 32
| true
| true
| 0
| 8
| 32
| 52
| 25
| 27
| null | null |
sol/wai
|
wai/Network/Wai.hs
|
mit
|
responseStatus (ResponseStream s _ _ ) = s
| 44
|
responseStatus (ResponseStream s _ _ ) = s
| 44
|
responseStatus (ResponseStream s _ _ ) = s
| 44
| false
| false
| 0
| 7
| 9
| 19
| 9
| 10
| null | null |
mono0926/ParallelConcurrentHaskell
|
timetable2.hs
|
bsd-3-clause
|
-- >>
-- <<timetable
timetable :: [Person] -> [Talk] -> Int -> Int -> [TimeTable]
timetable people allTalks maxTrack maxSlot =
parsearch finished refine emptysoln
where
emptysoln = (0, 0, [], [], allTalks, allTalks)
finished (slotNo, trackNo, slots, slot, slotTalks, talks)
| slotNo == maxSlot = Just slots
| otherwise = Nothing
clashes :: Map Talk [Talk]
clashes = Map.fromListWith union
[ (t, ts)
| s <- people
, (t, ts) <- selects (talks s) ]
refine (slotNo, trackNo, slots, slot, slotTalks, talks)
| trackNo == maxTrack = [(slotNo+1, 0, slot:slots, [], talks, talks)]
| otherwise =
[ (slotNo, trackNo+1, slots, t:slot, slotTalks', talks')
| (t, ts) <- selects slotTalks
, let clashesWithT = Map.findWithDefault [] t clashes
, let slotTalks' = filter (`notElem` clashesWithT) ts
, let talks' = filter (/= t) talks
]
-- >>
-- ----------------------------------------------------------------------------
-- Utils
-- <<selects
| 1,042
|
timetable :: [Person] -> [Talk] -> Int -> Int -> [TimeTable]
timetable people allTalks maxTrack maxSlot =
parsearch finished refine emptysoln
where
emptysoln = (0, 0, [], [], allTalks, allTalks)
finished (slotNo, trackNo, slots, slot, slotTalks, talks)
| slotNo == maxSlot = Just slots
| otherwise = Nothing
clashes :: Map Talk [Talk]
clashes = Map.fromListWith union
[ (t, ts)
| s <- people
, (t, ts) <- selects (talks s) ]
refine (slotNo, trackNo, slots, slot, slotTalks, talks)
| trackNo == maxTrack = [(slotNo+1, 0, slot:slots, [], talks, talks)]
| otherwise =
[ (slotNo, trackNo+1, slots, t:slot, slotTalks', talks')
| (t, ts) <- selects slotTalks
, let clashesWithT = Map.findWithDefault [] t clashes
, let slotTalks' = filter (`notElem` clashesWithT) ts
, let talks' = filter (/= t) talks
]
-- >>
-- ----------------------------------------------------------------------------
-- Utils
-- <<selects
| 1,020
|
timetable people allTalks maxTrack maxSlot =
parsearch finished refine emptysoln
where
emptysoln = (0, 0, [], [], allTalks, allTalks)
finished (slotNo, trackNo, slots, slot, slotTalks, talks)
| slotNo == maxSlot = Just slots
| otherwise = Nothing
clashes :: Map Talk [Talk]
clashes = Map.fromListWith union
[ (t, ts)
| s <- people
, (t, ts) <- selects (talks s) ]
refine (slotNo, trackNo, slots, slot, slotTalks, talks)
| trackNo == maxTrack = [(slotNo+1, 0, slot:slots, [], talks, talks)]
| otherwise =
[ (slotNo, trackNo+1, slots, t:slot, slotTalks', talks')
| (t, ts) <- selects slotTalks
, let clashesWithT = Map.findWithDefault [] t clashes
, let slotTalks' = filter (`notElem` clashesWithT) ts
, let talks' = filter (/= t) talks
]
-- >>
-- ----------------------------------------------------------------------------
-- Utils
-- <<selects
| 959
| true
| true
| 0
| 12
| 258
| 384
| 213
| 171
| null | null |
amharc/motions-playground
|
src/Bio/Motions/Callback/StandardScore.hs
|
mit
|
-- |Returns the total score for beads belonging to a particular chain.
chainScore :: (Monad m, ReadRepresentation m repr) => repr -> Int -> m StandardScore
chainScore repr idx = getChain repr idx $ ofoldlM combine mempty
where
combine acc beadInfo = mappend acc <$> energyToMany repr (Bead beadInfo) (neighbours beadInfo)
| 327
|
chainScore :: (Monad m, ReadRepresentation m repr) => repr -> Int -> m StandardScore
chainScore repr idx = getChain repr idx $ ofoldlM combine mempty
where
combine acc beadInfo = mappend acc <$> energyToMany repr (Bead beadInfo) (neighbours beadInfo)
| 256
|
chainScore repr idx = getChain repr idx $ ofoldlM combine mempty
where
combine acc beadInfo = mappend acc <$> energyToMany repr (Bead beadInfo) (neighbours beadInfo)
| 171
| true
| true
| 0
| 8
| 56
| 98
| 47
| 51
| null | null |
elieux/ghc
|
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
|
bsd-3-clause
|
mkLocalVar :: LlvmType -> LlvmM LlvmVar
mkLocalVar ty = do
un <- runUs getUniqueM
return $ LMLocalVar un ty
-- | Execute an expression, assigning result to a var
| 171
|
mkLocalVar :: LlvmType -> LlvmM LlvmVar
mkLocalVar ty = do
un <- runUs getUniqueM
return $ LMLocalVar un ty
-- | Execute an expression, assigning result to a var
| 171
|
mkLocalVar ty = do
un <- runUs getUniqueM
return $ LMLocalVar un ty
-- | Execute an expression, assigning result to a var
| 131
| false
| true
| 0
| 9
| 38
| 49
| 21
| 28
| null | null |
dylanmc/cryptol
|
src/Cryptol/Symbolic/BitVector.hs
|
bsd-3-clause
|
signed :: BitVector -> Integer
signed (BV w x)
| w > 0 && testBit x (w - 1) = x - bit w
| otherwise = x
| 124
|
signed :: BitVector -> Integer
signed (BV w x)
| w > 0 && testBit x (w - 1) = x - bit w
| otherwise = x
| 124
|
signed (BV w x)
| w > 0 && testBit x (w - 1) = x - bit w
| otherwise = x
| 93
| false
| true
| 1
| 11
| 48
| 67
| 32
| 35
| null | null |
rfranek/duckling
|
Duckling/Time/ZH/Rules.hs
|
bsd-3-clause
|
ruleMonthNumericWithMonthSymbol :: Rule
ruleMonthNumericWithMonthSymbol = Rule
{ name = "month (numeric with month symbol)"
, pattern =
[ Predicate $ isIntegerBetween 1 12
, regex "\x6708"
]
, prod = \tokens -> case tokens of
(token:_) -> do
v <- getIntValue token
tt . mkLatent $ month v
_ -> Nothing
}
| 351
|
ruleMonthNumericWithMonthSymbol :: Rule
ruleMonthNumericWithMonthSymbol = Rule
{ name = "month (numeric with month symbol)"
, pattern =
[ Predicate $ isIntegerBetween 1 12
, regex "\x6708"
]
, prod = \tokens -> case tokens of
(token:_) -> do
v <- getIntValue token
tt . mkLatent $ month v
_ -> Nothing
}
| 351
|
ruleMonthNumericWithMonthSymbol = Rule
{ name = "month (numeric with month symbol)"
, pattern =
[ Predicate $ isIntegerBetween 1 12
, regex "\x6708"
]
, prod = \tokens -> case tokens of
(token:_) -> do
v <- getIntValue token
tt . mkLatent $ month v
_ -> Nothing
}
| 311
| false
| true
| 0
| 15
| 99
| 105
| 54
| 51
| null | null |
ddssff/lens
|
src/Data/List/Lens.hs
|
bsd-3-clause
|
-- $setup
-- >>> :set -XNoOverloadedStrings
-- >>> import Debug.SimpleReflect.Expr
-- >>> import Debug.SimpleReflect.Vars as Vars hiding (f,g)
-- >>> let f :: Expr -> Expr; f = Debug.SimpleReflect.Vars.f
-- >>> let g :: Expr -> Expr; g = Debug.SimpleReflect.Vars.g
-- | A 'Prism' stripping a prefix from a list when used as a 'Traversal', or
-- prepending that prefix when run backwards:
--
-- >>> "preview" ^? prefixed "pre"
-- Just "view"
--
-- >>> "review" ^? prefixed "pre"
-- Nothing
--
-- >>> prefixed "pre" # "amble"
-- "preamble"
prefixed :: Eq a => [a] -> Prism' [a] [a]
prefixed ps = prism' (ps ++) (stripPrefix ps)
| 626
|
prefixed :: Eq a => [a] -> Prism' [a] [a]
prefixed ps = prism' (ps ++) (stripPrefix ps)
| 87
|
prefixed ps = prism' (ps ++) (stripPrefix ps)
| 45
| true
| true
| 0
| 8
| 109
| 71
| 45
| 26
| null | null |
kjgorman/melchior
|
comparison/snap/static/application.hs
|
mit
|
sendUpdates :: [Element] -> Dom ()
sendUpdates html = do
submit <- Dom . assuredly $ select (byId "update" . from) html
status <- Dom . assuredly $ select (byId "status" . from) html
values <- getInput html "get-in"
clicks <- return $ click submit
put status $ (remote POST "/set/points" $ (\_ -> toDto . json $ sample values) <$> clicks)
where json v = toJsonDict [("key", jsStringToString v)]
| 406
|
sendUpdates :: [Element] -> Dom ()
sendUpdates html = do
submit <- Dom . assuredly $ select (byId "update" . from) html
status <- Dom . assuredly $ select (byId "status" . from) html
values <- getInput html "get-in"
clicks <- return $ click submit
put status $ (remote POST "/set/points" $ (\_ -> toDto . json $ sample values) <$> clicks)
where json v = toJsonDict [("key", jsStringToString v)]
| 406
|
sendUpdates html = do
submit <- Dom . assuredly $ select (byId "update" . from) html
status <- Dom . assuredly $ select (byId "status" . from) html
values <- getInput html "get-in"
clicks <- return $ click submit
put status $ (remote POST "/set/points" $ (\_ -> toDto . json $ sample values) <$> clicks)
where json v = toJsonDict [("key", jsStringToString v)]
| 371
| false
| true
| 0
| 14
| 81
| 182
| 87
| 95
| null | null |
Oscarzhao/haskell
|
learnyouahaskell/Geometry/Cuboid.hs
|
apache-2.0
|
rectangleArea :: Float -> Float -> Float
rectangleArea a b = a * b
| 66
|
rectangleArea :: Float -> Float -> Float
rectangleArea a b = a * b
| 66
|
rectangleArea a b = a * b
| 25
| false
| true
| 0
| 6
| 13
| 28
| 14
| 14
| null | null |
dkandalov/katas
|
haskell/p99/src/p9x/p70/P70.hs
|
unlicense
|
getEither :: (Show left) => (Either left right) -> right
getEither e = case e of
Left parseError -> error $ show parseError
Right value -> value
-- P71
| 160
|
getEither :: (Show left) => (Either left right) -> right
getEither e = case e of
Left parseError -> error $ show parseError
Right value -> value
-- P71
| 160
|
getEither e = case e of
Left parseError -> error $ show parseError
Right value -> value
-- P71
| 103
| false
| true
| 0
| 9
| 37
| 65
| 32
| 33
| null | null |
AlexanderPankiv/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
breakpointCondJumpName :: Name
breakpointCondJumpName
= mkInternalName
breakpointCondJumpIdKey
(mkOccNameFS varName (fsLit "breakpointCondJump"))
noSrcSpan
| 183
|
breakpointCondJumpName :: Name
breakpointCondJumpName
= mkInternalName
breakpointCondJumpIdKey
(mkOccNameFS varName (fsLit "breakpointCondJump"))
noSrcSpan
| 183
|
breakpointCondJumpName
= mkInternalName
breakpointCondJumpIdKey
(mkOccNameFS varName (fsLit "breakpointCondJump"))
noSrcSpan
| 152
| false
| true
| 0
| 8
| 39
| 37
| 16
| 21
| null | null |
b1g3ar5/CsvDatabase
|
src/Csvstuff.hs
|
gpl-3.0
|
-- The data rows - ie tail! - no, all rows!!
rows :: Db a -> Db a
rows = tail
| 79
|
rows :: Db a -> Db a
rows = tail
| 32
|
rows = tail
| 11
| true
| true
| 0
| 6
| 22
| 22
| 11
| 11
| null | null |
Herzult/vindinium-starter-haskell
|
src/Bot.hs
|
mit
|
inBoard :: Board -> Pos -> Bool
inBoard b (Pos x y) =
let s = boardSize b
in x >= 0 && x < s && y >= 0 && y < s
| 119
|
inBoard :: Board -> Pos -> Bool
inBoard b (Pos x y) =
let s = boardSize b
in x >= 0 && x < s && y >= 0 && y < s
| 119
|
inBoard b (Pos x y) =
let s = boardSize b
in x >= 0 && x < s && y >= 0 && y < s
| 87
| false
| true
| 0
| 13
| 41
| 74
| 36
| 38
| null | null |
dorchard/gram_lang
|
frontend/src/Language/Granule/Checker/Monad.hs
|
bsd-3-clause
|
appendPred :: Pred -> Pred -> Pred
appendPred p (Conj ps) = Conj (p : ps)
| 73
|
appendPred :: Pred -> Pred -> Pred
appendPred p (Conj ps) = Conj (p : ps)
| 73
|
appendPred p (Conj ps) = Conj (p : ps)
| 38
| false
| true
| 0
| 7
| 15
| 40
| 20
| 20
| null | null |
ulricha/dsh
|
src/Database/DSH/Frontend/TupleTypes.hs
|
bsd-3-clause
|
mkArrowTy :: Type -> Type -> Type
mkArrowTy domTy coDomTy = AppT (AppT ArrowT domTy) coDomTy
| 92
|
mkArrowTy :: Type -> Type -> Type
mkArrowTy domTy coDomTy = AppT (AppT ArrowT domTy) coDomTy
| 92
|
mkArrowTy domTy coDomTy = AppT (AppT ArrowT domTy) coDomTy
| 58
| false
| true
| 0
| 7
| 15
| 37
| 18
| 19
| null | null |
xkollar/handy-haskell
|
other/2017-newton/newton.hs
|
gpl-3.0
|
checkOne :: Integer -> String -> Err ()
checkOne r s = if checkNums s
then readRpns s >>= evalRPN >>= f
else Left $ "Bad number use in equation for " <> show r
where
f x = if x == r
then Right ()
else Left $ "Err: " <> show s <> " evaluates to " <> show x <> " and not " <> show r
| 310
|
checkOne :: Integer -> String -> Err ()
checkOne r s = if checkNums s
then readRpns s >>= evalRPN >>= f
else Left $ "Bad number use in equation for " <> show r
where
f x = if x == r
then Right ()
else Left $ "Err: " <> show s <> " evaluates to " <> show x <> " and not " <> show r
| 310
|
checkOne r s = if checkNums s
then readRpns s >>= evalRPN >>= f
else Left $ "Bad number use in equation for " <> show r
where
f x = if x == r
then Right ()
else Left $ "Err: " <> show s <> " evaluates to " <> show x <> " and not " <> show r
| 270
| false
| true
| 0
| 11
| 99
| 123
| 59
| 64
| null | null |
konn/offscripter
|
src/Language/ONScripter/Off/Compiler/NScript.hs
|
bsd-3-clause
|
withVar :: (MonadWriter Compiled m, MonadState OffState m)
=> (Var -> m ()) -> m ()
withVar = with vars _Var
| 116
|
withVar :: (MonadWriter Compiled m, MonadState OffState m)
=> (Var -> m ()) -> m ()
withVar = with vars _Var
| 116
|
withVar = with vars _Var
| 24
| false
| true
| 0
| 11
| 28
| 61
| 29
| 32
| null | null |
RoboNickBot/interactive-tree-demos
|
src/Hyper/Trees.hs
|
bsd-2-clause
|
heapCarelessInsert v (BiNode l n r) =
if shallow l > shallow r
then BiNode l n (heapCarelessInsert v r)
else BiNode (heapCarelessInsert v l) n r
| 157
|
heapCarelessInsert v (BiNode l n r) =
if shallow l > shallow r
then BiNode l n (heapCarelessInsert v r)
else BiNode (heapCarelessInsert v l) n r
| 157
|
heapCarelessInsert v (BiNode l n r) =
if shallow l > shallow r
then BiNode l n (heapCarelessInsert v r)
else BiNode (heapCarelessInsert v l) n r
| 157
| false
| false
| 0
| 8
| 39
| 72
| 33
| 39
| null | null |
osa1/Idris-dev
|
src/IRTS/Bytecode.hs
|
bsd-3-clause
|
isConst (SConCase _ _ _ _ _ : xs) = False
| 41
|
isConst (SConCase _ _ _ _ _ : xs) = False
| 41
|
isConst (SConCase _ _ _ _ _ : xs) = False
| 41
| false
| false
| 0
| 8
| 10
| 27
| 13
| 14
| null | null |
olorin/amazonka
|
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types.hs
|
mpl-2.0
|
-- | You cannot specify SSLv3 as the minimum protocol version if you only
-- want to support only clients that Support Server Name Indication (SNI).
_InvalidProtocolSettings :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidProtocolSettings =
_ServiceError . hasStatus 400 . hasCode "InvalidProtocolSettings"
| 330
|
_InvalidProtocolSettings :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidProtocolSettings =
_ServiceError . hasStatus 400 . hasCode "InvalidProtocolSettings"
| 181
|
_InvalidProtocolSettings =
_ServiceError . hasStatus 400 . hasCode "InvalidProtocolSettings"
| 96
| true
| true
| 0
| 8
| 48
| 47
| 23
| 24
| null | null |
cies/gelatin
|
gelatin-picture/src/Gelatin/PicturePrimitives.hs
|
bsd-3-clause
|
-- Handle coloring everything that gets broken down into paths.
compileCurrentWith (Free (Polyline vs _))
(Just clr) _ t =
[(t, withColoring clr $ PathPrims [Path vs])]
| 193
|
compileCurrentWith (Free (Polyline vs _))
(Just clr) _ t =
[(t, withColoring clr $ PathPrims [Path vs])]
| 129
|
compileCurrentWith (Free (Polyline vs _))
(Just clr) _ t =
[(t, withColoring clr $ PathPrims [Path vs])]
| 129
| true
| false
| 0
| 10
| 51
| 61
| 31
| 30
| null | null |
tek/proteome
|
packages/proteome/lib/Proteome/Settings.hs
|
mit
|
tagsFileName :: Setting (Path Rel File)
tagsFileName = Setting "tags_file_name" True (Just [relfile|.tags|])
| 108
|
tagsFileName :: Setting (Path Rel File)
tagsFileName = Setting "tags_file_name" True (Just [relfile|.tags|])
| 108
|
tagsFileName = Setting "tags_file_name" True (Just [relfile|.tags|])
| 68
| false
| true
| 0
| 7
| 12
| 39
| 21
| 18
| null | null |
switchface/helm
|
src/Helm/Color.hs
|
mit
|
-- | Creates a radial gradient. Takes a starting position and radius, ending position and radius
-- and a list of color stops. See the document for 'linear' for more information on color stops.
radial :: (Double, Double) -> Double -> (Double, Double) -> Double -> [(Double, Color)] -> Gradient
radial = Radial
| 309
|
radial :: (Double, Double) -> Double -> (Double, Double) -> Double -> [(Double, Color)] -> Gradient
radial = Radial
| 115
|
radial = Radial
| 15
| true
| true
| 0
| 12
| 52
| 61
| 33
| 28
| null | null |
btipling/machine-vm
|
src/Machine/Memory.hs
|
bsd-3-clause
|
-- ram64 takes a bit array and a load and two 8 bit addresses and runs it
-- on a state of RAM64 (an 8 tuple of RAM8s).
ram64 :: [Bool] -> Bool -> (Addr8, Addr8) -> State.State RAM64 [Bool]
ram64 input load (addr64, addr8) = do
(a, b, c, d, e, f, g, h) <- State.get
let dmuxResult = Gates.dmux8Way True addr64
let fn = State.runState (runRam8 input load addr8)
let stateOutput = functionFromAddress a b c d e f g h fn addr64
let n = stateFromAddress a b c d e f g h stateOutput addr64
State.state (\_ -> n)
| 530
|
ram64 :: [Bool] -> Bool -> (Addr8, Addr8) -> State.State RAM64 [Bool]
ram64 input load (addr64, addr8) = do
(a, b, c, d, e, f, g, h) <- State.get
let dmuxResult = Gates.dmux8Way True addr64
let fn = State.runState (runRam8 input load addr8)
let stateOutput = functionFromAddress a b c d e f g h fn addr64
let n = stateFromAddress a b c d e f g h stateOutput addr64
State.state (\_ -> n)
| 410
|
ram64 input load (addr64, addr8) = do
(a, b, c, d, e, f, g, h) <- State.get
let dmuxResult = Gates.dmux8Way True addr64
let fn = State.runState (runRam8 input load addr8)
let stateOutput = functionFromAddress a b c d e f g h fn addr64
let n = stateFromAddress a b c d e f g h stateOutput addr64
State.state (\_ -> n)
| 340
| true
| true
| 0
| 12
| 126
| 206
| 106
| 100
| null | null |
8l/barrelfish
|
hake/ARMv8.hs
|
mit
|
linker = ArchDefaults.linker arch compiler
| 42
|
linker = ArchDefaults.linker arch compiler
| 42
|
linker = ArchDefaults.linker arch compiler
| 42
| false
| false
| 0
| 6
| 4
| 13
| 6
| 7
| null | null |
forsyde/forsyde-shallow
|
src/ForSyDe/Shallow/Core/Vector.hs
|
bsd-3-clause
|
tailV (_:>vs) = vs
| 18
|
tailV (_:>vs) = vs
| 18
|
tailV (_:>vs) = vs
| 18
| false
| false
| 0
| 6
| 3
| 17
| 8
| 9
| null | null |
spechub/Hets
|
Common/Lexer.hs
|
gpl-2.0
|
-- a single semicolon
semiT :: CharParser st Token
semiT = pToken $ string ";" << notFollowedBy (char ';')
| 106
|
semiT :: CharParser st Token
semiT = pToken $ string ";" << notFollowedBy (char ';')
| 84
|
semiT = pToken $ string ";" << notFollowedBy (char ';')
| 55
| true
| true
| 0
| 8
| 18
| 37
| 18
| 19
| null | null |
lessandro/gridc
|
src/GridC/Codegen.hs
|
mit
|
globals :: Lens [Variable]
globals f s = fmap (\val -> s { _globals = val }) $ f $ _globals s
| 93
|
globals :: Lens [Variable]
globals f s = fmap (\val -> s { _globals = val }) $ f $ _globals s
| 93
|
globals f s = fmap (\val -> s { _globals = val }) $ f $ _globals s
| 66
| false
| true
| 1
| 11
| 21
| 56
| 27
| 29
| null | null |
julienschmaltz/madl
|
src/Madl/Base.hs
|
mit
|
channelContext :: Network a b -> ChannelID -> ChannelContext b
channelContext net (ChannelIDImpl x) = lookupMnoShow (src 22) x (channelMap net)
| 143
|
channelContext :: Network a b -> ChannelID -> ChannelContext b
channelContext net (ChannelIDImpl x) = lookupMnoShow (src 22) x (channelMap net)
| 143
|
channelContext net (ChannelIDImpl x) = lookupMnoShow (src 22) x (channelMap net)
| 80
| false
| true
| 0
| 7
| 20
| 57
| 27
| 30
| null | null |
frelindb/agsyHOL
|
Main.hs
|
mit
|
-- ---------------------------------
getProb :: String -> String -> IO (ParseResult [ThfAnnotated])
getProb axiomspath filename = do
file <- readFile filename
case parse file 1 of
FailP err -> return $ FailP err
OkP prob ->
expand prob
where
expand [] = return $ OkP []
expand (Include axfile : xs) = do
axprob <- getProb axiomspath (axiomspath ++ axfile)
case axprob of
FailP err -> return $ FailP $ "in " ++ axiomspath ++ axfile ++ ": " ++ err
OkP axprob -> do
xs <- expand xs
case xs of
FailP err -> return $ FailP err
OkP xs -> return $ OkP (axprob ++ xs)
expand (AnnotatedFormula x : xs) = do
xs <- expand xs
case xs of
FailP err -> return $ FailP err
OkP xs -> return $ OkP (x : xs)
-- ---------------------------------
| 810
|
getProb :: String -> String -> IO (ParseResult [ThfAnnotated])
getProb axiomspath filename = do
file <- readFile filename
case parse file 1 of
FailP err -> return $ FailP err
OkP prob ->
expand prob
where
expand [] = return $ OkP []
expand (Include axfile : xs) = do
axprob <- getProb axiomspath (axiomspath ++ axfile)
case axprob of
FailP err -> return $ FailP $ "in " ++ axiomspath ++ axfile ++ ": " ++ err
OkP axprob -> do
xs <- expand xs
case xs of
FailP err -> return $ FailP err
OkP xs -> return $ OkP (axprob ++ xs)
expand (AnnotatedFormula x : xs) = do
xs <- expand xs
case xs of
FailP err -> return $ FailP err
OkP xs -> return $ OkP (x : xs)
-- ---------------------------------
| 772
|
getProb axiomspath filename = do
file <- readFile filename
case parse file 1 of
FailP err -> return $ FailP err
OkP prob ->
expand prob
where
expand [] = return $ OkP []
expand (Include axfile : xs) = do
axprob <- getProb axiomspath (axiomspath ++ axfile)
case axprob of
FailP err -> return $ FailP $ "in " ++ axiomspath ++ axfile ++ ": " ++ err
OkP axprob -> do
xs <- expand xs
case xs of
FailP err -> return $ FailP err
OkP xs -> return $ OkP (axprob ++ xs)
expand (AnnotatedFormula x : xs) = do
xs <- expand xs
case xs of
FailP err -> return $ FailP err
OkP xs -> return $ OkP (x : xs)
-- ---------------------------------
| 709
| true
| true
| 0
| 25
| 223
| 325
| 151
| 174
| null | null |
mfpi/OpenGL
|
Graphics/Rendering/OpenGL/GL/PerFragment.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
depthBounds :: StateVar (Maybe (GLclampd, GLclampd))
depthBounds =
makeStateVarMaybe
(return CapDepthBoundsTest)
(getClampd2 (,) GetDepthBounds)
(uncurry glDepthBounds)
| 271
|
depthBounds :: StateVar (Maybe (GLclampd, GLclampd))
depthBounds =
makeStateVarMaybe
(return CapDepthBoundsTest)
(getClampd2 (,) GetDepthBounds)
(uncurry glDepthBounds)
| 189
|
depthBounds =
makeStateVarMaybe
(return CapDepthBoundsTest)
(getClampd2 (,) GetDepthBounds)
(uncurry glDepthBounds)
| 136
| true
| true
| 0
| 8
| 38
| 57
| 30
| 27
| null | null |
flipstone/glados
|
src/App/Types.hs
|
mit
|
runApp :: ConnectionPool -> App a -> ServerPartT IO a
runApp pool (App action) = mapServerPartT (runBackendPool pool)
action
| 166
|
runApp :: ConnectionPool -> App a -> ServerPartT IO a
runApp pool (App action) = mapServerPartT (runBackendPool pool)
action
| 166
|
runApp pool (App action) = mapServerPartT (runBackendPool pool)
action
| 112
| false
| true
| 0
| 7
| 60
| 54
| 24
| 30
| null | null |
green-haskell/ghc
|
compiler/cmm/CLabel.hs
|
bsd-3-clause
|
toInfoLbl (IdLabel n c StaticConEntry) = IdLabel n c StaticInfoTable
| 68
|
toInfoLbl (IdLabel n c StaticConEntry) = IdLabel n c StaticInfoTable
| 68
|
toInfoLbl (IdLabel n c StaticConEntry) = IdLabel n c StaticInfoTable
| 68
| false
| false
| 0
| 7
| 9
| 26
| 12
| 14
| null | null |
brendanhay/gogol
|
gogol-blogger/gen/Network/Google/Resource/Blogger/Pages/Publish.hs
|
mpl-2.0
|
-- | OAuth access token.
pagaAccessToken :: Lens' PagesPublish (Maybe Text)
pagaAccessToken
= lens _pagaAccessToken
(\ s a -> s{_pagaAccessToken = a})
| 158
|
pagaAccessToken :: Lens' PagesPublish (Maybe Text)
pagaAccessToken
= lens _pagaAccessToken
(\ s a -> s{_pagaAccessToken = a})
| 133
|
pagaAccessToken
= lens _pagaAccessToken
(\ s a -> s{_pagaAccessToken = a})
| 82
| true
| true
| 0
| 9
| 29
| 48
| 25
| 23
| null | null |
h4ck3rm1k3/gcc-ontology
|
tests/example_simple_python_method_ast.hs
|
gpl-3.0
|
record_type_arg_value_40 x = (record_type_arg_value x)
| 54
|
record_type_arg_value_40 x = (record_type_arg_value x)
| 54
|
record_type_arg_value_40 x = (record_type_arg_value x)
| 54
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
jwiegley/ghc-release
|
compiler/llvmGen/Llvm/Types.hs
|
gpl-3.0
|
llvmWidthInBits dflags (LMStruct tys) = sum $ map (llvmWidthInBits dflags) tys
| 79
|
llvmWidthInBits dflags (LMStruct tys) = sum $ map (llvmWidthInBits dflags) tys
| 79
|
llvmWidthInBits dflags (LMStruct tys) = sum $ map (llvmWidthInBits dflags) tys
| 79
| false
| false
| 0
| 8
| 11
| 34
| 15
| 19
| null | null |
poiuj/pfcc
|
src/Semant.hs
|
bsd-3-clause
|
checkExpr (BoolConst _) = return boolType
| 41
|
checkExpr (BoolConst _) = return boolType
| 41
|
checkExpr (BoolConst _) = return boolType
| 41
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
walkie/Hagl
|
Hagl/Game.hs
|
bsd-3-clause
|
-- | The highest numbered player in this finite game tree.
maxPlayer :: Discrete s mv -> Int
maxPlayer t = maximum $ map (fromMaybe 0 . playerID) (dfs t)
| 153
|
maxPlayer :: Discrete s mv -> Int
maxPlayer t = maximum $ map (fromMaybe 0 . playerID) (dfs t)
| 94
|
maxPlayer t = maximum $ map (fromMaybe 0 . playerID) (dfs t)
| 60
| true
| true
| 2
| 8
| 29
| 56
| 25
| 31
| null | null |
TravisWhitaker/discern
|
src/Discern/Type.hs
|
mit
|
normalizeType :: Type -> Type
normalizeType t = snd (go ((0, M.empty), t))
where go ((m, im), (TypeTyVar tv)) = let ((m', im'), tv') = normalizeTyVar (m, im) tv
in ((m', im'), TypeTyVar tv')
go ((m, im), (TypeApp tl tr)) = let ((m', im'), tl') = go ((m, im), tl)
((m'', im''), tr') = go ((m', im'), tr)
in ((m'', im''), (TypeApp tl' tr'))
go ((m, im), (TypeTyConApp tc ts)) = let ((m', im'), ts') = goList [] ((m, im), ts)
in ((m', im'), (TypeTyConApp tc ts'))
go ((m, im), (TypeUQuant tvs t)) = let ((m', im'), t') = go ((m, im), t)
in ((m', im'), (TypeUQuant tvs t'))
go ((m, im), (TypeConstraint c tvs t)) = let ((m', im'), t') = go ((m, im), t)
in ((m', im'), (TypeConstraint c tvs t'))
goList as ((m, im), []) = ((m, im), reverse as)
goList as ((m, im), (t:ts)) = let ((m', im'), t') = go ((m, im), t)
in goList (t':as) ((m', im'), ts)
-- | Normalize a type with respect to an enclosing scope's 'TyVar's.
| 1,391
|
normalizeType :: Type -> Type
normalizeType t = snd (go ((0, M.empty), t))
where go ((m, im), (TypeTyVar tv)) = let ((m', im'), tv') = normalizeTyVar (m, im) tv
in ((m', im'), TypeTyVar tv')
go ((m, im), (TypeApp tl tr)) = let ((m', im'), tl') = go ((m, im), tl)
((m'', im''), tr') = go ((m', im'), tr)
in ((m'', im''), (TypeApp tl' tr'))
go ((m, im), (TypeTyConApp tc ts)) = let ((m', im'), ts') = goList [] ((m, im), ts)
in ((m', im'), (TypeTyConApp tc ts'))
go ((m, im), (TypeUQuant tvs t)) = let ((m', im'), t') = go ((m, im), t)
in ((m', im'), (TypeUQuant tvs t'))
go ((m, im), (TypeConstraint c tvs t)) = let ((m', im'), t') = go ((m, im), t)
in ((m', im'), (TypeConstraint c tvs t'))
goList as ((m, im), []) = ((m, im), reverse as)
goList as ((m, im), (t:ts)) = let ((m', im'), t') = go ((m, im), t)
in goList (t':as) ((m', im'), ts)
-- | Normalize a type with respect to an enclosing scope's 'TyVar's.
| 1,391
|
normalizeType t = snd (go ((0, M.empty), t))
where go ((m, im), (TypeTyVar tv)) = let ((m', im'), tv') = normalizeTyVar (m, im) tv
in ((m', im'), TypeTyVar tv')
go ((m, im), (TypeApp tl tr)) = let ((m', im'), tl') = go ((m, im), tl)
((m'', im''), tr') = go ((m', im'), tr)
in ((m'', im''), (TypeApp tl' tr'))
go ((m, im), (TypeTyConApp tc ts)) = let ((m', im'), ts') = goList [] ((m, im), ts)
in ((m', im'), (TypeTyConApp tc ts'))
go ((m, im), (TypeUQuant tvs t)) = let ((m', im'), t') = go ((m, im), t)
in ((m', im'), (TypeUQuant tvs t'))
go ((m, im), (TypeConstraint c tvs t)) = let ((m', im'), t') = go ((m, im), t)
in ((m', im'), (TypeConstraint c tvs t'))
goList as ((m, im), []) = ((m, im), reverse as)
goList as ((m, im), (t:ts)) = let ((m', im'), t') = go ((m, im), t)
in goList (t':as) ((m', im'), ts)
-- | Normalize a type with respect to an enclosing scope's 'TyVar's.
| 1,361
| false
| true
| 0
| 11
| 657
| 655
| 368
| 287
| null | null |
lukexi/ghc-7.8-arm64
|
ghc/Main.hs
|
bsd-3-clause
|
isInterpretiveMode _ = False
| 40
|
isInterpretiveMode _ = False
| 40
|
isInterpretiveMode _ = False
| 40
| false
| false
| 0
| 5
| 15
| 9
| 4
| 5
| null | null |
keithodulaigh/Hets
|
Comorphisms/Hs2HOLCFaux.hs
|
gpl-2.0
|
chkTHead :: [IsaType] -> Bool
chkTHead ls = case ls of
IsaSign.Type "=>" _ [x, n] : IsaSign.Type "=>" s [y, m] : ns ->
(typEq x y && mkTVarMap id x == mkTVarMap id n) &&
chkTHead (IsaSign.Type "=>" s [y, m] : ns)
[IsaSign.Type "=>" _ [x, n]] -> mkTVarMap id x == mkTVarMap id n
_ -> False
-- -------------------- equivalence of types modulo variables name ------
| 385
|
chkTHead :: [IsaType] -> Bool
chkTHead ls = case ls of
IsaSign.Type "=>" _ [x, n] : IsaSign.Type "=>" s [y, m] : ns ->
(typEq x y && mkTVarMap id x == mkTVarMap id n) &&
chkTHead (IsaSign.Type "=>" s [y, m] : ns)
[IsaSign.Type "=>" _ [x, n]] -> mkTVarMap id x == mkTVarMap id n
_ -> False
-- -------------------- equivalence of types modulo variables name ------
| 385
|
chkTHead ls = case ls of
IsaSign.Type "=>" _ [x, n] : IsaSign.Type "=>" s [y, m] : ns ->
(typEq x y && mkTVarMap id x == mkTVarMap id n) &&
chkTHead (IsaSign.Type "=>" s [y, m] : ns)
[IsaSign.Type "=>" _ [x, n]] -> mkTVarMap id x == mkTVarMap id n
_ -> False
-- -------------------- equivalence of types modulo variables name ------
| 355
| false
| true
| 0
| 13
| 92
| 175
| 87
| 88
| null | null |
hw-hello-world/okta-signin-widget
|
haskell-scotty/app/Main.hs
|
mit
|
oktaSignInTheme = fromString $ oktaSignInBase ++ "/css/okta-theme.css"
| 70
|
oktaSignInTheme = fromString $ oktaSignInBase ++ "/css/okta-theme.css"
| 70
|
oktaSignInTheme = fromString $ oktaSignInBase ++ "/css/okta-theme.css"
| 70
| false
| false
| 1
| 6
| 6
| 18
| 7
| 11
| null | null |
input-output-hk/rscoin-haskell
|
src/PureScript/Main.hs
|
gpl-3.0
|
wordBridge :: BridgePart
wordBridge = typeName ^== "Word" >> pure psInt
| 71
|
wordBridge :: BridgePart
wordBridge = typeName ^== "Word" >> pure psInt
| 71
|
wordBridge = typeName ^== "Word" >> pure psInt
| 46
| false
| true
| 0
| 6
| 10
| 22
| 11
| 11
| null | null |
comonoidial/ALFIN
|
Backend/Assemble.hs
|
mit
|
asmTag _ cs nb (DecTag c x) = (bodyKinds_ (nb ++ uas), DCon (snd $ fromJust $ lookup c cs) (toEnum x)) where uas = replicate x (Left undefined)
| 165
|
asmTag _ cs nb (DecTag c x) = (bodyKinds_ (nb ++ uas), DCon (snd $ fromJust $ lookup c cs) (toEnum x)) where uas = replicate x (Left undefined)
| 165
|
asmTag _ cs nb (DecTag c x) = (bodyKinds_ (nb ++ uas), DCon (snd $ fromJust $ lookup c cs) (toEnum x)) where uas = replicate x (Left undefined)
| 165
| false
| false
| 1
| 9
| 50
| 88
| 42
| 46
| null | null |
Jiggins/Matrix
|
Math/Matrix/Lazy.hs
|
gpl-3.0
|
fromList :: Int -> Int -> [a] -> LazyMatrix a
fromList r c xs = lmatrix r c $ \(i,j) -> xs !! (i*c+j)
| 101
|
fromList :: Int -> Int -> [a] -> LazyMatrix a
fromList r c xs = lmatrix r c $ \(i,j) -> xs !! (i*c+j)
| 101
|
fromList r c xs = lmatrix r c $ \(i,j) -> xs !! (i*c+j)
| 55
| false
| true
| 0
| 10
| 23
| 71
| 37
| 34
| null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
2715 = 2714
| 11
|
2715 = 2714
| 11
|
2715 = 2714
| 11
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
NogikuchiKBYS/hsit-sandbox
|
src/Eval.hs
|
bsd-3-clause
|
evalStmt :: (EnvMonad m, StrIO (EvalT m), Content m ~ Value r) => Stmt -> EvalT m ()
evalStmt stmt =
case stmt of
DeclVar _ id@(ID name) expr -> do
lookupVarLocal id >>=
\case
Just _ -> E.throwError $ unwords ["variable", name, "already exists"]
Nothing -> evalExpr expr >>= addVar id
Assign id@(ID name) expr ->
lookupVar id >>=
\case
Nothing -> E.throwError $ unwords ["variable", name ,"not in scope"]
Just _ -> (evalExpr expr >>= updateVar id ) *> return ()
WhileStmt cond stmts -> do
condValue <- evalExpr cond
when (condValue `isPVEq` BoolV True) $
evalLocalStmts stmts *> evalStmt stmt
IfStmt pairs elsebody ->
case pairs of
[] -> case elsebody of
Nothing -> return ()
Just stmts -> evalLocalStmts stmts
(cond, stmts) : rest -> do
condValue <- evalExpr cond
if condValue `isPVEq` BoolV True
then evalLocalStmts stmts
else evalStmt (IfStmt rest elsebody)
Expr expr -> evalExpr expr *> return ()
Debug expr -> do
v <- evalExpr expr
putStringLine $ "debug " ++ show expr ++ " --> " ++ show v
| 1,219
|
evalStmt :: (EnvMonad m, StrIO (EvalT m), Content m ~ Value r) => Stmt -> EvalT m ()
evalStmt stmt =
case stmt of
DeclVar _ id@(ID name) expr -> do
lookupVarLocal id >>=
\case
Just _ -> E.throwError $ unwords ["variable", name, "already exists"]
Nothing -> evalExpr expr >>= addVar id
Assign id@(ID name) expr ->
lookupVar id >>=
\case
Nothing -> E.throwError $ unwords ["variable", name ,"not in scope"]
Just _ -> (evalExpr expr >>= updateVar id ) *> return ()
WhileStmt cond stmts -> do
condValue <- evalExpr cond
when (condValue `isPVEq` BoolV True) $
evalLocalStmts stmts *> evalStmt stmt
IfStmt pairs elsebody ->
case pairs of
[] -> case elsebody of
Nothing -> return ()
Just stmts -> evalLocalStmts stmts
(cond, stmts) : rest -> do
condValue <- evalExpr cond
if condValue `isPVEq` BoolV True
then evalLocalStmts stmts
else evalStmt (IfStmt rest elsebody)
Expr expr -> evalExpr expr *> return ()
Debug expr -> do
v <- evalExpr expr
putStringLine $ "debug " ++ show expr ++ " --> " ++ show v
| 1,219
|
evalStmt stmt =
case stmt of
DeclVar _ id@(ID name) expr -> do
lookupVarLocal id >>=
\case
Just _ -> E.throwError $ unwords ["variable", name, "already exists"]
Nothing -> evalExpr expr >>= addVar id
Assign id@(ID name) expr ->
lookupVar id >>=
\case
Nothing -> E.throwError $ unwords ["variable", name ,"not in scope"]
Just _ -> (evalExpr expr >>= updateVar id ) *> return ()
WhileStmt cond stmts -> do
condValue <- evalExpr cond
when (condValue `isPVEq` BoolV True) $
evalLocalStmts stmts *> evalStmt stmt
IfStmt pairs elsebody ->
case pairs of
[] -> case elsebody of
Nothing -> return ()
Just stmts -> evalLocalStmts stmts
(cond, stmts) : rest -> do
condValue <- evalExpr cond
if condValue `isPVEq` BoolV True
then evalLocalStmts stmts
else evalStmt (IfStmt rest elsebody)
Expr expr -> evalExpr expr *> return ()
Debug expr -> do
v <- evalExpr expr
putStringLine $ "debug " ++ show expr ++ " --> " ++ show v
| 1,134
| false
| true
| 13
| 13
| 400
| 429
| 208
| 221
| null | null |
cchalmers/pgf-system
|
src/Graphics/Rendering/PGFSystem.hs
|
bsd-3-clause
|
-- transformations
transform :: Transformation V2 Double -> Put
transform = transform' . getMatrix
| 99
|
transform :: Transformation V2 Double -> Put
transform = transform' . getMatrix
| 79
|
transform = transform' . getMatrix
| 34
| true
| true
| 0
| 7
| 14
| 32
| 14
| 18
| null | null |
acowley/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
primCallName = libFun (fsLit "prim") primCallIdKey
| 50
|
primCallName = libFun (fsLit "prim") primCallIdKey
| 50
|
primCallName = libFun (fsLit "prim") primCallIdKey
| 50
| false
| false
| 0
| 7
| 5
| 17
| 8
| 9
| null | null |
hspec/hspec
|
hspec-core/src/Test/Hspec/Core/Runner/Eval.hs
|
mit
|
nonEmpty :: [a] -> Maybe (NonEmpty a)
nonEmpty [] = Nothing
| 63
|
nonEmpty :: [a] -> Maybe (NonEmpty a)
nonEmpty [] = Nothing
| 63
|
nonEmpty [] = Nothing
| 25
| false
| true
| 0
| 8
| 14
| 32
| 16
| 16
| null | null |
jamshidh/ethereum-data-sql
|
src/Blockchain/Data/AddressStateDB.hs
|
bsd-3-clause
|
blankAddressState:: AddressState
blankAddressState = AddressState { addressStateNonce=0, addressStateBalance=0, addressStateContractRoot=emptyTriePtr, addressStateCodeHash=hash "" }
| 181
|
blankAddressState:: AddressState
blankAddressState = AddressState { addressStateNonce=0, addressStateBalance=0, addressStateContractRoot=emptyTriePtr, addressStateCodeHash=hash "" }
| 181
|
blankAddressState = AddressState { addressStateNonce=0, addressStateBalance=0, addressStateContractRoot=emptyTriePtr, addressStateCodeHash=hash "" }
| 148
| false
| true
| 0
| 7
| 11
| 40
| 24
| 16
| null | null |
Ongy/monky
|
Monky/CPU.hs
|
lgpl-3.0
|
-- |Get the CPUs thermal zone
getThermalZone :: String -> IO TempHandle
getThermalZone = fmap (TH . Just) . fopen . pathTemp
| 124
|
getThermalZone :: String -> IO TempHandle
getThermalZone = fmap (TH . Just) . fopen . pathTemp
| 94
|
getThermalZone = fmap (TH . Just) . fopen . pathTemp
| 52
| true
| true
| 0
| 8
| 21
| 43
| 20
| 23
| null | null |
yuto-matsum/contest-util-hs
|
src/Euler/016.hs
|
mit
|
answer n= sum $ a n
| 19
|
answer n= sum $ a n
| 19
|
answer n= sum $ a n
| 19
| false
| false
| 0
| 6
| 5
| 16
| 7
| 9
| null | null |
DaMSL/K3
|
src/Language/K3/Parser/SQL.hs
|
apache-2.0
|
mkaggregate :: AggregateFn -> SelectItem -> ScalarExpr -> SQLParseM SelectItem
mkaggregate fn agg e = case fn of
AggSum -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "sum"]) [e]
AggCount -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "count"]) [e]
AggMin -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "min"]) [e]
AggMax -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "max"]) [e]
where rt (SelExp _ _) e' = return (SelExp emptyAnnotation e')
rt (SelectItem _ _ nmc) e' = return (SelectItem emptyAnnotation e' nmc)
| 609
|
mkaggregate :: AggregateFn -> SelectItem -> ScalarExpr -> SQLParseM SelectItem
mkaggregate fn agg e = case fn of
AggSum -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "sum"]) [e]
AggCount -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "count"]) [e]
AggMin -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "min"]) [e]
AggMax -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "max"]) [e]
where rt (SelExp _ _) e' = return (SelExp emptyAnnotation e')
rt (SelectItem _ _ nmc) e' = return (SelectItem emptyAnnotation e' nmc)
| 609
|
mkaggregate fn agg e = case fn of
AggSum -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "sum"]) [e]
AggCount -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "count"]) [e]
AggMin -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "min"]) [e]
AggMax -> rt agg $ FunCall emptyAnnotation (Name emptyAnnotation [Nmc "max"]) [e]
where rt (SelExp _ _) e' = return (SelExp emptyAnnotation e')
rt (SelectItem _ _ nmc) e' = return (SelectItem emptyAnnotation e' nmc)
| 530
| false
| true
| 1
| 13
| 119
| 248
| 121
| 127
| null | null |
feuerbach/regex-applicative
|
Text/Regex/Applicative/Types.hs
|
mit
|
-- | Returns thread identifier. This will be 'Just' for ordinary threads and
-- 'Nothing' for results.
threadId :: Thread s r -> Maybe ThreadId
threadId Thread { threadId_ = i } = Just i
| 186
|
threadId :: Thread s r -> Maybe ThreadId
threadId Thread { threadId_ = i } = Just i
| 83
|
threadId Thread { threadId_ = i } = Just i
| 42
| true
| true
| 0
| 8
| 34
| 40
| 20
| 20
| null | null |
c19/Exercism-Haskell
|
simple-linked-list/src/LinkedList.hs
|
mit
|
fromList :: [a] -> LinkedList a
fromList = foldr new Empty
| 58
|
fromList :: [a] -> LinkedList a
fromList = foldr new Empty
| 58
|
fromList = foldr new Empty
| 26
| false
| true
| 0
| 7
| 10
| 33
| 14
| 19
| null | null |
kelnage/tamarin-prover
|
lib/theory/src/Theory/Proof.hs
|
gpl-3.0
|
checkDiffProof :: DiffProofContext
-> (Int -> DiffSystem -> DiffProof (Maybe DiffSystem)) -- prover for new cases in depth
-> Int -- ^ Original depth
-> DiffSystem
-> DiffProof a
-> DiffProof (Maybe a, Maybe DiffSystem)
checkDiffProof ctxt prover d sys prf@(LNode (DiffProofStep method info) cs) =
case (method, execDiffProofMethod ctxt method sys) of
(DiffSorry reason, _ ) -> sorryNode reason cs
(_ , Just cases) -> node method $ checkChildren cases
(_ , Nothing ) ->
sorryNode (Just "invalid proof step encountered")
(M.singleton "" prf)
where
node m = LNode (DiffProofStep m (Just info, Just sys))
sorryNode reason cases = node (DiffSorry reason) (M.map noSystemPrf cases)
noSystemPrf = mapDiffProofInfo (\i -> (Just i, Nothing))
checkChildren cases = mergeMapsWith
unhandledCase noSystemPrf (checkDiffProof ctxt prover (d + 1)) cases cs
where
unhandledCase = mapDiffProofInfo ((,) Nothing) . prover d
-- | Annotate a proof with the constraint systems of all intermediate steps
-- under the assumption that all proof steps are valid. If some proof steps
-- might be invalid, then you must use 'checkProof', which handles them
-- gracefully.
| 1,385
|
checkDiffProof :: DiffProofContext
-> (Int -> DiffSystem -> DiffProof (Maybe DiffSystem)) -- prover for new cases in depth
-> Int -- ^ Original depth
-> DiffSystem
-> DiffProof a
-> DiffProof (Maybe a, Maybe DiffSystem)
checkDiffProof ctxt prover d sys prf@(LNode (DiffProofStep method info) cs) =
case (method, execDiffProofMethod ctxt method sys) of
(DiffSorry reason, _ ) -> sorryNode reason cs
(_ , Just cases) -> node method $ checkChildren cases
(_ , Nothing ) ->
sorryNode (Just "invalid proof step encountered")
(M.singleton "" prf)
where
node m = LNode (DiffProofStep m (Just info, Just sys))
sorryNode reason cases = node (DiffSorry reason) (M.map noSystemPrf cases)
noSystemPrf = mapDiffProofInfo (\i -> (Just i, Nothing))
checkChildren cases = mergeMapsWith
unhandledCase noSystemPrf (checkDiffProof ctxt prover (d + 1)) cases cs
where
unhandledCase = mapDiffProofInfo ((,) Nothing) . prover d
-- | Annotate a proof with the constraint systems of all intermediate steps
-- under the assumption that all proof steps are valid. If some proof steps
-- might be invalid, then you must use 'checkProof', which handles them
-- gracefully.
| 1,385
|
checkDiffProof ctxt prover d sys prf@(LNode (DiffProofStep method info) cs) =
case (method, execDiffProofMethod ctxt method sys) of
(DiffSorry reason, _ ) -> sorryNode reason cs
(_ , Just cases) -> node method $ checkChildren cases
(_ , Nothing ) ->
sorryNode (Just "invalid proof step encountered")
(M.singleton "" prf)
where
node m = LNode (DiffProofStep m (Just info, Just sys))
sorryNode reason cases = node (DiffSorry reason) (M.map noSystemPrf cases)
noSystemPrf = mapDiffProofInfo (\i -> (Just i, Nothing))
checkChildren cases = mergeMapsWith
unhandledCase noSystemPrf (checkDiffProof ctxt prover (d + 1)) cases cs
where
unhandledCase = mapDiffProofInfo ((,) Nothing) . prover d
-- | Annotate a proof with the constraint systems of all intermediate steps
-- under the assumption that all proof steps are valid. If some proof steps
-- might be invalid, then you must use 'checkProof', which handles them
-- gracefully.
| 1,102
| false
| true
| 0
| 12
| 418
| 353
| 179
| 174
| null | null |
dimara/ganeti
|
test/hs/Test/Ganeti/OpCodes.hs
|
bsd-2-clause
|
case_py_compat_types :: HUnit.Assertion
case_py_compat_types = do
let num_opcodes = length OpCodes.allOpIDs * 100
opcodes <- genSample (vectorOf num_opcodes
(arbitrary::Gen OpCodes.MetaOpCode))
let with_sum = map (\o -> (OpCodes.opSummary $
OpCodes.metaOpCode o, o)) opcodes
serialized = J.encode opcodes
-- check for non-ASCII fields, usually due to 'arbitrary :: String'
mapM_ (\op -> when (any (not . isAscii) (J.encode op)) .
HUnit.assertFailure $
"OpCode has non-ASCII fields: " ++ show op
) opcodes
py_stdout <-
runPython "from ganeti import opcodes\n\
\from ganeti import serializer\n\
\import sys\n\
\op_data = serializer.Load(sys.stdin.read())\n\
\decoded = [opcodes.OpCode.LoadOpCode(o) for o in op_data]\n\
\for op in decoded:\n\
\ op.Validate(True)\n\
\encoded = [(op.Summary(), op.__getstate__())\n\
\ for op in decoded]\n\
\print serializer.Dump(\
\ encoded,\
\ private_encoder=serializer.EncodeWithPrivateFields)"
serialized
>>= checkPythonResult
let deserialised =
J.decode py_stdout::J.Result [(String, OpCodes.MetaOpCode)]
decoded <- case deserialised of
J.Ok ops -> return ops
J.Error msg ->
HUnit.assertFailure ("Unable to decode opcodes: " ++ msg)
-- this already raised an expection, but we need it
-- for proper types
>> fail "Unable to decode opcodes"
HUnit.assertEqual "Mismatch in number of returned opcodes"
(length decoded) (length with_sum)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
) $ zip with_sum decoded
-- | Custom HUnit test case that forks a Python process and checks
-- correspondence between Haskell OpCodes fields and their Python
-- equivalent.
| 2,074
|
case_py_compat_types :: HUnit.Assertion
case_py_compat_types = do
let num_opcodes = length OpCodes.allOpIDs * 100
opcodes <- genSample (vectorOf num_opcodes
(arbitrary::Gen OpCodes.MetaOpCode))
let with_sum = map (\o -> (OpCodes.opSummary $
OpCodes.metaOpCode o, o)) opcodes
serialized = J.encode opcodes
-- check for non-ASCII fields, usually due to 'arbitrary :: String'
mapM_ (\op -> when (any (not . isAscii) (J.encode op)) .
HUnit.assertFailure $
"OpCode has non-ASCII fields: " ++ show op
) opcodes
py_stdout <-
runPython "from ganeti import opcodes\n\
\from ganeti import serializer\n\
\import sys\n\
\op_data = serializer.Load(sys.stdin.read())\n\
\decoded = [opcodes.OpCode.LoadOpCode(o) for o in op_data]\n\
\for op in decoded:\n\
\ op.Validate(True)\n\
\encoded = [(op.Summary(), op.__getstate__())\n\
\ for op in decoded]\n\
\print serializer.Dump(\
\ encoded,\
\ private_encoder=serializer.EncodeWithPrivateFields)"
serialized
>>= checkPythonResult
let deserialised =
J.decode py_stdout::J.Result [(String, OpCodes.MetaOpCode)]
decoded <- case deserialised of
J.Ok ops -> return ops
J.Error msg ->
HUnit.assertFailure ("Unable to decode opcodes: " ++ msg)
-- this already raised an expection, but we need it
-- for proper types
>> fail "Unable to decode opcodes"
HUnit.assertEqual "Mismatch in number of returned opcodes"
(length decoded) (length with_sum)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
) $ zip with_sum decoded
-- | Custom HUnit test case that forks a Python process and checks
-- correspondence between Haskell OpCodes fields and their Python
-- equivalent.
| 2,074
|
case_py_compat_types = do
let num_opcodes = length OpCodes.allOpIDs * 100
opcodes <- genSample (vectorOf num_opcodes
(arbitrary::Gen OpCodes.MetaOpCode))
let with_sum = map (\o -> (OpCodes.opSummary $
OpCodes.metaOpCode o, o)) opcodes
serialized = J.encode opcodes
-- check for non-ASCII fields, usually due to 'arbitrary :: String'
mapM_ (\op -> when (any (not . isAscii) (J.encode op)) .
HUnit.assertFailure $
"OpCode has non-ASCII fields: " ++ show op
) opcodes
py_stdout <-
runPython "from ganeti import opcodes\n\
\from ganeti import serializer\n\
\import sys\n\
\op_data = serializer.Load(sys.stdin.read())\n\
\decoded = [opcodes.OpCode.LoadOpCode(o) for o in op_data]\n\
\for op in decoded:\n\
\ op.Validate(True)\n\
\encoded = [(op.Summary(), op.__getstate__())\n\
\ for op in decoded]\n\
\print serializer.Dump(\
\ encoded,\
\ private_encoder=serializer.EncodeWithPrivateFields)"
serialized
>>= checkPythonResult
let deserialised =
J.decode py_stdout::J.Result [(String, OpCodes.MetaOpCode)]
decoded <- case deserialised of
J.Ok ops -> return ops
J.Error msg ->
HUnit.assertFailure ("Unable to decode opcodes: " ++ msg)
-- this already raised an expection, but we need it
-- for proper types
>> fail "Unable to decode opcodes"
HUnit.assertEqual "Mismatch in number of returned opcodes"
(length decoded) (length with_sum)
mapM_ (uncurry (HUnit.assertEqual "Different result after encoding/decoding")
) $ zip with_sum decoded
-- | Custom HUnit test case that forks a Python process and checks
-- correspondence between Haskell OpCodes fields and their Python
-- equivalent.
| 2,034
| false
| true
| 0
| 18
| 665
| 331
| 162
| 169
| null | null |
evancz/cli
|
src/CommandLine/Args/Internal.hs
|
bsd-3-clause
|
file :: Parser FilePath
file =
File
| 37
|
file :: Parser FilePath
file =
File
| 37
|
file =
File
| 13
| false
| true
| 0
| 5
| 8
| 14
| 7
| 7
| null | null |
snoyberg/ghc
|
libraries/base/Data/Data.hs
|
bsd-3-clause
|
intType :: DataType
intType = mkIntType "Prelude.Int"
| 53
|
intType :: DataType
intType = mkIntType "Prelude.Int"
| 53
|
intType = mkIntType "Prelude.Int"
| 33
| false
| true
| 0
| 6
| 6
| 21
| 8
| 13
| null | null |
mtlstats/mtlstats
|
src/Mtlstats/Config.hs
|
gpl-3.0
|
-- | The name of the team whose stats we're tracking
myTeam :: String
myTeam = "MONTREAL"
| 89
|
myTeam :: String
myTeam = "MONTREAL"
| 36
|
myTeam = "MONTREAL"
| 19
| true
| true
| 0
| 6
| 16
| 19
| 8
| 11
| null | null |
yalpul/CENG242
|
H99/31-41/p33.hs
|
gpl-3.0
|
a b = gcd' a b == 1 where
gcd' a b
| rm > 0 = gcd' b rm
| otherwise = b where
rm = mod a b
| 158
|
a b = gcd' a b == 1 where
gcd' a b
| rm > 0 = gcd' b rm
| otherwise = b where
rm = mod a b
| 158
|
a b = gcd' a b == 1 where
gcd' a b
| rm > 0 = gcd' b rm
| otherwise = b where
rm = mod a b
| 158
| false
| false
| 0
| 10
| 97
| 66
| 30
| 36
| null | null |
input-output-hk/pos-haskell-prototype
|
chain/src/Pos/Chain/Ssc/Payload.hs
|
mit
|
checkSscPayload
:: MonadError Text m
=> ProtocolMagic
-> SscPayload
-> m ()
checkSscPayload pm payload = checkVssCertificatesMap pm (spVss payload)
| 163
|
checkSscPayload
:: MonadError Text m
=> ProtocolMagic
-> SscPayload
-> m ()
checkSscPayload pm payload = checkVssCertificatesMap pm (spVss payload)
| 163
|
checkSscPayload pm payload = checkVssCertificatesMap pm (spVss payload)
| 71
| false
| true
| 0
| 10
| 35
| 53
| 24
| 29
| null | null |
spinda/liquidhaskell
|
tests/gsoc15/unknown/pos/propmeasure.hs
|
bsd-3-clause
|
len5 :: [Int]
len5 = [1, 2, 3, 4, 5]
| 36
|
len5 :: [Int]
len5 = [1, 2, 3, 4, 5]
| 36
|
len5 = [1, 2, 3, 4, 5]
| 22
| false
| true
| 0
| 5
| 9
| 29
| 18
| 11
| null | null |
bgold-cosmos/Tidal
|
src/Sound/Tidal/Stream.hs
|
gpl-3.0
|
ctrlResponder :: Int -> Config -> Stream -> IO ()
ctrlResponder waits c (stream@(Stream {sListen = Just sock}))
= do ms <- recvMessagesTimeout 2 sock
if (null ms)
then do checkHandshake -- there was a timeout, check handshake
ctrlResponder (waits+1) c stream
else do mapM_ act ms
ctrlResponder 0 c stream
where
checkHandshake = do busses <- readMVar (sBusses stream)
when (null busses) $ do when (waits == 0) $ verbose c $ "Waiting for SuperDirt (v.1.7.2 or higher).."
sendHandshakes stream
act (O.Message "/dirt/hello" _) = sendHandshakes stream
act (O.Message "/dirt/handshake/reply" xs) = do prev <- swapMVar (sBusses stream) $ bufferIndices xs
-- Only report the first time..
when (null prev) $ verbose c $ "Connected to SuperDirt."
return ()
where
bufferIndices [] = []
bufferIndices (x:xs') | x == (O.ASCII_String $ O.ascii "&controlBusIndices") = catMaybes $ takeWhile isJust $ map O.datum_integral xs'
| otherwise = bufferIndices xs'
-- External controller commands
act (O.Message "/ctrl" (O.Int32 k:v:[]))
= act (O.Message "/ctrl" [O.string $ show k,v])
act (O.Message "/ctrl" (O.ASCII_String k:v@(O.Float _):[]))
= add (O.ascii_to_string k) (VF (fromJust $ O.datum_floating v))
act (O.Message "/ctrl" (O.ASCII_String k:O.ASCII_String v:[]))
= add (O.ascii_to_string k) (VS (O.ascii_to_string v))
act (O.Message "/ctrl" (O.ASCII_String k:O.Int32 v:[]))
= add (O.ascii_to_string k) (VI (fromIntegral v))
-- Stream playback commands
act (O.Message "/mute" (k:[]))
= withID k $ streamMute stream
act (O.Message "/unmute" (k:[]))
= withID k $ streamUnmute stream
act (O.Message "/solo" (k:[]))
= withID k $ streamSolo stream
act (O.Message "/unsolo" (k:[]))
= withID k $ streamUnsolo stream
act (O.Message "/muteAll" [])
= streamMuteAll stream
act (O.Message "/unmuteAll" [])
= streamUnmuteAll stream
act (O.Message "/unsoloAll" [])
= streamUnsoloAll stream
act (O.Message "/hush" [])
= streamHush stream
act (O.Message "/silence" (k:[]))
= withID k $ streamSilence stream
act m = hPutStrLn stderr $ "Unhandled OSC: " ++ show m
add :: String -> Value -> IO ()
add k v = do sMap <- takeMVar (sStateMV stream)
putMVar (sStateMV stream) $ Map.insert k v sMap
return ()
withID :: O.Datum -> (ID -> IO ()) -> IO ()
withID (O.ASCII_String k) func = func $ (ID . O.ascii_to_string) k
withID (O.Int32 k) func = func $ (ID . show) k
withID _ _ = return ()
| 3,108
|
ctrlResponder :: Int -> Config -> Stream -> IO ()
ctrlResponder waits c (stream@(Stream {sListen = Just sock}))
= do ms <- recvMessagesTimeout 2 sock
if (null ms)
then do checkHandshake -- there was a timeout, check handshake
ctrlResponder (waits+1) c stream
else do mapM_ act ms
ctrlResponder 0 c stream
where
checkHandshake = do busses <- readMVar (sBusses stream)
when (null busses) $ do when (waits == 0) $ verbose c $ "Waiting for SuperDirt (v.1.7.2 or higher).."
sendHandshakes stream
act (O.Message "/dirt/hello" _) = sendHandshakes stream
act (O.Message "/dirt/handshake/reply" xs) = do prev <- swapMVar (sBusses stream) $ bufferIndices xs
-- Only report the first time..
when (null prev) $ verbose c $ "Connected to SuperDirt."
return ()
where
bufferIndices [] = []
bufferIndices (x:xs') | x == (O.ASCII_String $ O.ascii "&controlBusIndices") = catMaybes $ takeWhile isJust $ map O.datum_integral xs'
| otherwise = bufferIndices xs'
-- External controller commands
act (O.Message "/ctrl" (O.Int32 k:v:[]))
= act (O.Message "/ctrl" [O.string $ show k,v])
act (O.Message "/ctrl" (O.ASCII_String k:v@(O.Float _):[]))
= add (O.ascii_to_string k) (VF (fromJust $ O.datum_floating v))
act (O.Message "/ctrl" (O.ASCII_String k:O.ASCII_String v:[]))
= add (O.ascii_to_string k) (VS (O.ascii_to_string v))
act (O.Message "/ctrl" (O.ASCII_String k:O.Int32 v:[]))
= add (O.ascii_to_string k) (VI (fromIntegral v))
-- Stream playback commands
act (O.Message "/mute" (k:[]))
= withID k $ streamMute stream
act (O.Message "/unmute" (k:[]))
= withID k $ streamUnmute stream
act (O.Message "/solo" (k:[]))
= withID k $ streamSolo stream
act (O.Message "/unsolo" (k:[]))
= withID k $ streamUnsolo stream
act (O.Message "/muteAll" [])
= streamMuteAll stream
act (O.Message "/unmuteAll" [])
= streamUnmuteAll stream
act (O.Message "/unsoloAll" [])
= streamUnsoloAll stream
act (O.Message "/hush" [])
= streamHush stream
act (O.Message "/silence" (k:[]))
= withID k $ streamSilence stream
act m = hPutStrLn stderr $ "Unhandled OSC: " ++ show m
add :: String -> Value -> IO ()
add k v = do sMap <- takeMVar (sStateMV stream)
putMVar (sStateMV stream) $ Map.insert k v sMap
return ()
withID :: O.Datum -> (ID -> IO ()) -> IO ()
withID (O.ASCII_String k) func = func $ (ID . O.ascii_to_string) k
withID (O.Int32 k) func = func $ (ID . show) k
withID _ _ = return ()
| 3,108
|
ctrlResponder waits c (stream@(Stream {sListen = Just sock}))
= do ms <- recvMessagesTimeout 2 sock
if (null ms)
then do checkHandshake -- there was a timeout, check handshake
ctrlResponder (waits+1) c stream
else do mapM_ act ms
ctrlResponder 0 c stream
where
checkHandshake = do busses <- readMVar (sBusses stream)
when (null busses) $ do when (waits == 0) $ verbose c $ "Waiting for SuperDirt (v.1.7.2 or higher).."
sendHandshakes stream
act (O.Message "/dirt/hello" _) = sendHandshakes stream
act (O.Message "/dirt/handshake/reply" xs) = do prev <- swapMVar (sBusses stream) $ bufferIndices xs
-- Only report the first time..
when (null prev) $ verbose c $ "Connected to SuperDirt."
return ()
where
bufferIndices [] = []
bufferIndices (x:xs') | x == (O.ASCII_String $ O.ascii "&controlBusIndices") = catMaybes $ takeWhile isJust $ map O.datum_integral xs'
| otherwise = bufferIndices xs'
-- External controller commands
act (O.Message "/ctrl" (O.Int32 k:v:[]))
= act (O.Message "/ctrl" [O.string $ show k,v])
act (O.Message "/ctrl" (O.ASCII_String k:v@(O.Float _):[]))
= add (O.ascii_to_string k) (VF (fromJust $ O.datum_floating v))
act (O.Message "/ctrl" (O.ASCII_String k:O.ASCII_String v:[]))
= add (O.ascii_to_string k) (VS (O.ascii_to_string v))
act (O.Message "/ctrl" (O.ASCII_String k:O.Int32 v:[]))
= add (O.ascii_to_string k) (VI (fromIntegral v))
-- Stream playback commands
act (O.Message "/mute" (k:[]))
= withID k $ streamMute stream
act (O.Message "/unmute" (k:[]))
= withID k $ streamUnmute stream
act (O.Message "/solo" (k:[]))
= withID k $ streamSolo stream
act (O.Message "/unsolo" (k:[]))
= withID k $ streamUnsolo stream
act (O.Message "/muteAll" [])
= streamMuteAll stream
act (O.Message "/unmuteAll" [])
= streamUnmuteAll stream
act (O.Message "/unsoloAll" [])
= streamUnsoloAll stream
act (O.Message "/hush" [])
= streamHush stream
act (O.Message "/silence" (k:[]))
= withID k $ streamSilence stream
act m = hPutStrLn stderr $ "Unhandled OSC: " ++ show m
add :: String -> Value -> IO ()
add k v = do sMap <- takeMVar (sStateMV stream)
putMVar (sStateMV stream) $ Map.insert k v sMap
return ()
withID :: O.Datum -> (ID -> IO ()) -> IO ()
withID (O.ASCII_String k) func = func $ (ID . O.ascii_to_string) k
withID (O.Int32 k) func = func $ (ID . show) k
withID _ _ = return ()
| 3,058
| false
| true
| 0
| 16
| 1,123
| 1,137
| 546
| 591
| null | null |
jputcu/VellemanK8055
|
System/Hardware/VellemanK8055.hs
|
bsd-3-clause
|
setAnalogChannel:: DeviceHandle -> AnalogChannel -> IO ()
setAnalogChannel hd ch = outputAnalogChannel hd ch 0xff
| 113
|
setAnalogChannel:: DeviceHandle -> AnalogChannel -> IO ()
setAnalogChannel hd ch = outputAnalogChannel hd ch 0xff
| 113
|
setAnalogChannel hd ch = outputAnalogChannel hd ch 0xff
| 55
| false
| true
| 0
| 8
| 14
| 36
| 17
| 19
| null | null |
ghorn/dynobud
|
dynobud/examples/ParallelMap.hs
|
lgpl-3.0
|
main :: IO ()
main = do
let dummyInput :: M (JV V2) (JVec N (JV Id)) DM
dummyInput = hcat' $ fmap (\x -> vcat (V2 x (2*x)))
(TV.tvlinspace 0 (2*pi))
show dummyInput `seq` return ()
-- make a dummy function that's moderately expensive to evaluate
putStrLn "creating dummy function..."
f0 <- toFun "f0" f0' mempty
:: IO (Fun (J (JV V2)) (J (JV V3)))
let runOne :: String
-> Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id)))
-> IO ()
runOne name someMap = do
putStrLn $ "evaluating " ++ name ++ "..."
t0 <- getCurrentTime
_ <- callDM someMap dummyInput
t1 <- getCurrentTime
printf "evaluated %s in %.3f seconds\n"
name (realToFrac (diffUTCTime t1 t0) :: Double)
let naiveFun :: M (JV V2) (JVec N (JV Id)) MX -> M (JV V3) (JVec N (JV Id)) MX
naiveFun xs = hcat' ys
where
ys :: TV.Vec N (M (JV V3) (JV Id) MX)
ys = fmap (callSym f0) xs'
xs' :: TV.Vec N (M (JV V2) (JV Id) MX)
xs' = hsplit' xs
naive <- toFun "naive_map" naiveFun mempty
unroll <- mapFun (Proxy :: Proxy N) f0 Unroll
:: IO (Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id))))
ser <- mapFun (Proxy :: Proxy N) f0 Serial
:: IO (Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id))))
par <- mapFun (Proxy :: Proxy N) f0 OpenMP
runOne "naive map" naive
runOne "unrolled symbolic_map" unroll
runOne "serial symbolic map" ser
runOne "parallel symbolic map" par
| 1,678
|
main :: IO ()
main = do
let dummyInput :: M (JV V2) (JVec N (JV Id)) DM
dummyInput = hcat' $ fmap (\x -> vcat (V2 x (2*x)))
(TV.tvlinspace 0 (2*pi))
show dummyInput `seq` return ()
-- make a dummy function that's moderately expensive to evaluate
putStrLn "creating dummy function..."
f0 <- toFun "f0" f0' mempty
:: IO (Fun (J (JV V2)) (J (JV V3)))
let runOne :: String
-> Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id)))
-> IO ()
runOne name someMap = do
putStrLn $ "evaluating " ++ name ++ "..."
t0 <- getCurrentTime
_ <- callDM someMap dummyInput
t1 <- getCurrentTime
printf "evaluated %s in %.3f seconds\n"
name (realToFrac (diffUTCTime t1 t0) :: Double)
let naiveFun :: M (JV V2) (JVec N (JV Id)) MX -> M (JV V3) (JVec N (JV Id)) MX
naiveFun xs = hcat' ys
where
ys :: TV.Vec N (M (JV V3) (JV Id) MX)
ys = fmap (callSym f0) xs'
xs' :: TV.Vec N (M (JV V2) (JV Id) MX)
xs' = hsplit' xs
naive <- toFun "naive_map" naiveFun mempty
unroll <- mapFun (Proxy :: Proxy N) f0 Unroll
:: IO (Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id))))
ser <- mapFun (Proxy :: Proxy N) f0 Serial
:: IO (Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id))))
par <- mapFun (Proxy :: Proxy N) f0 OpenMP
runOne "naive map" naive
runOne "unrolled symbolic_map" unroll
runOne "serial symbolic map" ser
runOne "parallel symbolic map" par
| 1,678
|
main = do
let dummyInput :: M (JV V2) (JVec N (JV Id)) DM
dummyInput = hcat' $ fmap (\x -> vcat (V2 x (2*x)))
(TV.tvlinspace 0 (2*pi))
show dummyInput `seq` return ()
-- make a dummy function that's moderately expensive to evaluate
putStrLn "creating dummy function..."
f0 <- toFun "f0" f0' mempty
:: IO (Fun (J (JV V2)) (J (JV V3)))
let runOne :: String
-> Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id)))
-> IO ()
runOne name someMap = do
putStrLn $ "evaluating " ++ name ++ "..."
t0 <- getCurrentTime
_ <- callDM someMap dummyInput
t1 <- getCurrentTime
printf "evaluated %s in %.3f seconds\n"
name (realToFrac (diffUTCTime t1 t0) :: Double)
let naiveFun :: M (JV V2) (JVec N (JV Id)) MX -> M (JV V3) (JVec N (JV Id)) MX
naiveFun xs = hcat' ys
where
ys :: TV.Vec N (M (JV V3) (JV Id) MX)
ys = fmap (callSym f0) xs'
xs' :: TV.Vec N (M (JV V2) (JV Id) MX)
xs' = hsplit' xs
naive <- toFun "naive_map" naiveFun mempty
unroll <- mapFun (Proxy :: Proxy N) f0 Unroll
:: IO (Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id))))
ser <- mapFun (Proxy :: Proxy N) f0 Serial
:: IO (Fun
(M (JV V2) (JVec N (JV Id)))
(M (JV V3) (JVec N (JV Id))))
par <- mapFun (Proxy :: Proxy N) f0 OpenMP
runOne "naive map" naive
runOne "unrolled symbolic_map" unroll
runOne "serial symbolic map" ser
runOne "parallel symbolic map" par
| 1,664
| false
| true
| 1
| 19
| 599
| 777
| 372
| 405
| null | null |
ihc/futhark
|
src/Futhark/TypeCheck.hs
|
isc
|
checkBasicOp (Scratch _ shape) =
mapM_ checkSubExp shape
| 58
|
checkBasicOp (Scratch _ shape) =
mapM_ checkSubExp shape
| 58
|
checkBasicOp (Scratch _ shape) =
mapM_ checkSubExp shape
| 58
| false
| false
| 0
| 7
| 9
| 22
| 10
| 12
| null | null |
jsavatgy/dit-doo
|
code/first-debug.hs
|
gpl-2.0
|
intToDouble :: Int -> Double
intToDouble = fromRational . toRational
| 68
|
intToDouble :: Int -> Double
intToDouble = fromRational . toRational
| 68
|
intToDouble = fromRational . toRational
| 39
| false
| true
| 0
| 5
| 9
| 19
| 10
| 9
| null | null |
tomahawkins/powerpc
|
Language/PowerPC/RTL.hs
|
bsd-3-clause
|
(&&.) :: E -> E -> E
(&&.) = And
| 32
|
(&&.) :: E -> E -> E
(&&.) = And
| 32
|
(&&.) = And
| 11
| false
| true
| 0
| 6
| 9
| 23
| 14
| 9
| null | null |
GaloisInc/sk-dev-platform
|
libs/SCD/testsrc/SCD/M4/Test/ErrorSuite.hs
|
bsd-3-clause
|
procXML' c = c
| 22
|
procXML' c = c
| 22
|
procXML' c = c
| 22
| false
| false
| 0
| 5
| 11
| 9
| 4
| 5
| null | null |
alexander-at-github/eta
|
compiler/ETA/TypeCheck/TcType.hs
|
bsd-3-clause
|
isIndirect (Indirect _) = True
| 30
|
isIndirect (Indirect _) = True
| 30
|
isIndirect (Indirect _) = True
| 30
| false
| false
| 0
| 7
| 4
| 15
| 7
| 8
| null | null |
randen/cabal
|
Cabal/Distribution/Simple/GHC/Internal.hs
|
bsd-3-clause
|
getHaskellObjects :: GhcImplInfo -> Library -> LocalBuildInfo
-> FilePath -> String -> Bool -> IO [FilePath]
getHaskellObjects implInfo lib lbi pref wanted_obj_ext allow_split_objs
| splitObjs lbi && allow_split_objs = do
let splitSuffix = if noExtInSplitSuffix implInfo
then "_split"
else "_" ++ wanted_obj_ext ++ "_split"
dirs = [ pref </> (ModuleName.toFilePath x ++ splitSuffix)
| x <- libModules lib ]
objss <- mapM getDirectoryContents dirs
let objs = [ dir </> obj
| (objs',dir) <- zip objss dirs, obj <- objs',
let obj_ext = takeExtension obj,
'.':wanted_obj_ext == obj_ext ]
return objs
| otherwise =
return [ pref </> ModuleName.toFilePath x <.> wanted_obj_ext
| x <- libModules lib ]
| 918
|
getHaskellObjects :: GhcImplInfo -> Library -> LocalBuildInfo
-> FilePath -> String -> Bool -> IO [FilePath]
getHaskellObjects implInfo lib lbi pref wanted_obj_ext allow_split_objs
| splitObjs lbi && allow_split_objs = do
let splitSuffix = if noExtInSplitSuffix implInfo
then "_split"
else "_" ++ wanted_obj_ext ++ "_split"
dirs = [ pref </> (ModuleName.toFilePath x ++ splitSuffix)
| x <- libModules lib ]
objss <- mapM getDirectoryContents dirs
let objs = [ dir </> obj
| (objs',dir) <- zip objss dirs, obj <- objs',
let obj_ext = takeExtension obj,
'.':wanted_obj_ext == obj_ext ]
return objs
| otherwise =
return [ pref </> ModuleName.toFilePath x <.> wanted_obj_ext
| x <- libModules lib ]
| 918
|
getHaskellObjects implInfo lib lbi pref wanted_obj_ext allow_split_objs
| splitObjs lbi && allow_split_objs = do
let splitSuffix = if noExtInSplitSuffix implInfo
then "_split"
else "_" ++ wanted_obj_ext ++ "_split"
dirs = [ pref </> (ModuleName.toFilePath x ++ splitSuffix)
| x <- libModules lib ]
objss <- mapM getDirectoryContents dirs
let objs = [ dir </> obj
| (objs',dir) <- zip objss dirs, obj <- objs',
let obj_ext = takeExtension obj,
'.':wanted_obj_ext == obj_ext ]
return objs
| otherwise =
return [ pref </> ModuleName.toFilePath x <.> wanted_obj_ext
| x <- libModules lib ]
| 791
| false
| true
| 1
| 17
| 331
| 254
| 123
| 131
| null | null |
neosam/esge
|
src/Esge/Room.hs
|
bsd-3-clause
|
-- | Get all 'Room's from an 'EC.Ingame' storage
allRooms :: EC.Ingame -> [Room]
allRooms = EC.allOfType
| 104
|
allRooms :: EC.Ingame -> [Room]
allRooms = EC.allOfType
| 55
|
allRooms = EC.allOfType
| 23
| true
| true
| 0
| 6
| 16
| 23
| 13
| 10
| null | null |
rzetterberg/orgmode-sql
|
bench/Query/ExportBench.hs
|
bsd-3-clause
|
benchMediumDoc :: Benchmark
benchMediumDoc = bench "medium doc" $ whnfIO $ do
mkExportBench "4_sections_3_tags_2_clocks.org"
| 128
|
benchMediumDoc :: Benchmark
benchMediumDoc = bench "medium doc" $ whnfIO $ do
mkExportBench "4_sections_3_tags_2_clocks.org"
| 128
|
benchMediumDoc = bench "medium doc" $ whnfIO $ do
mkExportBench "4_sections_3_tags_2_clocks.org"
| 100
| false
| true
| 0
| 8
| 17
| 28
| 13
| 15
| null | null |
pminten/xhaskell
|
meetup/meetup_test.hs
|
mit
|
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess
| 163
|
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess
| 163
|
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess
| 128
| false
| true
| 0
| 12
| 34
| 69
| 32
| 37
| null | null |
br0ns/hindsight
|
src/Crypto/Simple.hs
|
gpl-3.0
|
newMasterKey :: FilePath -> IO ()
newMasterKey path =
do key <- MasterKey `fmap` getEntropy NaCl.keyLength
B.writeFile path $ encode key
| 143
|
newMasterKey :: FilePath -> IO ()
newMasterKey path =
do key <- MasterKey `fmap` getEntropy NaCl.keyLength
B.writeFile path $ encode key
| 143
|
newMasterKey path =
do key <- MasterKey `fmap` getEntropy NaCl.keyLength
B.writeFile path $ encode key
| 109
| false
| true
| 0
| 11
| 27
| 61
| 27
| 34
| null | null |
wxwxwwxxx/ghc
|
compiler/rename/RnTypes.hs
|
bsd-3-clause
|
rnForAll :: HsDocContext -> HsExplicitFlag
-> Maybe SrcSpan -- Location of an extra-constraints wildcard
-> [RdrName] -- Kind variables
-> LHsTyVarBndrs RdrName -- Type variables
-> LHsContext RdrName -> LHsType RdrName
-> RnM (HsType Name, FreeVars)
rnForAll doc exp extra kvs forall_tyvars ctxt ty
| null kvs, null (hsQTvBndrs forall_tyvars), null (unLoc ctxt), isNothing extra
= rnHsType doc (unLoc ty)
-- One reason for this case is that a type like Int#
-- starts off as (HsForAllTy Implicit Nothing [] Int), in case
-- there is some quantification. Now that we have quantified
-- and discovered there are no type variables, it's nicer to turn
-- it into plain Int. If it were Int# instead of Int, we'd actually
-- get an error, because the body of a genuine for-all is
-- of kind *.
| otherwise
= bindHsTyVars doc Nothing kvs forall_tyvars $ \ new_tyvars ->
do { (new_ctxt, fvs1) <- rnContext doc ctxt
; (new_ty, fvs2) <- rnLHsType doc ty
; return (HsForAllTy exp extra new_tyvars new_ctxt new_ty, fvs1 `plusFV` fvs2) }
| 1,182
|
rnForAll :: HsDocContext -> HsExplicitFlag
-> Maybe SrcSpan -- Location of an extra-constraints wildcard
-> [RdrName] -- Kind variables
-> LHsTyVarBndrs RdrName -- Type variables
-> LHsContext RdrName -> LHsType RdrName
-> RnM (HsType Name, FreeVars)
rnForAll doc exp extra kvs forall_tyvars ctxt ty
| null kvs, null (hsQTvBndrs forall_tyvars), null (unLoc ctxt), isNothing extra
= rnHsType doc (unLoc ty)
-- One reason for this case is that a type like Int#
-- starts off as (HsForAllTy Implicit Nothing [] Int), in case
-- there is some quantification. Now that we have quantified
-- and discovered there are no type variables, it's nicer to turn
-- it into plain Int. If it were Int# instead of Int, we'd actually
-- get an error, because the body of a genuine for-all is
-- of kind *.
| otherwise
= bindHsTyVars doc Nothing kvs forall_tyvars $ \ new_tyvars ->
do { (new_ctxt, fvs1) <- rnContext doc ctxt
; (new_ty, fvs2) <- rnLHsType doc ty
; return (HsForAllTy exp extra new_tyvars new_ctxt new_ty, fvs1 `plusFV` fvs2) }
| 1,181
|
rnForAll doc exp extra kvs forall_tyvars ctxt ty
| null kvs, null (hsQTvBndrs forall_tyvars), null (unLoc ctxt), isNothing extra
= rnHsType doc (unLoc ty)
-- One reason for this case is that a type like Int#
-- starts off as (HsForAllTy Implicit Nothing [] Int), in case
-- there is some quantification. Now that we have quantified
-- and discovered there are no type variables, it's nicer to turn
-- it into plain Int. If it were Int# instead of Int, we'd actually
-- get an error, because the body of a genuine for-all is
-- of kind *.
| otherwise
= bindHsTyVars doc Nothing kvs forall_tyvars $ \ new_tyvars ->
do { (new_ctxt, fvs1) <- rnContext doc ctxt
; (new_ty, fvs2) <- rnLHsType doc ty
; return (HsForAllTy exp extra new_tyvars new_ctxt new_ty, fvs1 `plusFV` fvs2) }
| 859
| false
| true
| 0
| 14
| 330
| 243
| 123
| 120
| null | null |
HIPERFIT/futhark
|
src/Futhark/IR/Primitive.hs
|
isc
|
doConvOp (FPToUI _ to) (FloatValue v) = Just $ IntValue $ doFPToUI v to
| 71
|
doConvOp (FPToUI _ to) (FloatValue v) = Just $ IntValue $ doFPToUI v to
| 71
|
doConvOp (FPToUI _ to) (FloatValue v) = Just $ IntValue $ doFPToUI v to
| 71
| false
| false
| 0
| 7
| 13
| 41
| 19
| 22
| null | null |
LightAndLight/hindley-milner
|
app/interpreter/Interpreter.hs
|
bsd-3-clause
|
initialInterpreterState
= InterpreterState
{ _interpSymbolTable = M.empty
, _interpKindTable = M.empty
, _interpTypesignatures = M.empty
, _interpContext = M.empty
, _interpTcContext = []
}
| 203
|
initialInterpreterState
= InterpreterState
{ _interpSymbolTable = M.empty
, _interpKindTable = M.empty
, _interpTypesignatures = M.empty
, _interpContext = M.empty
, _interpTcContext = []
}
| 203
|
initialInterpreterState
= InterpreterState
{ _interpSymbolTable = M.empty
, _interpKindTable = M.empty
, _interpTypesignatures = M.empty
, _interpContext = M.empty
, _interpTcContext = []
}
| 203
| false
| false
| 1
| 8
| 37
| 55
| 30
| 25
| null | null |
sweirich/hs-inferno
|
src/Language/Inferno/Generic/Unifier.hs
|
bsd-3-clause
|
unify :: forall r m s. (Typeable m, MonadEqRef m, MonadCatch m, ZipM s,
Show (s (Variable m s)))
=> Variable m s -> Variable m s -> m ()
unify v1 v2 = do
tentatively (Proxy :: Proxy (Err m s))
(unify_internal v1 v2)
`catch`
(\(e :: ZipError (s (Variable m s))) ->
throwM (Unify v1 v2))
--------------------------------------------------------------------------
| 421
|
unify :: forall r m s. (Typeable m, MonadEqRef m, MonadCatch m, ZipM s,
Show (s (Variable m s)))
=> Variable m s -> Variable m s -> m ()
unify v1 v2 = do
tentatively (Proxy :: Proxy (Err m s))
(unify_internal v1 v2)
`catch`
(\(e :: ZipError (s (Variable m s))) ->
throwM (Unify v1 v2))
--------------------------------------------------------------------------
| 421
|
unify v1 v2 = do
tentatively (Proxy :: Proxy (Err m s))
(unify_internal v1 v2)
`catch`
(\(e :: ZipError (s (Variable m s))) ->
throwM (Unify v1 v2))
--------------------------------------------------------------------------
| 251
| false
| true
| 0
| 16
| 119
| 176
| 90
| 86
| null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
719 = 718
| 9
|
719 = 718
| 9
|
719 = 718
| 9
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
NoxHarmonium/lithium-lang
|
src/Codegen.hs
|
mit
|
execCodegen :: Codegen a -> CodegenState
execCodegen m = execState (runCodegen m) emptyCodegen
| 94
|
execCodegen :: Codegen a -> CodegenState
execCodegen m = execState (runCodegen m) emptyCodegen
| 94
|
execCodegen m = execState (runCodegen m) emptyCodegen
| 53
| false
| true
| 0
| 7
| 12
| 39
| 16
| 23
| null | null |
ulricha/algebra-sql
|
src/Database/Algebra/SQL/Render/Tile.hs
|
bsd-3-clause
|
renderTileTreeNode :: Dialect -> Q.SelectStmt -> [(Int, TileTree)] -> Doc
renderTileTreeNode compat body children =
type_ "tile"
<$> RQ.renderSelectStmt compat body
<> if null children
then empty
else linebreak <> bold (text "children") <+> align (vsep rC)
where rC = map f children
f (vId, t) = intRef vId <+> align (renderTileTree compat t)
| 387
|
renderTileTreeNode :: Dialect -> Q.SelectStmt -> [(Int, TileTree)] -> Doc
renderTileTreeNode compat body children =
type_ "tile"
<$> RQ.renderSelectStmt compat body
<> if null children
then empty
else linebreak <> bold (text "children") <+> align (vsep rC)
where rC = map f children
f (vId, t) = intRef vId <+> align (renderTileTree compat t)
| 387
|
renderTileTreeNode compat body children =
type_ "tile"
<$> RQ.renderSelectStmt compat body
<> if null children
then empty
else linebreak <> bold (text "children") <+> align (vsep rC)
where rC = map f children
f (vId, t) = intRef vId <+> align (renderTileTree compat t)
| 312
| false
| true
| 1
| 11
| 98
| 140
| 70
| 70
| null | null |
aslatter/xhb
|
build-utils/src/HaskellCombinators.hs
|
bsd-3-clause
|
hsTyApp = HsTyApp
| 17
|
hsTyApp = HsTyApp
| 17
|
hsTyApp = HsTyApp
| 17
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
nickbart1980/pandoc
|
src/Text/Pandoc/Writers/ConTeXt.hs
|
gpl-2.0
|
inlineToConTeXt (Note contents) = do
contents' <- blockListToConTeXt contents
let codeBlock x@(CodeBlock _ _) = [x]
codeBlock _ = []
let codeBlocks = query codeBlock contents
return $ if null codeBlocks
then text "\\footnote{" <> nest 2 contents' <> char '}'
else text "\\startbuffer " <> nest 2 contents' <>
text "\\stopbuffer\\footnote{\\getbuffer}"
| 412
|
inlineToConTeXt (Note contents) = do
contents' <- blockListToConTeXt contents
let codeBlock x@(CodeBlock _ _) = [x]
codeBlock _ = []
let codeBlocks = query codeBlock contents
return $ if null codeBlocks
then text "\\footnote{" <> nest 2 contents' <> char '}'
else text "\\startbuffer " <> nest 2 contents' <>
text "\\stopbuffer\\footnote{\\getbuffer}"
| 412
|
inlineToConTeXt (Note contents) = do
contents' <- blockListToConTeXt contents
let codeBlock x@(CodeBlock _ _) = [x]
codeBlock _ = []
let codeBlocks = query codeBlock contents
return $ if null codeBlocks
then text "\\footnote{" <> nest 2 contents' <> char '}'
else text "\\startbuffer " <> nest 2 contents' <>
text "\\stopbuffer\\footnote{\\getbuffer}"
| 412
| false
| false
| 0
| 13
| 112
| 132
| 60
| 72
| null | null |
strager/b
|
B/Oracle/InMemory/Pure.hs
|
bsd-3-clause
|
putDependency :: Dependency m -> Binary.Put
putDependency (Dependency from to) = do
putTypeOf from
putTypeOf to
Binary.put (Sized from)
Binary.put (Sized to)
| 165
|
putDependency :: Dependency m -> Binary.Put
putDependency (Dependency from to) = do
putTypeOf from
putTypeOf to
Binary.put (Sized from)
Binary.put (Sized to)
| 165
|
putDependency (Dependency from to) = do
putTypeOf from
putTypeOf to
Binary.put (Sized from)
Binary.put (Sized to)
| 121
| false
| true
| 0
| 9
| 29
| 71
| 31
| 40
| null | null |
rueshyna/gogol
|
gogol-replicapool-updater/gen/Network/Google/Resource/ReplicaPoolUpdater/RollingUpdates/Pause.hs
|
mpl-2.0
|
-- | Creates a value of 'RollingUpdatesPause' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rupRollingUpdate'
--
-- * 'rupProject'
--
-- * 'rupZone'
rollingUpdatesPause
:: Text -- ^ 'rupRollingUpdate'
-> Text -- ^ 'rupProject'
-> Text -- ^ 'rupZone'
-> RollingUpdatesPause
rollingUpdatesPause pRupRollingUpdate_ pRupProject_ pRupZone_ =
RollingUpdatesPause'
{ _rupRollingUpdate = pRupRollingUpdate_
, _rupProject = pRupProject_
, _rupZone = pRupZone_
}
| 576
|
rollingUpdatesPause
:: Text -- ^ 'rupRollingUpdate'
-> Text -- ^ 'rupProject'
-> Text -- ^ 'rupZone'
-> RollingUpdatesPause
rollingUpdatesPause pRupRollingUpdate_ pRupProject_ pRupZone_ =
RollingUpdatesPause'
{ _rupRollingUpdate = pRupRollingUpdate_
, _rupProject = pRupProject_
, _rupZone = pRupZone_
}
| 339
|
rollingUpdatesPause pRupRollingUpdate_ pRupProject_ pRupZone_ =
RollingUpdatesPause'
{ _rupRollingUpdate = pRupRollingUpdate_
, _rupProject = pRupProject_
, _rupZone = pRupZone_
}
| 199
| true
| true
| 0
| 7
| 114
| 62
| 40
| 22
| null | null |
ambiata/highlighting-kate
|
Text/Highlighting/Kate/Syntax/Html.hs
|
gpl-2.0
|
parseRules ("HTML","Value SQ") =
(((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext))
<|>
((parseRules ("HTML","FindEntityRefs")))
<|>
(currentContext >>= \x -> guard (x == ("HTML","Value SQ")) >> pDefault >>= withAttribute StringTok))
| 283
|
parseRules ("HTML","Value SQ") =
(((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext))
<|>
((parseRules ("HTML","FindEntityRefs")))
<|>
(currentContext >>= \x -> guard (x == ("HTML","Value SQ")) >> pDefault >>= withAttribute StringTok))
| 283
|
parseRules ("HTML","Value SQ") =
(((pDetectChar False '\'' >>= withAttribute StringTok) >>~ (popContext >> popContext))
<|>
((parseRules ("HTML","FindEntityRefs")))
<|>
(currentContext >>= \x -> guard (x == ("HTML","Value SQ")) >> pDefault >>= withAttribute StringTok))
| 283
| false
| false
| 0
| 15
| 45
| 109
| 59
| 50
| null | null |
psfblair/freepalace
|
src/FreePalace/Handlers/Incoming.hs
|
apache-2.0
|
handleInboundEvent clientState (InboundMessages.UserStatusMessage userStatus) = handleUserStatus clientState userStatus
| 119
|
handleInboundEvent clientState (InboundMessages.UserStatusMessage userStatus) = handleUserStatus clientState userStatus
| 119
|
handleInboundEvent clientState (InboundMessages.UserStatusMessage userStatus) = handleUserStatus clientState userStatus
| 119
| false
| false
| 0
| 8
| 7
| 24
| 11
| 13
| null | null |
edsko/hackage-server
|
Distribution/Server/Features/BuildReports/Backup.hs
|
bsd-3-clause
|
restoreBackup :: RestoreBackup BuildReports
restoreBackup = updateReports Reports.emptyReports Map.empty
| 104
|
restoreBackup :: RestoreBackup BuildReports
restoreBackup = updateReports Reports.emptyReports Map.empty
| 104
|
restoreBackup = updateReports Reports.emptyReports Map.empty
| 60
| false
| true
| 0
| 6
| 8
| 23
| 11
| 12
| null | null |
sordina/scotty
|
Web/Scotty/Action.hs
|
bsd-3-clause
|
-- | Abort execution of this action and continue pattern matching routes.
-- Like an exception, any code after 'next' is not executed.
--
-- As an example, these two routes overlap. The only way the second one will
-- ever run is if the first one calls 'next'.
--
-- > get "/foo/:bar" $ do
-- > w :: Text <- param "bar"
-- > unless (w == "special") next
-- > text "You made a request to /foo/special"
-- >
-- > get "/foo/:baz" $ do
-- > w <- param "baz"
-- > text $ "You made a request to: " <> w
next :: (ScottyError e, Monad m) => ActionT e m a
next = throwError Next
| 579
|
next :: (ScottyError e, Monad m) => ActionT e m a
next = throwError Next
| 72
|
next = throwError Next
| 22
| true
| true
| 0
| 7
| 130
| 55
| 33
| 22
| null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\xF9E0' = "\x6613"
| 33
|
decomposeChar '\xF9E0' = "\x6613"
| 33
|
decomposeChar '\xF9E0' = "\x6613"
| 33
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
ierton/yteratee
|
src/Data/Yteratee/StreamLike.hs
|
bsd-3-clause
|
head :: (Monad m, SL.StreamLike s el) => Yteratee s m el
head = Yteratee step
where
step (Chunk s) done cont _ =
case SL.null s of
True -> cont head
False -> done (SL.head s) (Chunk $ SL.tail s)
step eos _ _ err = err (toException EndOfStreamException) eos
| 322
|
head :: (Monad m, SL.StreamLike s el) => Yteratee s m el
head = Yteratee step
where
step (Chunk s) done cont _ =
case SL.null s of
True -> cont head
False -> done (SL.head s) (Chunk $ SL.tail s)
step eos _ _ err = err (toException EndOfStreamException) eos
| 322
|
head = Yteratee step
where
step (Chunk s) done cont _ =
case SL.null s of
True -> cont head
False -> done (SL.head s) (Chunk $ SL.tail s)
step eos _ _ err = err (toException EndOfStreamException) eos
| 265
| false
| true
| 1
| 13
| 116
| 138
| 67
| 71
| null | null |
abstools/abs-haskell-formal
|
benchmarks/3_primality_test_parallel/progs/1500.hs
|
bsd-3-clause
|
main_ :: Method
main_ [] this wb k =
Assign n (Val (I 1500)) $
Assign x (Sync primality_test [n]) $
k
| 108
|
main_ :: Method
main_ [] this wb k =
Assign n (Val (I 1500)) $
Assign x (Sync primality_test [n]) $
k
| 108
|
main_ [] this wb k =
Assign n (Val (I 1500)) $
Assign x (Sync primality_test [n]) $
k
| 92
| false
| true
| 3
| 9
| 28
| 70
| 32
| 38
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.