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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/InAppProducts/Insert.hs | mpl-2.0 | -- | JSONP
iapiCallback :: Lens' InAppProductsInsert (Maybe Text)
iapiCallback
= lens _iapiCallback (\ s a -> s{_iapiCallback = a}) | 133 | iapiCallback :: Lens' InAppProductsInsert (Maybe Text)
iapiCallback
= lens _iapiCallback (\ s a -> s{_iapiCallback = a}) | 122 | iapiCallback
= lens _iapiCallback (\ s a -> s{_iapiCallback = a}) | 67 | true | true | 1 | 9 | 21 | 52 | 25 | 27 | null | null |
diku-dk/futhark | src/Futhark/Internalise/Monomorphise.hs | isc | transformAppExp :: AppExp -> AppRes -> MonoM Exp
transformAppExp (Range e1 me incl loc) res = do
e1' <- transformExp e1
me' <- mapM transformExp me
incl' <- mapM transformExp incl
return $ AppExp (Range e1' me' incl' loc) (Info res) | 240 | transformAppExp :: AppExp -> AppRes -> MonoM Exp
transformAppExp (Range e1 me incl loc) res = do
e1' <- transformExp e1
me' <- mapM transformExp me
incl' <- mapM transformExp incl
return $ AppExp (Range e1' me' incl' loc) (Info res) | 240 | transformAppExp (Range e1 me incl loc) res = do
e1' <- transformExp e1
me' <- mapM transformExp me
incl' <- mapM transformExp incl
return $ AppExp (Range e1' me' incl' loc) (Info res) | 191 | false | true | 0 | 11 | 48 | 108 | 48 | 60 | null | null |
janrain/riak-haskell-client | src/Network/Riak/Request.hs | apache-2.0 | -- | Create a put request. The bucket and key names are URL-escaped.
-- Any 'Link' values inside the 'Content' are assumed to have been
-- constructed with the 'link' function, and hence /not/ escaped.
put :: Bucket -> Key -> Maybe VClock -> Content -> W -> DW -> Bool
-> Put.PutRequest
put bucket key mvclock cont mw mdw returnBody =
Put.PutRequest (escape bucket) (Just $ escape key) (fromVClock <$> mvclock)
cont (fromQuorum mw) (fromQuorum mdw) (Just returnBody)
Nothing Nothing Nothing Nothing | 545 | put :: Bucket -> Key -> Maybe VClock -> Content -> W -> DW -> Bool
-> Put.PutRequest
put bucket key mvclock cont mw mdw returnBody =
Put.PutRequest (escape bucket) (Just $ escape key) (fromVClock <$> mvclock)
cont (fromQuorum mw) (fromQuorum mdw) (Just returnBody)
Nothing Nothing Nothing Nothing | 342 | put bucket key mvclock cont mw mdw returnBody =
Put.PutRequest (escape bucket) (Just $ escape key) (fromVClock <$> mvclock)
cont (fromQuorum mw) (fromQuorum mdw) (Just returnBody)
Nothing Nothing Nothing Nothing | 253 | true | true | 0 | 14 | 129 | 133 | 66 | 67 | null | null |
ku-fpg/kansas-amber | legacy/Rewrite/LCD.hs | bsd-3-clause | -- | Set writing direction: Left to Right
lcdLeftToRight :: LCD -> Arduino ()
lcdLeftToRight lcd = updateDisplayMode True (maskBit LCD_ENTRYLEFT) lcd | 149 | lcdLeftToRight :: LCD -> Arduino ()
lcdLeftToRight lcd = updateDisplayMode True (maskBit LCD_ENTRYLEFT) lcd | 107 | lcdLeftToRight lcd = updateDisplayMode True (maskBit LCD_ENTRYLEFT) lcd | 71 | true | true | 0 | 7 | 21 | 40 | 19 | 21 | null | null |
danr/hipspec | testsuite/prod/zeno_version/ZenoVersion.hs | gpl-3.0 | prop_T23 :: [a] -> [a] -> Prop
prop_T23 x y = prove (half (length (x ++ y)) :=: half (length (y ++ x))) | 103 | prop_T23 :: [a] -> [a] -> Prop
prop_T23 x y = prove (half (length (x ++ y)) :=: half (length (y ++ x))) | 103 | prop_T23 x y = prove (half (length (x ++ y)) :=: half (length (y ++ x))) | 72 | false | true | 0 | 12 | 22 | 72 | 37 | 35 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/GHC/Float/ConversionUtils.hs | bsd-3-clause | toByte# :: Int# -> Int#
toByte# i = w2i (and# 255## (i2w i)) | 60 | toByte# :: Int# -> Int#
toByte# i = w2i (and# 255## (i2w i)) | 60 | toByte# i = w2i (and# 255## (i2w i)) | 36 | false | true | 0 | 9 | 12 | 35 | 17 | 18 | null | null |
factisresearch/HStringTemplate | Text/StringTemplate/GenericWithClass.hs | bsd-3-clause | toSElemProxy :: Proxy ToSElemD
toSElemProxy = error "This value should never be evaluated!" | 91 | toSElemProxy :: Proxy ToSElemD
toSElemProxy = error "This value should never be evaluated!" | 91 | toSElemProxy = error "This value should never be evaluated!" | 60 | false | true | 1 | 5 | 12 | 20 | 8 | 12 | null | null |
ice1000/Kt2Dart | src/Parsers.hs | agpl-3.0 | tokenLP :: Parser String -> Parser String
tokenLP = (newLines0P <++>) | 69 | tokenLP :: Parser String -> Parser String
tokenLP = (newLines0P <++>) | 69 | tokenLP = (newLines0P <++>) | 27 | false | true | 0 | 6 | 10 | 25 | 13 | 12 | null | null |
d-strickland/dailyprogrammer | haskell/src/DailyProgrammer/BankNumbers.hs | gpl-3.0 | nums = [[" _ ",
"| |",
"|_|"],
[" ",
" |",
" |"],
[" _ ",
" _|",
"|_ "],
[" _ ",
" _|",
" _|"],
[" ",
"|_|",
" |"],
[" _ ",
"|_ ",
" _|"],
[" _ ",
"|_ ",
"|_|"],
[" _ ",
" |",
" |"],
[" _ ",
"|_|",
"|_|"],
[" _ ",
"|_|",
" _|"]] | 498 | nums = [[" _ ",
"| |",
"|_|"],
[" ",
" |",
" |"],
[" _ ",
" _|",
"|_ "],
[" _ ",
" _|",
" _|"],
[" ",
"|_|",
" |"],
[" _ ",
"|_ ",
" _|"],
[" _ ",
"|_ ",
"|_|"],
[" _ ",
" |",
" |"],
[" _ ",
"|_|",
"|_|"],
[" _ ",
"|_|",
" _|"]] | 498 | nums = [[" _ ",
"| |",
"|_|"],
[" ",
" |",
" |"],
[" _ ",
" _|",
"|_ "],
[" _ ",
" _|",
" _|"],
[" ",
"|_|",
" |"],
[" _ ",
"|_ ",
" _|"],
[" _ ",
"|_ ",
"|_|"],
[" _ ",
" |",
" |"],
[" _ ",
"|_|",
"|_|"],
[" _ ",
"|_|",
" _|"]] | 498 | false | false | 0 | 6 | 333 | 126 | 83 | 43 | null | null |
NorfairKing/the-notes | src/Computability/RegularExpressions.hs | gpl-2.0 | languageOfRegularExpression :: Note
languageOfRegularExpression = de $ do
lab languageOfARegularExpressionDefinitionLabel
s [the, languageOfARegularExpression', " ", m lore, " is inductively defined as follows"]
hereFigure $ linedTable
[re_, lre re_]
[
[rees, estr]
, [ree, emptyset]
, ["a" <> text " with " <> "a" ∈ alph_, setof "a"]
, [e_ 1 <@@@> e_ 2, lre (e_ 1) <@@> lre (e_ 2)]
, [e_ 1 <@|@> e_ 2, lre (e_ 1) ∪ lre (e_ 2)]
, [rea e, ks (lre e)]
]
where
e = re_
e_ n = e !: n | 601 | languageOfRegularExpression :: Note
languageOfRegularExpression = de $ do
lab languageOfARegularExpressionDefinitionLabel
s [the, languageOfARegularExpression', " ", m lore, " is inductively defined as follows"]
hereFigure $ linedTable
[re_, lre re_]
[
[rees, estr]
, [ree, emptyset]
, ["a" <> text " with " <> "a" ∈ alph_, setof "a"]
, [e_ 1 <@@@> e_ 2, lre (e_ 1) <@@> lre (e_ 2)]
, [e_ 1 <@|@> e_ 2, lre (e_ 1) ∪ lre (e_ 2)]
, [rea e, ks (lre e)]
]
where
e = re_
e_ n = e !: n | 601 | languageOfRegularExpression = de $ do
lab languageOfARegularExpressionDefinitionLabel
s [the, languageOfARegularExpression', " ", m lore, " is inductively defined as follows"]
hereFigure $ linedTable
[re_, lre re_]
[
[rees, estr]
, [ree, emptyset]
, ["a" <> text " with " <> "a" ∈ alph_, setof "a"]
, [e_ 1 <@@@> e_ 2, lre (e_ 1) <@@> lre (e_ 2)]
, [e_ 1 <@|@> e_ 2, lre (e_ 1) ∪ lre (e_ 2)]
, [rea e, ks (lre e)]
]
where
e = re_
e_ n = e !: n | 565 | false | true | 0 | 15 | 212 | 234 | 120 | 114 | null | null |
wavewave/diagdrawer | lib/Application/DiagramDrawer/GUI.hs | bsd-2-clause | selectmod :: [RadioActionEntry]
selectmod = [ RadioActionEntry "SELECTA" "Select A" Nothing Nothing Nothing 0
, RadioActionEntry "SELECTB" "Select B" Nothing Nothing Nothing 1
] | 202 | selectmod :: [RadioActionEntry]
selectmod = [ RadioActionEntry "SELECTA" "Select A" Nothing Nothing Nothing 0
, RadioActionEntry "SELECTB" "Select B" Nothing Nothing Nothing 1
] | 202 | selectmod = [ RadioActionEntry "SELECTA" "Select A" Nothing Nothing Nothing 0
, RadioActionEntry "SELECTB" "Select B" Nothing Nothing Nothing 1
] | 170 | false | true | 0 | 6 | 48 | 46 | 24 | 22 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/UX/ACSS.hs | bsd-3-clause | renderTypAnnot (Just ann) s = printf "<a class=annot href=\"#\"><span class=annottext>%s</span>%s</a>" (escape ann) s | 117 | renderTypAnnot (Just ann) s = printf "<a class=annot href=\"#\"><span class=annottext>%s</span>%s</a>" (escape ann) s | 117 | renderTypAnnot (Just ann) s = printf "<a class=annot href=\"#\"><span class=annottext>%s</span>%s</a>" (escape ann) s | 117 | false | false | 0 | 7 | 12 | 30 | 14 | 16 | null | null |
kadena-io/pact | src-tool/Pact/Analyze/Types/Languages.hs | bsd-3-clause | eqCoreTm _ (ListLength ty1 a1) (ListLength ty2 a2)
= case singEq ty1 ty2 of
Nothing -> False
Just Refl -> singEqTmList ty1 a1 a2 | 150 | eqCoreTm _ (ListLength ty1 a1) (ListLength ty2 a2)
= case singEq ty1 ty2 of
Nothing -> False
Just Refl -> singEqTmList ty1 a1 a2 | 150 | eqCoreTm _ (ListLength ty1 a1) (ListLength ty2 a2)
= case singEq ty1 ty2 of
Nothing -> False
Just Refl -> singEqTmList ty1 a1 a2 | 150 | false | false | 2 | 8 | 45 | 65 | 28 | 37 | null | null |
spechub/Hets | OWL2/ShipSyntax.hs | gpl-2.0 | card :: CharParser st CardinalityType
card = choice $ map (\ a -> tryString (showCard a) >> return a)
[MinCardinality, MaxCardinality, ExactCardinality] | 159 | card :: CharParser st CardinalityType
card = choice $ map (\ a -> tryString (showCard a) >> return a)
[MinCardinality, MaxCardinality, ExactCardinality] | 159 | card = choice $ map (\ a -> tryString (showCard a) >> return a)
[MinCardinality, MaxCardinality, ExactCardinality] | 121 | false | true | 1 | 12 | 28 | 61 | 30 | 31 | null | null |
solidsnack/cassava | Data/Csv/Parser.hs | bsd-3-clause | -- | Parse a header name. Header names have the same format as regular
-- 'field's.
name :: Word8 -> AL.Parser Name
name !delim = field delim | 141 | name :: Word8 -> AL.Parser Name
name !delim = field delim | 57 | name !delim = field delim | 25 | true | true | 0 | 7 | 26 | 33 | 15 | 18 | null | null |
psibi/cabal2nix | src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs | bsd-3-clause | libNixName "libsystemd" = return "systemd" | 66 | libNixName "libsystemd" = return "systemd" | 66 | libNixName "libsystemd" = return "systemd" | 66 | false | false | 0 | 5 | 28 | 12 | 5 | 7 | null | null |
brendanhay/gogol | gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/Import.hs | mpl-2.0 | -- | JSONP
iiCallback :: Lens' InstancesImport (Maybe Text)
iiCallback
= lens _iiCallback (\ s a -> s{_iiCallback = a}) | 121 | iiCallback :: Lens' InstancesImport (Maybe Text)
iiCallback
= lens _iiCallback (\ s a -> s{_iiCallback = a}) | 110 | iiCallback
= lens _iiCallback (\ s a -> s{_iiCallback = a}) | 61 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
seagull-kamome/Voids | Control/Monad/Voids.hs | bsd-3-clause | void6 :: Functor m => (a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> m b) -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> m ()
void6 x = \a1 a2 a3 a4 a5 a6 -> fmap (const ()) (x a1 a2 a3 a4 a5 a6) | 177 | void6 :: Functor m => (a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> m b) -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> m ()
void6 x = \a1 a2 a3 a4 a5 a6 -> fmap (const ()) (x a1 a2 a3 a4 a5 a6) | 177 | void6 x = \a1 a2 a3 a4 a5 a6 -> fmap (const ()) (x a1 a2 a3 a4 a5 a6) | 69 | false | true | 0 | 14 | 53 | 131 | 64 | 67 | null | null |
izimbra/PLT2014 | Lab2/Interpreter.hs | gpl-2.0 | evalExp env (EIncr (EId id)) = case (evalVar env id) of
(VInt i) -> return (VInt (i+1) , setVar env id (VInt (i+1)))
(VDouble i) -> return (VDouble (i+1) , setVar env id (VDouble (i+1))) | 197 | evalExp env (EIncr (EId id)) = case (evalVar env id) of
(VInt i) -> return (VInt (i+1) , setVar env id (VInt (i+1)))
(VDouble i) -> return (VDouble (i+1) , setVar env id (VDouble (i+1))) | 197 | evalExp env (EIncr (EId id)) = case (evalVar env id) of
(VInt i) -> return (VInt (i+1) , setVar env id (VInt (i+1)))
(VDouble i) -> return (VDouble (i+1) , setVar env id (VDouble (i+1))) | 197 | false | false | 0 | 14 | 45 | 137 | 69 | 68 | null | null |
achirkin/ghcjs-webgl | src/JavaScript/WebGL/Const.hs | mit | gl_LINK_STATUS :: GLenum
gl_LINK_STATUS = 0x8B82 | 48 | gl_LINK_STATUS :: GLenum
gl_LINK_STATUS = 0x8B82 | 48 | gl_LINK_STATUS = 0x8B82 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
oden-lang/oden | src/Oden/Infer/Subsumption.hs | mit | collectSubstitutions (TTuple _ f1 s1 r1) (TTuple _ f2 s2 r2) = do
collectSubstitutions f1 f2
collectSubstitutions s1 s2
zipWithM_ collectSubstitutions r1 r2 | 162 | collectSubstitutions (TTuple _ f1 s1 r1) (TTuple _ f2 s2 r2) = do
collectSubstitutions f1 f2
collectSubstitutions s1 s2
zipWithM_ collectSubstitutions r1 r2 | 162 | collectSubstitutions (TTuple _ f1 s1 r1) (TTuple _ f2 s2 r2) = do
collectSubstitutions f1 f2
collectSubstitutions s1 s2
zipWithM_ collectSubstitutions r1 r2 | 162 | false | false | 0 | 7 | 28 | 61 | 27 | 34 | null | null |
jgalat0/bot | src/Check.hs | gpl-3.0 | checkExpr (Lower e1 e2) = checkExpr e1 >> checkExpr e2 | 54 | checkExpr (Lower e1 e2) = checkExpr e1 >> checkExpr e2 | 54 | checkExpr (Lower e1 e2) = checkExpr e1 >> checkExpr e2 | 54 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
NinjaTrappeur/DobadoBots | src/DobadoBots/Interpreter/Interpreter.hs | bsd-3-clause | testDistance (Inf token distTest) robot colCoord st = distTest < robotColliderDistance robot cmpCoord
where cmpCoord = case token of LaserDistance -> colCoord
ObjectiveDistance -> position $ objective st | 239 | testDistance (Inf token distTest) robot colCoord st = distTest < robotColliderDistance robot cmpCoord
where cmpCoord = case token of LaserDistance -> colCoord
ObjectiveDistance -> position $ objective st | 239 | testDistance (Inf token distTest) robot colCoord st = distTest < robotColliderDistance robot cmpCoord
where cmpCoord = case token of LaserDistance -> colCoord
ObjectiveDistance -> position $ objective st | 239 | false | false | 0 | 9 | 63 | 63 | 30 | 33 | null | null |
bredelings/BAli-Phy | haskell/Probability/Distribution/DirichletProcess.hs | gpl-2.0 | dpm n alpha sample_dist = lazy $ do
dists <- sequence $ repeat $ sample_dist
breaks <- sequence $ repeat $ beta 1.0 alpha
-- stick selects a distribution from the list, and join then samples from the distribution
iid n (join $ stick breaks dists) | 256 | dpm n alpha sample_dist = lazy $ do
dists <- sequence $ repeat $ sample_dist
breaks <- sequence $ repeat $ beta 1.0 alpha
-- stick selects a distribution from the list, and join then samples from the distribution
iid n (join $ stick breaks dists) | 256 | dpm n alpha sample_dist = lazy $ do
dists <- sequence $ repeat $ sample_dist
breaks <- sequence $ repeat $ beta 1.0 alpha
-- stick selects a distribution from the list, and join then samples from the distribution
iid n (join $ stick breaks dists) | 256 | false | false | 3 | 11 | 55 | 80 | 34 | 46 | null | null |
Icelandjack/lens | src/Control/Lens/Setter.hs | bsd-3-clause | -- | This is a generalization of 'pass' that alows you to modify just a
-- portion of the resulting 'MonadWriter'.
passing :: MonadWriter w m => Setter w w u v -> m (a, u -> v) -> m a
passing l m = pass $ do
(a, uv) <- m
return (a, over l uv)
| 247 | passing :: MonadWriter w m => Setter w w u v -> m (a, u -> v) -> m a
passing l m = pass $ do
(a, uv) <- m
return (a, over l uv)
| 132 | passing l m = pass $ do
(a, uv) <- m
return (a, over l uv)
| 63 | true | true | 0 | 10 | 61 | 94 | 47 | 47 | null | null |
pparkkin/eta | compiler/ETA/BasicTypes/Module.hs | bsd-3-clause | mkModule :: UnitId -> ModuleName -> Module
mkModule = Module | 60 | mkModule :: UnitId -> ModuleName -> Module
mkModule = Module | 60 | mkModule = Module | 17 | false | true | 0 | 8 | 9 | 26 | 11 | 15 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2020/M08/D10/Exercise.hs | mit | deleteMin :: Heap t -> Heap t
deleteMin head = undefined | 56 | deleteMin :: Heap t -> Heap t
deleteMin head = undefined | 56 | deleteMin head = undefined | 26 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
tphyahoo/haskoin | haskoin-wallet/Network/Haskoin/Wallet/KeyRing.hs | unlicense | computeNewFilter :: (MonadIO m, MonadThrow m, MonadBase IO m, MonadResource m)
=> SqlPersistT m ()
computeNewFilter = do
(_, _, fpRate) <- getBloomFilter
-- Create a new empty bloom filter
-- TODO: Choose a random nonce for the bloom filter
-- TODO: Check global bloom filter length limits
cntRes <- select $ from $ \x -> return $ count $ x ^. KeyRingAddrId
let elems = maybe 0 unValue $ listToMaybe cntRes
newBloom = bloomCreate (filterLen elems) fpRate 0 BloomUpdateNone
bloom <- addressSourceAll $$ bloomSink newBloom
setBloomFilter bloom elems
where
bloomSink bloom = await >>= \addrM -> case addrM of
Just addr -> bloomSink $ addToFilter bloom [addr]
_ -> return bloom
-- Compute the size of a filter given a number of elements. Scale
-- the filter length by powers of 2. | 864 | computeNewFilter :: (MonadIO m, MonadThrow m, MonadBase IO m, MonadResource m)
=> SqlPersistT m ()
computeNewFilter = do
(_, _, fpRate) <- getBloomFilter
-- Create a new empty bloom filter
-- TODO: Choose a random nonce for the bloom filter
-- TODO: Check global bloom filter length limits
cntRes <- select $ from $ \x -> return $ count $ x ^. KeyRingAddrId
let elems = maybe 0 unValue $ listToMaybe cntRes
newBloom = bloomCreate (filterLen elems) fpRate 0 BloomUpdateNone
bloom <- addressSourceAll $$ bloomSink newBloom
setBloomFilter bloom elems
where
bloomSink bloom = await >>= \addrM -> case addrM of
Just addr -> bloomSink $ addToFilter bloom [addr]
_ -> return bloom
-- Compute the size of a filter given a number of elements. Scale
-- the filter length by powers of 2. | 864 | computeNewFilter = do
(_, _, fpRate) <- getBloomFilter
-- Create a new empty bloom filter
-- TODO: Choose a random nonce for the bloom filter
-- TODO: Check global bloom filter length limits
cntRes <- select $ from $ \x -> return $ count $ x ^. KeyRingAddrId
let elems = maybe 0 unValue $ listToMaybe cntRes
newBloom = bloomCreate (filterLen elems) fpRate 0 BloomUpdateNone
bloom <- addressSourceAll $$ bloomSink newBloom
setBloomFilter bloom elems
where
bloomSink bloom = await >>= \addrM -> case addrM of
Just addr -> bloomSink $ addToFilter bloom [addr]
_ -> return bloom
-- Compute the size of a filter given a number of elements. Scale
-- the filter length by powers of 2. | 748 | false | true | 3 | 12 | 220 | 225 | 110 | 115 | null | null |
markus-git/PBKDF2 | src/Soft2.hs | bsd-3-clause | sha1_extend :: SArr (SExp Word8) -> Software (SIrr (SExp Word32))
sha1_extend pad =
do let len = length pad
blocks <- shareM (len `div` 64)
ipad :: SIrr (SExp Word8) <- unsafeFreezeArr pad
ex :: SArr (SExp Word32) <- newArr (80 * blocks)
-- truncate original block.
for (0) (blocks-1) $ (\(b :: SExp Word8) -> do
po <- shareM (b * 16)
bo <- shareM (b * 80)
for (0) (15) (\(i :: SExp Word8) ->
setArr ex (b+i)
( (i2n $ ipad ! (po+(i*4)))
+ (i2n $ ipad ! (po+(i*4)+1)) `shiftL` (8 :: SExp Word32)
+ (i2n $ ipad ! (po+(i*4)+2)) `shiftL` (16 :: SExp Word32)
+ (i2n $ ipad ! (po+(i*4)+3)) `shiftL` (24 :: SExp Word32)
)))
-- extend block with new words.
iex :: SIrr (SExp Word32) <- unsafeFreezeArr ex
for (0) (blocks-1) (\(b :: SExp Word8) -> do
bo <- shareM (b * 80)
for (bo+16) (bo+79) (\(i :: SExp Word8) ->
setArr ex i $ flip rotateL (1 :: SExp Word32)
( (iex ! (i-3))
`xor` (iex ! (i-8))
`xor` (iex ! (i-14))
`xor` (iex ! (i-16))
)))
unsafeFreezeArr ex
-- Translate a 160-bit block into an array of 20 8-bits. | 1,245 | sha1_extend :: SArr (SExp Word8) -> Software (SIrr (SExp Word32))
sha1_extend pad =
do let len = length pad
blocks <- shareM (len `div` 64)
ipad :: SIrr (SExp Word8) <- unsafeFreezeArr pad
ex :: SArr (SExp Word32) <- newArr (80 * blocks)
-- truncate original block.
for (0) (blocks-1) $ (\(b :: SExp Word8) -> do
po <- shareM (b * 16)
bo <- shareM (b * 80)
for (0) (15) (\(i :: SExp Word8) ->
setArr ex (b+i)
( (i2n $ ipad ! (po+(i*4)))
+ (i2n $ ipad ! (po+(i*4)+1)) `shiftL` (8 :: SExp Word32)
+ (i2n $ ipad ! (po+(i*4)+2)) `shiftL` (16 :: SExp Word32)
+ (i2n $ ipad ! (po+(i*4)+3)) `shiftL` (24 :: SExp Word32)
)))
-- extend block with new words.
iex :: SIrr (SExp Word32) <- unsafeFreezeArr ex
for (0) (blocks-1) (\(b :: SExp Word8) -> do
bo <- shareM (b * 80)
for (bo+16) (bo+79) (\(i :: SExp Word8) ->
setArr ex i $ flip rotateL (1 :: SExp Word32)
( (iex ! (i-3))
`xor` (iex ! (i-8))
`xor` (iex ! (i-14))
`xor` (iex ! (i-16))
)))
unsafeFreezeArr ex
-- Translate a 160-bit block into an array of 20 8-bits. | 1,245 | sha1_extend pad =
do let len = length pad
blocks <- shareM (len `div` 64)
ipad :: SIrr (SExp Word8) <- unsafeFreezeArr pad
ex :: SArr (SExp Word32) <- newArr (80 * blocks)
-- truncate original block.
for (0) (blocks-1) $ (\(b :: SExp Word8) -> do
po <- shareM (b * 16)
bo <- shareM (b * 80)
for (0) (15) (\(i :: SExp Word8) ->
setArr ex (b+i)
( (i2n $ ipad ! (po+(i*4)))
+ (i2n $ ipad ! (po+(i*4)+1)) `shiftL` (8 :: SExp Word32)
+ (i2n $ ipad ! (po+(i*4)+2)) `shiftL` (16 :: SExp Word32)
+ (i2n $ ipad ! (po+(i*4)+3)) `shiftL` (24 :: SExp Word32)
)))
-- extend block with new words.
iex :: SIrr (SExp Word32) <- unsafeFreezeArr ex
for (0) (blocks-1) (\(b :: SExp Word8) -> do
bo <- shareM (b * 80)
for (bo+16) (bo+79) (\(i :: SExp Word8) ->
setArr ex i $ flip rotateL (1 :: SExp Word32)
( (iex ! (i-3))
`xor` (iex ! (i-8))
`xor` (iex ! (i-14))
`xor` (iex ! (i-16))
)))
unsafeFreezeArr ex
-- Translate a 160-bit block into an array of 20 8-bits. | 1,179 | false | true | 0 | 29 | 431 | 651 | 341 | 310 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/NV/VertexProgram.hs | bsd-3-clause | gl_MAP2_VERTEX_ATTRIB4_4 :: GLenum
gl_MAP2_VERTEX_ATTRIB4_4 = 0x8674 | 68 | gl_MAP2_VERTEX_ATTRIB4_4 :: GLenum
gl_MAP2_VERTEX_ATTRIB4_4 = 0x8674 | 68 | gl_MAP2_VERTEX_ATTRIB4_4 = 0x8674 | 33 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
christiaanb/ghc | compiler/basicTypes/Id.hs | bsd-3-clause | idHasRules :: Id -> Bool
idHasRules id = not (isEmptySpecInfo (idSpecialisation id)) | 84 | idHasRules :: Id -> Bool
idHasRules id = not (isEmptySpecInfo (idSpecialisation id)) | 84 | idHasRules id = not (isEmptySpecInfo (idSpecialisation id)) | 59 | false | true | 0 | 9 | 11 | 39 | 17 | 22 | null | null |
ryantrinkle/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ WriteOffAddrOp_Word64 [] [a,o,i,v1,v2] = PrimInline [j| `a`.dv.setUint32(`o`+(`i`<<3), `v1`, true);
`a`.dv.setUint32(`o`+(`i`<<3)+4, `v2`, true);
|] | 294 | genPrim _ _ WriteOffAddrOp_Word64 [] [a,o,i,v1,v2] = PrimInline [j| `a`.dv.setUint32(`o`+(`i`<<3), `v1`, true);
`a`.dv.setUint32(`o`+(`i`<<3)+4, `v2`, true);
|] | 294 | genPrim _ _ WriteOffAddrOp_Word64 [] [a,o,i,v1,v2] = PrimInline [j| `a`.dv.setUint32(`o`+(`i`<<3), `v1`, true);
`a`.dv.setUint32(`o`+(`i`<<3)+4, `v2`, true);
|] | 294 | false | false | 3 | 6 | 149 | 42 | 24 | 18 | null | null |
RudolfVonKrugstein/hsVigraRF | test/Tests.hs | mit | multiDimCheckBoard :: RandomGen g => g -> Int -> Int -> (Features,Labels)
multiDimCheckBoard gen numSamples dims =
let features = genFeatures gen
labels = map label features
in (features, labels)
where
genInfFeatures gen = let (gen1,gen2) = split gen
in (genFeature gen1):(genInfFeatures gen2)
genFeatures = take numSamples . genInfFeatures
genInfFeature gen = let (i,nextGen) = randomR (-10000.0 :: Double,10000.0 :: Double) gen
in (i / 1000.0):(genInfFeature nextGen)
genFeature = take dims . genInfFeature
label :: [Double] -> Word
label = boolToUInt . xor . map (odd . floor)
xor :: [Bool] -> Bool
xor [] = False
xor (a:as) = if a then not (xor as) else (xor as)
boolToUInt a = if a then 1 else 0 | 780 | multiDimCheckBoard :: RandomGen g => g -> Int -> Int -> (Features,Labels)
multiDimCheckBoard gen numSamples dims =
let features = genFeatures gen
labels = map label features
in (features, labels)
where
genInfFeatures gen = let (gen1,gen2) = split gen
in (genFeature gen1):(genInfFeatures gen2)
genFeatures = take numSamples . genInfFeatures
genInfFeature gen = let (i,nextGen) = randomR (-10000.0 :: Double,10000.0 :: Double) gen
in (i / 1000.0):(genInfFeature nextGen)
genFeature = take dims . genInfFeature
label :: [Double] -> Word
label = boolToUInt . xor . map (odd . floor)
xor :: [Bool] -> Bool
xor [] = False
xor (a:as) = if a then not (xor as) else (xor as)
boolToUInt a = if a then 1 else 0 | 780 | multiDimCheckBoard gen numSamples dims =
let features = genFeatures gen
labels = map label features
in (features, labels)
where
genInfFeatures gen = let (gen1,gen2) = split gen
in (genFeature gen1):(genInfFeatures gen2)
genFeatures = take numSamples . genInfFeatures
genInfFeature gen = let (i,nextGen) = randomR (-10000.0 :: Double,10000.0 :: Double) gen
in (i / 1000.0):(genInfFeature nextGen)
genFeature = take dims . genInfFeature
label :: [Double] -> Word
label = boolToUInt . xor . map (odd . floor)
xor :: [Bool] -> Bool
xor [] = False
xor (a:as) = if a then not (xor as) else (xor as)
boolToUInt a = if a then 1 else 0 | 706 | false | true | 0 | 11 | 197 | 324 | 166 | 158 | null | null |
thewildweasel/todo-list | src/readtest.hs | gpl-3.0 | dispatch :: [(String, [[String]] -> [String] -> IO ())]
dispatch = [ ("add_to_list", add_to_list)
, ("add_doable", add_doable)
, ("add_doable_to_subsection", add_doable_to_subsection)
, ("do_item", do_item)
, ("undo_item", undo_item)
, ("add_to_subsection", add_to_subsection)
, ("rename_list", rename_list)
, ("view", view)
, ("delete_subsection", delete_subsection)
, ("delete_item", delete_item)
, ("delete_from_subsection", delete_from_subsection)
] | 594 | dispatch :: [(String, [[String]] -> [String] -> IO ())]
dispatch = [ ("add_to_list", add_to_list)
, ("add_doable", add_doable)
, ("add_doable_to_subsection", add_doable_to_subsection)
, ("do_item", do_item)
, ("undo_item", undo_item)
, ("add_to_subsection", add_to_subsection)
, ("rename_list", rename_list)
, ("view", view)
, ("delete_subsection", delete_subsection)
, ("delete_item", delete_item)
, ("delete_from_subsection", delete_from_subsection)
] | 592 | dispatch = [ ("add_to_list", add_to_list)
, ("add_doable", add_doable)
, ("add_doable_to_subsection", add_doable_to_subsection)
, ("do_item", do_item)
, ("undo_item", undo_item)
, ("add_to_subsection", add_to_subsection)
, ("rename_list", rename_list)
, ("view", view)
, ("delete_subsection", delete_subsection)
, ("delete_item", delete_item)
, ("delete_from_subsection", delete_from_subsection)
] | 536 | false | true | 0 | 10 | 185 | 141 | 90 | 51 | null | null |
HJvT/com | System/Win32/Com/Automation.hs | bsd-3-clause | writeSafeArray :: Ptr (SafeArray a) -> SafeArray a -> IO ()
writeSafeArray ptr (SA s) = writeSAFEARRAY (castPtr ptr) s | 118 | writeSafeArray :: Ptr (SafeArray a) -> SafeArray a -> IO ()
writeSafeArray ptr (SA s) = writeSAFEARRAY (castPtr ptr) s | 118 | writeSafeArray ptr (SA s) = writeSAFEARRAY (castPtr ptr) s | 58 | false | true | 0 | 8 | 19 | 58 | 27 | 31 | null | null |
kishoredbn/barrelfish | tools/flounder/BackendCommon.hs | mit | change_waitset_fn_type ifn = ifscope ifn "change_waitset_fn" | 60 | change_waitset_fn_type ifn = ifscope ifn "change_waitset_fn" | 60 | change_waitset_fn_type ifn = ifscope ifn "change_waitset_fn" | 60 | false | false | 1 | 5 | 5 | 17 | 6 | 11 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/Projects/TestIAMPermissions.hs | mpl-2.0 | -- | JSONP
ptipCallback :: Lens' ProjectsTestIAMPermissions (Maybe Text)
ptipCallback
= lens _ptipCallback (\ s a -> s{_ptipCallback = a}) | 140 | ptipCallback :: Lens' ProjectsTestIAMPermissions (Maybe Text)
ptipCallback
= lens _ptipCallback (\ s a -> s{_ptipCallback = a}) | 129 | ptipCallback
= lens _ptipCallback (\ s a -> s{_ptipCallback = a}) | 67 | true | true | 1 | 9 | 21 | 52 | 25 | 27 | null | null |
christiaanb/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | int64TyConKey = mkPreludeTyConUnique 21 | 65 | int64TyConKey = mkPreludeTyConUnique 21 | 65 | int64TyConKey = mkPreludeTyConUnique 21 | 65 | false | false | 0 | 5 | 29 | 9 | 4 | 5 | null | null |
sixears/getopt | src/Console/Getopt/ArgArity.hs | mit | liftAA (ArgN n) = AppE (ConE 'ArgN) (intE n) | 49 | liftAA (ArgN n) = AppE (ConE 'ArgN) (intE n) | 49 | liftAA (ArgN n) = AppE (ConE 'ArgN) (intE n) | 49 | false | false | 0 | 7 | 13 | 33 | 16 | 17 | null | null |
heathweiss/Tricad | src/Examples/Diffs/FirstDiff.hs | gpl-2.0 | -- F1 (Point 1 2 3)
{-
Using arrows and map and lense:
Create 2 pieces of the large shape and output then w/o errors.
The Faces are added as it is processed.
Note the use of <<< makes it backwards
-}
writeLargeShapeWithMapAndArrowsReversed = do
let
f = Kleisli (\triangles -> writeStlToFile $ newStlShape "largeShape" triangles)
--create faces for 135-360
<<< arr (\triangles ->
( [largeShapeWithDegrees]
L.||@~+++^||
[[FacesWithRange FacesBottomFrontTop (DegreeRange 135 360)]]
)
++ triangles
)
--right of gap triangle
<<< arr (\triangles -> (FacesBottomFrontRightTop +++^ (maybeMapResult (largeShapeMap^.at (DegreeRange 90 135)))) ++ triangles)
--left of gap cube
<<< arr (\(Just cube) -> FacesBottomFrontLeftTop +++^ cube)
<<< arr Just
runKleisli f (maybeMapResult $ largeShapeMap^.at (DegreeRange 0 45))
{-same as writeLargeShapeWithMapAndArrowsReverse except with >>>
The first call of arr Just: gets its params from the last line, as params to f.
Maybe get around this by passing in () to a lambda, and ignore it. -} | 1,263 | writeLargeShapeWithMapAndArrowsReversed = do
let
f = Kleisli (\triangles -> writeStlToFile $ newStlShape "largeShape" triangles)
--create faces for 135-360
<<< arr (\triangles ->
( [largeShapeWithDegrees]
L.||@~+++^||
[[FacesWithRange FacesBottomFrontTop (DegreeRange 135 360)]]
)
++ triangles
)
--right of gap triangle
<<< arr (\triangles -> (FacesBottomFrontRightTop +++^ (maybeMapResult (largeShapeMap^.at (DegreeRange 90 135)))) ++ triangles)
--left of gap cube
<<< arr (\(Just cube) -> FacesBottomFrontLeftTop +++^ cube)
<<< arr Just
runKleisli f (maybeMapResult $ largeShapeMap^.at (DegreeRange 0 45))
{-same as writeLargeShapeWithMapAndArrowsReverse except with >>>
The first call of arr Just: gets its params from the last line, as params to f.
Maybe get around this by passing in () to a lambda, and ignore it. -} | 1,062 | writeLargeShapeWithMapAndArrowsReversed = do
let
f = Kleisli (\triangles -> writeStlToFile $ newStlShape "largeShape" triangles)
--create faces for 135-360
<<< arr (\triangles ->
( [largeShapeWithDegrees]
L.||@~+++^||
[[FacesWithRange FacesBottomFrontTop (DegreeRange 135 360)]]
)
++ triangles
)
--right of gap triangle
<<< arr (\triangles -> (FacesBottomFrontRightTop +++^ (maybeMapResult (largeShapeMap^.at (DegreeRange 90 135)))) ++ triangles)
--left of gap cube
<<< arr (\(Just cube) -> FacesBottomFrontLeftTop +++^ cube)
<<< arr Just
runKleisli f (maybeMapResult $ largeShapeMap^.at (DegreeRange 0 45))
{-same as writeLargeShapeWithMapAndArrowsReverse except with >>>
The first call of arr Just: gets its params from the last line, as params to f.
Maybe get around this by passing in () to a lambda, and ignore it. -} | 1,062 | true | false | 1 | 26 | 394 | 207 | 106 | 101 | null | null |
rfranek/duckling | Duckling/Duration/Rules.hs | bsd-3-clause | rules :: [Rule]
rules =
[ ruleIntegerUnitofduration
] | 57 | rules :: [Rule]
rules =
[ ruleIntegerUnitofduration
] | 57 | rules =
[ ruleIntegerUnitofduration
] | 41 | false | true | 0 | 5 | 11 | 17 | 10 | 7 | null | null |
jonsterling/Luitzen | src/Environment.hs | bsd-3-clause | extendSourceLocation :: (MonadReader Env m, Disp t) => SourcePos -> t -> m a -> m a
extendSourceLocation p t =
local (\ e@(Env {sourceLocation = locs}) -> e {sourceLocation = SourceLocation p t : locs}) | 204 | extendSourceLocation :: (MonadReader Env m, Disp t) => SourcePos -> t -> m a -> m a
extendSourceLocation p t =
local (\ e@(Env {sourceLocation = locs}) -> e {sourceLocation = SourceLocation p t : locs}) | 204 | extendSourceLocation p t =
local (\ e@(Env {sourceLocation = locs}) -> e {sourceLocation = SourceLocation p t : locs}) | 120 | false | true | 0 | 11 | 37 | 94 | 49 | 45 | null | null |
jeffreyrosenbluth/stackage | Stackage/CompleteBuild.hs | mit | nightlyPlanFile :: Text -- ^ day
-> FilePath
nightlyPlanFile day = fpFromText ("nightly-" ++ day) <.> "yaml" | 124 | nightlyPlanFile :: Text -- ^ day
-> FilePath
nightlyPlanFile day = fpFromText ("nightly-" ++ day) <.> "yaml" | 124 | nightlyPlanFile day = fpFromText ("nightly-" ++ day) <.> "yaml" | 63 | false | true | 0 | 8 | 32 | 33 | 17 | 16 | null | null |
wz1000/haskell-webapps | ServantPersistent/src/Domain/Roles.hs | mit | dbGetRoleByName :: MonadIO m => Text -> TenantId -> TransactionT m (Maybe (Entity Role))
dbGetRoleByName name tid = getBy (UniqueRoleName name tid) | 147 | dbGetRoleByName :: MonadIO m => Text -> TenantId -> TransactionT m (Maybe (Entity Role))
dbGetRoleByName name tid = getBy (UniqueRoleName name tid) | 147 | dbGetRoleByName name tid = getBy (UniqueRoleName name tid) | 58 | false | true | 0 | 12 | 21 | 59 | 28 | 31 | null | null |
yuroyoro/stashh | src/Stashh/PullRequests/Merge.hs | bsd-3-clause | mapPullRequestMerge :: String -> String -> String -> PullRequestMergeCommand -> PullRequestMergeCommand
mapPullRequestMerge projectKey repositorySlug prId cmd = cmd { projectKey = projectKey, repositorySlug = repositorySlug , prId = prId } | 239 | mapPullRequestMerge :: String -> String -> String -> PullRequestMergeCommand -> PullRequestMergeCommand
mapPullRequestMerge projectKey repositorySlug prId cmd = cmd { projectKey = projectKey, repositorySlug = repositorySlug , prId = prId } | 239 | mapPullRequestMerge projectKey repositorySlug prId cmd = cmd { projectKey = projectKey, repositorySlug = repositorySlug , prId = prId } | 135 | false | true | 0 | 8 | 29 | 56 | 31 | 25 | null | null |
cheme/nanomsg-hs | test/main.hs | mit | main :: IO ()
main = do
tests stdArgs{maxSuccess=50} [
("Send/Receive", property $ prop_send_receive Req Rep)
, ("Get/SetOptions", property $ prop_set_get_options)
]
testNnSocket >>= runTestTT
testNnClose >>= runTestTT
testNnOptions >>= runTestTT
testNnBindConnect >>= runTestTT
testNnSendReceiveStatic >>= runTestTT
testNnSendReceiveDyn >>= runTestTT
testNnCmsg >>= runTestTT
testNnSendReceiveMsg >>= runTestTT
testNnSendReceiveMsgHdr >>= runTestTT
return () | 495 | main :: IO ()
main = do
tests stdArgs{maxSuccess=50} [
("Send/Receive", property $ prop_send_receive Req Rep)
, ("Get/SetOptions", property $ prop_set_get_options)
]
testNnSocket >>= runTestTT
testNnClose >>= runTestTT
testNnOptions >>= runTestTT
testNnBindConnect >>= runTestTT
testNnSendReceiveStatic >>= runTestTT
testNnSendReceiveDyn >>= runTestTT
testNnCmsg >>= runTestTT
testNnSendReceiveMsg >>= runTestTT
testNnSendReceiveMsgHdr >>= runTestTT
return () | 495 | main = do
tests stdArgs{maxSuccess=50} [
("Send/Receive", property $ prop_send_receive Req Rep)
, ("Get/SetOptions", property $ prop_set_get_options)
]
testNnSocket >>= runTestTT
testNnClose >>= runTestTT
testNnOptions >>= runTestTT
testNnBindConnect >>= runTestTT
testNnSendReceiveStatic >>= runTestTT
testNnSendReceiveDyn >>= runTestTT
testNnCmsg >>= runTestTT
testNnSendReceiveMsg >>= runTestTT
testNnSendReceiveMsgHdr >>= runTestTT
return () | 481 | false | true | 0 | 11 | 86 | 134 | 64 | 70 | null | null |
peterokagey/haskellOEIS | src/Helpers/Subsets.hs | apache-2.0 | choose _ [] = [] | 16 | choose _ [] = [] | 16 | choose _ [] = [] | 16 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | plus_RDR = varQual_RDR gHC_NUM (fsLit "+") | 57 | plus_RDR = varQual_RDR gHC_NUM (fsLit "+") | 57 | plus_RDR = varQual_RDR gHC_NUM (fsLit "+") | 57 | false | false | 0 | 7 | 20 | 17 | 8 | 9 | null | null |
MichielDerhaeg/stack | src/Stack/Setup/Installed.hs | bsd-3-clause | toolNameString :: Tool -> String
toolNameString (Tool ident) = packageNameString $ packageIdentifierName ident | 110 | toolNameString :: Tool -> String
toolNameString (Tool ident) = packageNameString $ packageIdentifierName ident | 110 | toolNameString (Tool ident) = packageNameString $ packageIdentifierName ident | 77 | false | true | 0 | 6 | 12 | 35 | 16 | 19 | null | null |
slpopejoy/fadno-xml | src/Fadno/Xml/EmitXml.hs | bsd-2-clause | renderString (XContent XEmpty [] els) = concatMap renderString els | 66 | renderString (XContent XEmpty [] els) = concatMap renderString els | 66 | renderString (XContent XEmpty [] els) = concatMap renderString els | 66 | false | false | 0 | 7 | 8 | 27 | 12 | 15 | null | null |
ekmett/ghc | compiler/codeGen/StgCmmClosure.hs | bsd-3-clause | getTyDescription :: Type -> String
getTyDescription ty
= case (tcSplitSigmaTy ty) of { (_, _, tau_ty) ->
case tau_ty of
TyVarTy _ -> "*"
AppTy fun _ -> getTyDescription fun
FunTy _ res -> '-' : '>' : fun_result res
TyConApp tycon _ -> getOccString tycon
ForAllTy _ ty -> getTyDescription ty
LitTy n -> getTyLitDescription n
}
where
fun_result (FunTy _ res) = '>' : fun_result res
fun_result other = getTyDescription other | 589 | getTyDescription :: Type -> String
getTyDescription ty
= case (tcSplitSigmaTy ty) of { (_, _, tau_ty) ->
case tau_ty of
TyVarTy _ -> "*"
AppTy fun _ -> getTyDescription fun
FunTy _ res -> '-' : '>' : fun_result res
TyConApp tycon _ -> getOccString tycon
ForAllTy _ ty -> getTyDescription ty
LitTy n -> getTyLitDescription n
}
where
fun_result (FunTy _ res) = '>' : fun_result res
fun_result other = getTyDescription other | 589 | getTyDescription ty
= case (tcSplitSigmaTy ty) of { (_, _, tau_ty) ->
case tau_ty of
TyVarTy _ -> "*"
AppTy fun _ -> getTyDescription fun
FunTy _ res -> '-' : '>' : fun_result res
TyConApp tycon _ -> getOccString tycon
ForAllTy _ ty -> getTyDescription ty
LitTy n -> getTyLitDescription n
}
where
fun_result (FunTy _ res) = '>' : fun_result res
fun_result other = getTyDescription other | 554 | false | true | 0 | 12 | 240 | 171 | 81 | 90 | null | null |
brendanhay/gogol | gogol-cloudiot/gen/Network/Google/Resource/CloudIOT/Projects/Locations/Registries/Devices/Create.hs | mpl-2.0 | -- | V1 error format.
plrdcXgafv :: Lens' ProjectsLocationsRegistriesDevicesCreate (Maybe Xgafv)
plrdcXgafv
= lens _plrdcXgafv (\ s a -> s{_plrdcXgafv = a}) | 158 | plrdcXgafv :: Lens' ProjectsLocationsRegistriesDevicesCreate (Maybe Xgafv)
plrdcXgafv
= lens _plrdcXgafv (\ s a -> s{_plrdcXgafv = a}) | 136 | plrdcXgafv
= lens _plrdcXgafv (\ s a -> s{_plrdcXgafv = a}) | 61 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
psg-titech/cfrp | src/Language/CFrp/Syntax.hs | mit | exprTag (AbsE _ _ t) = t | 24 | exprTag (AbsE _ _ t) = t | 24 | exprTag (AbsE _ _ t) = t | 24 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
alexbiehl/protocol-buffers | hprotoc/Text/ProtocolBuffers/ProtoCompile/Gen.hs | apache-2.0 | noWhere :: Binds
noWhere = BDecls [] | 36 | noWhere :: Binds
noWhere = BDecls [] | 36 | noWhere = BDecls [] | 19 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
sol/json-fu | src/Data/JSON.hs | mit | parseJSON :: ByteString -> Maybe Value
parseJSON = maybeResult . parse json' | 76 | parseJSON :: ByteString -> Maybe Value
parseJSON = maybeResult . parse json' | 76 | parseJSON = maybeResult . parse json' | 37 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
ambiata/mafia | test/Test/IO/Mafia/Chaos.hs | bsd-3-clause | recursiveSubmodules :: Repo -> PackageDeps -> Set SubmoduleName
recursiveSubmodules repo@(Repo _ os) (PackageDeps ss ls) =
let lookup name = fromMaybe Set.empty (recursiveSubmodules repo <$> Map.lookup name os) in
Set.union (unionMap lookup ls) ss | 251 | recursiveSubmodules :: Repo -> PackageDeps -> Set SubmoduleName
recursiveSubmodules repo@(Repo _ os) (PackageDeps ss ls) =
let lookup name = fromMaybe Set.empty (recursiveSubmodules repo <$> Map.lookup name os) in
Set.union (unionMap lookup ls) ss | 251 | recursiveSubmodules repo@(Repo _ os) (PackageDeps ss ls) =
let lookup name = fromMaybe Set.empty (recursiveSubmodules repo <$> Map.lookup name os) in
Set.union (unionMap lookup ls) ss | 187 | false | true | 0 | 13 | 37 | 99 | 47 | 52 | null | null |
claudio-mattera/pandoc-tikz | app/Main.hs | mit | _PROGRAM_VERSION = "0.1.0.0" | 28 | _PROGRAM_VERSION = "0.1.0.0" | 28 | _PROGRAM_VERSION = "0.1.0.0" | 28 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
christiaanb/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | -----------------------
ppr_lcmd :: OutputableBndr id => LHsCmd id -> SDoc
ppr_lcmd c = ppr_cmd (unLoc c) | 105 | ppr_lcmd :: OutputableBndr id => LHsCmd id -> SDoc
ppr_lcmd c = ppr_cmd (unLoc c) | 81 | ppr_lcmd c = ppr_cmd (unLoc c) | 30 | true | true | 0 | 8 | 15 | 44 | 19 | 25 | null | null |
green-haskell/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprExp _ (RecUpdE e fs) = pprExp appPrec e <> braces (pprFields fs) | 67 | pprExp _ (RecUpdE e fs) = pprExp appPrec e <> braces (pprFields fs) | 67 | pprExp _ (RecUpdE e fs) = pprExp appPrec e <> braces (pprFields fs) | 67 | false | false | 0 | 8 | 12 | 37 | 17 | 20 | null | null |
rueshyna/gogol | gogol-cloudmonitoring/gen/Network/Google/CloudMonitoring/Types/Product.hs | mpl-2.0 | -- | Provide time series specific labels and the data points for each time
-- series. The labels in timeseries and the common_labels should form a
-- complete list of labels that required by the metric.
wtrTimeseries :: Lens' WriteTimeseriesRequest [TimeseriesPoint]
wtrTimeseries
= lens _wtrTimeseries
(\ s a -> s{_wtrTimeseries = a})
. _Default
. _Coerce | 376 | wtrTimeseries :: Lens' WriteTimeseriesRequest [TimeseriesPoint]
wtrTimeseries
= lens _wtrTimeseries
(\ s a -> s{_wtrTimeseries = a})
. _Default
. _Coerce | 173 | wtrTimeseries
= lens _wtrTimeseries
(\ s a -> s{_wtrTimeseries = a})
. _Default
. _Coerce | 109 | true | true | 0 | 11 | 75 | 55 | 30 | 25 | null | null |
hvr/containers | Data/Map/Base.hs | bsd-3-clause | -- | /O(n)/. Fold the values in the map using the given left-associative
-- binary operator, such that @'foldl' f z == 'Prelude.foldl' f z . 'elems'@.
--
-- For example,
--
-- > elems = reverse . foldl (flip (:)) []
--
-- > let f len a = len + (length a)
-- > foldl f 0 (fromList [(5,"a"), (3,"bbb")]) == 4
foldl :: (a -> b -> a) -> a -> Map k b -> a
foldl f z = go z
where
go z' Tip = z'
go z' (Bin _ _ x l r) = go (f (go z' l) x) r
| 456 | foldl :: (a -> b -> a) -> a -> Map k b -> a
foldl f z = go z
where
go z' Tip = z'
go z' (Bin _ _ x l r) = go (f (go z' l) x) r
| 149 | foldl f z = go z
where
go z' Tip = z'
go z' (Bin _ _ x l r) = go (f (go z' l) x) r
| 105 | true | true | 1 | 9 | 129 | 126 | 61 | 65 | null | null |
Ferdinand-vW/Wlp-verification-engine | src/Transformer.hs | gpl-3.0 | nameOf :: Var -> String
nameOf (Int s) = s | 42 | nameOf :: Var -> String
nameOf (Int s) = s | 42 | nameOf (Int s) = s | 18 | false | true | 0 | 9 | 9 | 30 | 13 | 17 | null | null |
jetho/syncthing-hs | Network/Syncthing/Post.hs | bsd-3-clause | -- | Update the ignores list and echo it back as response.
ignores :: MonadSync m => FolderName -> [Text] -> SyncM m (Maybe [Text])
ignores folder ignoresList =
getIgnores <$> query postRequest { path = "/rest/db/ignores"
, method = post ignoresMap
, params = [("folder", folder)]
}
where
ignoresMap :: Map.Map Text [Text]
ignoresMap = Map.singleton "ignore" ignoresList
-- | Request rescan of a folder. Restrict the scan to a relative subpath
-- within the folder by specifying the optional path parameter. The
-- optional int argument delays Syncthing's automated rescan interval for a
-- given amount of seconds. | 744 | ignores :: MonadSync m => FolderName -> [Text] -> SyncM m (Maybe [Text])
ignores folder ignoresList =
getIgnores <$> query postRequest { path = "/rest/db/ignores"
, method = post ignoresMap
, params = [("folder", folder)]
}
where
ignoresMap :: Map.Map Text [Text]
ignoresMap = Map.singleton "ignore" ignoresList
-- | Request rescan of a folder. Restrict the scan to a relative subpath
-- within the folder by specifying the optional path parameter. The
-- optional int argument delays Syncthing's automated rescan interval for a
-- given amount of seconds. | 685 | ignores folder ignoresList =
getIgnores <$> query postRequest { path = "/rest/db/ignores"
, method = post ignoresMap
, params = [("folder", folder)]
}
where
ignoresMap :: Map.Map Text [Text]
ignoresMap = Map.singleton "ignore" ignoresList
-- | Request rescan of a folder. Restrict the scan to a relative subpath
-- within the folder by specifying the optional path parameter. The
-- optional int argument delays Syncthing's automated rescan interval for a
-- given amount of seconds. | 612 | true | true | 1 | 11 | 228 | 122 | 67 | 55 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 338675 = 5634 | 33 | getValueFromProduct 338675 = 5634 | 33 | getValueFromProduct 338675 = 5634 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
droundy/deft | src/haskell/CodeGen.hs | gpl-2.0 | generateHeader :: Expression RealSpace -> [String] -> String -> String
generateHeader e arg n = "// -*- mode: C++; -*-\n\n#include \"MinimalFunctionals.h\"\n#include \"utilities.h\"\n#include \"handymath.h\"\n#include \"Faddeeva.hh\"\n\n" ++
classCode e arg (n ++ "_type") ++
"\n\nFunctional " ++ n ++"(" ++ codeA arg ++ ") {\n\treturn Functional(new " ++ n ++ "_type(" ++ codeA' arg ++ "), \"" ++ n ++ "\");\n}\n"
where codeA [] = ""
codeA a = foldl1 (\x y -> x ++ ", " ++ y ) (map ("double " ++) a)
codeA' [] = ""
codeA' a = foldl1 (\x y -> x ++ ", " ++ y ) a | 637 | generateHeader :: Expression RealSpace -> [String] -> String -> String
generateHeader e arg n = "// -*- mode: C++; -*-\n\n#include \"MinimalFunctionals.h\"\n#include \"utilities.h\"\n#include \"handymath.h\"\n#include \"Faddeeva.hh\"\n\n" ++
classCode e arg (n ++ "_type") ++
"\n\nFunctional " ++ n ++"(" ++ codeA arg ++ ") {\n\treturn Functional(new " ++ n ++ "_type(" ++ codeA' arg ++ "), \"" ++ n ++ "\");\n}\n"
where codeA [] = ""
codeA a = foldl1 (\x y -> x ++ ", " ++ y ) (map ("double " ++) a)
codeA' [] = ""
codeA' a = foldl1 (\x y -> x ++ ", " ++ y ) a | 637 | generateHeader e arg n = "// -*- mode: C++; -*-\n\n#include \"MinimalFunctionals.h\"\n#include \"utilities.h\"\n#include \"handymath.h\"\n#include \"Faddeeva.hh\"\n\n" ++
classCode e arg (n ++ "_type") ++
"\n\nFunctional " ++ n ++"(" ++ codeA arg ++ ") {\n\treturn Functional(new " ++ n ++ "_type(" ++ codeA' arg ++ "), \"" ++ n ++ "\");\n}\n"
where codeA [] = ""
codeA a = foldl1 (\x y -> x ++ ", " ++ y ) (map ("double " ++) a)
codeA' [] = ""
codeA' a = foldl1 (\x y -> x ++ ", " ++ y ) a | 566 | false | true | 3 | 19 | 177 | 199 | 101 | 98 | null | null |
pbl64k/Net.Gearman.Worker | gearman.hs | bsd-2-clause | accSecond = Accessor snd second | 31 | accSecond = Accessor snd second | 31 | accSecond = Accessor snd second | 31 | false | false | 1 | 5 | 4 | 14 | 5 | 9 | null | null |
databrary/databrary | src/Model/RecordSlot/SQL.hs | agpl-3.0 | selectSlotRecord :: TH.Name -- ^ @'Identity'@
-> Selector -- ^ @'RecordSlot'@
selectSlotRecord ident = selectJoin '($)
[ selectVolumeSlotRecord
, joinOn "record.volume = volume.id"
$ selectVolume ident
] | 215 | selectSlotRecord :: TH.Name -- ^ @'Identity'@
-> Selector
selectSlotRecord ident = selectJoin '($)
[ selectVolumeSlotRecord
, joinOn "record.volume = volume.id"
$ selectVolume ident
] | 195 | selectSlotRecord ident = selectJoin '($)
[ selectVolumeSlotRecord
, joinOn "record.volume = volume.id"
$ selectVolume ident
] | 135 | true | true | 0 | 8 | 38 | 53 | 26 | 27 | null | null |
vikraman/ghc | compiler/codeGen/StgCmmEnv.hs | bsd-3-clause | litIdInfo :: DynFlags -> Id -> LambdaFormInfo -> CmmLit -> CgIdInfo
litIdInfo dflags id lf lit
= CgIdInfo { cg_id = id, cg_lf = lf
, cg_loc = CmmLoc (addDynTag dflags (CmmLit lit) tag) }
where
tag = lfDynTag dflags lf | 238 | litIdInfo :: DynFlags -> Id -> LambdaFormInfo -> CmmLit -> CgIdInfo
litIdInfo dflags id lf lit
= CgIdInfo { cg_id = id, cg_lf = lf
, cg_loc = CmmLoc (addDynTag dflags (CmmLit lit) tag) }
where
tag = lfDynTag dflags lf | 238 | litIdInfo dflags id lf lit
= CgIdInfo { cg_id = id, cg_lf = lf
, cg_loc = CmmLoc (addDynTag dflags (CmmLit lit) tag) }
where
tag = lfDynTag dflags lf | 170 | false | true | 1 | 11 | 61 | 95 | 47 | 48 | null | null |
scslab/hails | tests/DatabaseTests.hs | mit | test_basic_labeled_insert_with_pl :: Property
test_basic_labeled_insert_with_pl = monadicDC $ do
doc0 <- (removePolicyLabeled . clean) `liftM` pick arbitrary
let s = "A" :: String
l = (%%) (s \/ testPM2Principal) cTrue
plv <- pick arbitrary
pl <- run $ label l (plv :: BsonValue)
let doc = merge ["s" -: s, "pl" -: pl] doc0
ldoc <- run $ label l doc
_id <- run $ withTestPM2 $ const $ insert "simple_pl" ldoc
mdoc <- run $ withTestPM2 $ const $ findOne (select ["_id" -: _id] "simple_pl")
Q.assert $ isJust mdoc
let doc' = unlabelTCB $ fromJust mdoc
doc'' = merge ["_id" -: _id] doc
Q.assert $ (sortDoc . exclude ["pl"] $ doc') ==
(sortDoc . exclude ["pl"] $ doc'')
let ~mlv@(Just lv) = getPolicyLabeled $ "pl" `at` doc'
Q.assert $ isJust mlv && unlabelTCB lv == plv
-- | Test labeled insert in all-public collection | 870 | test_basic_labeled_insert_with_pl :: Property
test_basic_labeled_insert_with_pl = monadicDC $ do
doc0 <- (removePolicyLabeled . clean) `liftM` pick arbitrary
let s = "A" :: String
l = (%%) (s \/ testPM2Principal) cTrue
plv <- pick arbitrary
pl <- run $ label l (plv :: BsonValue)
let doc = merge ["s" -: s, "pl" -: pl] doc0
ldoc <- run $ label l doc
_id <- run $ withTestPM2 $ const $ insert "simple_pl" ldoc
mdoc <- run $ withTestPM2 $ const $ findOne (select ["_id" -: _id] "simple_pl")
Q.assert $ isJust mdoc
let doc' = unlabelTCB $ fromJust mdoc
doc'' = merge ["_id" -: _id] doc
Q.assert $ (sortDoc . exclude ["pl"] $ doc') ==
(sortDoc . exclude ["pl"] $ doc'')
let ~mlv@(Just lv) = getPolicyLabeled $ "pl" `at` doc'
Q.assert $ isJust mlv && unlabelTCB lv == plv
-- | Test labeled insert in all-public collection | 870 | test_basic_labeled_insert_with_pl = monadicDC $ do
doc0 <- (removePolicyLabeled . clean) `liftM` pick arbitrary
let s = "A" :: String
l = (%%) (s \/ testPM2Principal) cTrue
plv <- pick arbitrary
pl <- run $ label l (plv :: BsonValue)
let doc = merge ["s" -: s, "pl" -: pl] doc0
ldoc <- run $ label l doc
_id <- run $ withTestPM2 $ const $ insert "simple_pl" ldoc
mdoc <- run $ withTestPM2 $ const $ findOne (select ["_id" -: _id] "simple_pl")
Q.assert $ isJust mdoc
let doc' = unlabelTCB $ fromJust mdoc
doc'' = merge ["_id" -: _id] doc
Q.assert $ (sortDoc . exclude ["pl"] $ doc') ==
(sortDoc . exclude ["pl"] $ doc'')
let ~mlv@(Just lv) = getPolicyLabeled $ "pl" `at` doc'
Q.assert $ isJust mlv && unlabelTCB lv == plv
-- | Test labeled insert in all-public collection | 824 | false | true | 0 | 14 | 197 | 352 | 173 | 179 | null | null |
alanz/Blobs | src/Graphics/Blobs/Common.hs | lgpl-2.1 | -- Compute the average of a list of fractionals, with average [] equal to 0.
average :: Fractional a => [a] -> a
average [] = 0 | 127 | average :: Fractional a => [a] -> a
average [] = 0 | 50 | average [] = 0 | 14 | true | true | 0 | 7 | 26 | 31 | 16 | 15 | null | null |
copton/ocram | ocram/src/Ocram/Analysis/CallGraph.hs | gpl-2.0 | blocking_functions :: CallGraph -> BlockingFunctions -- {{{1
blocking_functions = functionsWith (any attrBlocking) | 114 | blocking_functions :: CallGraph -> BlockingFunctions
blocking_functions = functionsWith (any attrBlocking) | 106 | blocking_functions = functionsWith (any attrBlocking) | 53 | true | true | 0 | 7 | 11 | 32 | 14 | 18 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo IndexOffAddrOp_WideChar = mkGenPrimOp (fsLit "indexWideCharOffAddr#") [] [addrPrimTy, intPrimTy] (charPrimTy) | 121 | primOpInfo IndexOffAddrOp_WideChar = mkGenPrimOp (fsLit "indexWideCharOffAddr#") [] [addrPrimTy, intPrimTy] (charPrimTy) | 121 | primOpInfo IndexOffAddrOp_WideChar = mkGenPrimOp (fsLit "indexWideCharOffAddr#") [] [addrPrimTy, intPrimTy] (charPrimTy) | 121 | false | false | 0 | 7 | 10 | 35 | 18 | 17 | null | null |
br0ns/hindsight | src/Data/BTree/HashTable/STM.hs | gpl-3.0 | size :: HashTableSTM k v -> STM Int
size h = readTVar c
where
c = count h
-- | /O(n)/. Get a list of key/value pairs. | 125 | size :: HashTableSTM k v -> STM Int
size h = readTVar c
where
c = count h
-- | /O(n)/. Get a list of key/value pairs. | 125 | size h = readTVar c
where
c = count h
-- | /O(n)/. Get a list of key/value pairs. | 89 | false | true | 0 | 6 | 34 | 41 | 19 | 22 | null | null |
danplubell/CTG1371 | library/Data/CTG1371/Internal/Parser/Parsers.hs | mit | -- | Unpack the tocography mode
unpackTocoMode :: Word8 -> TOCOMode
unpackTocoMode tocodata = case tocodata of
0 -> NoTOCOTransducer
8 -> ExternalTOCO
10 -> IUP
14 -> UnknownTOCOMode
_ -> NullTOCOMode
-- | translate a numeric heart rate mode into the symbolic heart rate mode | 415 | unpackTocoMode :: Word8 -> TOCOMode
unpackTocoMode tocodata = case tocodata of
0 -> NoTOCOTransducer
8 -> ExternalTOCO
10 -> IUP
14 -> UnknownTOCOMode
_ -> NullTOCOMode
-- | translate a numeric heart rate mode into the symbolic heart rate mode | 383 | unpackTocoMode tocodata = case tocodata of
0 -> NoTOCOTransducer
8 -> ExternalTOCO
10 -> IUP
14 -> UnknownTOCOMode
_ -> NullTOCOMode
-- | translate a numeric heart rate mode into the symbolic heart rate mode | 347 | true | true | 0 | 8 | 185 | 58 | 29 | 29 | null | null |
hanshoglund/average | src/Data/Monoid/Average.hs | bsd-3-clause | average :: Fractional a => Average a -> a
average = fromMaybe 0 . maybeAverage | 78 | average :: Fractional a => Average a -> a
average = fromMaybe 0 . maybeAverage | 78 | average = fromMaybe 0 . maybeAverage | 36 | false | true | 1 | 8 | 14 | 40 | 16 | 24 | null | null |
gencer/bond | compiler/IO.hs | mit | combinedMessage :: (ParseError Char Void) -> String
combinedMessage err = id $ T.unpack $ T.intercalate (T.pack ", ") messages
where
-- parseErrorPretty returns a multi-line String.
-- We need to break it up to make a useful one-line message.
messages = T.splitOn (T.pack "\n") $ T.strip $ T.pack $ parseErrorTextPretty err | 351 | combinedMessage :: (ParseError Char Void) -> String
combinedMessage err = id $ T.unpack $ T.intercalate (T.pack ", ") messages
where
-- parseErrorPretty returns a multi-line String.
-- We need to break it up to make a useful one-line message.
messages = T.splitOn (T.pack "\n") $ T.strip $ T.pack $ parseErrorTextPretty err | 351 | combinedMessage err = id $ T.unpack $ T.intercalate (T.pack ", ") messages
where
-- parseErrorPretty returns a multi-line String.
-- We need to break it up to make a useful one-line message.
messages = T.splitOn (T.pack "\n") $ T.strip $ T.pack $ parseErrorTextPretty err | 299 | false | true | 3 | 10 | 78 | 102 | 47 | 55 | null | null |
anttisalonen/economics | src/Production.hs | mit | cobbDouglasCostDerivedExponent a b =
((1 / (a + b)) - 1) | 58 | cobbDouglasCostDerivedExponent a b =
((1 / (a + b)) - 1) | 58 | cobbDouglasCostDerivedExponent a b =
((1 / (a + b)) - 1) | 58 | false | false | 1 | 11 | 12 | 37 | 17 | 20 | null | null |
bcoppens/HaskellSshClient | src/Ssh/Transport.hs | gpl-3.0 | client2server = transport . clientState | 39 | client2server = transport . clientState | 39 | client2server = transport . clientState | 39 | false | false | 2 | 5 | 4 | 15 | 5 | 10 | null | null |
shlevy/ghc | compiler/simplStg/RepType.hs | bsd-3-clause | primRepSlot VecRep{} = pprPanic "primRepSlot" (text "No slot for VecRep") | 76 | primRepSlot VecRep{} = pprPanic "primRepSlot" (text "No slot for VecRep") | 76 | primRepSlot VecRep{} = pprPanic "primRepSlot" (text "No slot for VecRep") | 76 | false | false | 0 | 7 | 12 | 24 | 11 | 13 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | prop_a16= isOk readArithmeticContents "$foo$bar" | 48 | prop_a16= isOk readArithmeticContents "$foo$bar" | 48 | prop_a16= isOk readArithmeticContents "$foo$bar" | 48 | false | false | 1 | 5 | 3 | 16 | 5 | 11 | null | null |
Megaleo/Electras | src/Tile.hs | bsd-3-clause | zipTile [] _ = [] | 32 | zipTile [] _ = [] | 32 | zipTile [] _ = [] | 32 | false | false | 1 | 6 | 19 | 18 | 7 | 11 | null | null |
bravit/Idris-dev | src/Idris/Core/Evaluate.hs | bsd-3-clause | wknV i (VBind red n b sc) = do b' <- fmapMB (wknV i) b
return $ VBind red n b' (\x -> do x' <- sc x
wknV (i + 1) x') | 212 | wknV i (VBind red n b sc) = do b' <- fmapMB (wknV i) b
return $ VBind red n b' (\x -> do x' <- sc x
wknV (i + 1) x') | 212 | wknV i (VBind red n b sc) = do b' <- fmapMB (wknV i) b
return $ VBind red n b' (\x -> do x' <- sc x
wknV (i + 1) x') | 212 | false | false | 0 | 15 | 128 | 90 | 42 | 48 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_MMIXAL_STRING :: Int
wxSTC_MMIXAL_STRING = 12 | 51 | wxSTC_MMIXAL_STRING :: Int
wxSTC_MMIXAL_STRING = 12 | 51 | wxSTC_MMIXAL_STRING = 12 | 24 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
andreasabel/helf | src/OperatorPrecedenceParser.hs | mit | shift (Op Infix{} _) [] = throwError LeadingInfix | 72 | shift (Op Infix{} _) [] = throwError LeadingInfix | 72 | shift (Op Infix{} _) [] = throwError LeadingInfix | 72 | false | false | 0 | 8 | 30 | 31 | 14 | 17 | null | null |
Paczesiowa/hsenv | src/Process.hs | bsd-3-clause | insideProcess :: String -> [String] -> Maybe String -> Hsenv String
insideProcess = insideProcess' False | 104 | insideProcess :: String -> [String] -> Maybe String -> Hsenv String
insideProcess = insideProcess' False | 104 | insideProcess = insideProcess' False | 36 | false | true | 0 | 8 | 14 | 35 | 17 | 18 | null | null |
crockeo/whatisthisgame | src/WhatIsThisGame/Input.hs | mit | keyDown :: Enum k => k -> SignalGen p (Signal Bool)
keyDown = effectful . ioKeyDown | 83 | keyDown :: Enum k => k -> SignalGen p (Signal Bool)
keyDown = effectful . ioKeyDown | 83 | keyDown = effectful . ioKeyDown | 31 | false | true | 0 | 9 | 15 | 37 | 18 | 19 | null | null |
cgaebel/resource-effect | test/Test.hs | bsd-3-clause | statefulResourceTest :: Integer -> Property
statefulResourceTest x = morallyDubiousIOProperty $ do
m <- newMVar True
v <- runLift $ runResource $ do
let alloc = swapMVar m False
dealloc old = () <$ swapMVar m old
(k, v) <- allocate alloc dealloc
return v
mv <- takeMVar m
return $ v && mv | 364 | statefulResourceTest :: Integer -> Property
statefulResourceTest x = morallyDubiousIOProperty $ do
m <- newMVar True
v <- runLift $ runResource $ do
let alloc = swapMVar m False
dealloc old = () <$ swapMVar m old
(k, v) <- allocate alloc dealloc
return v
mv <- takeMVar m
return $ v && mv | 364 | statefulResourceTest x = morallyDubiousIOProperty $ do
m <- newMVar True
v <- runLift $ runResource $ do
let alloc = swapMVar m False
dealloc old = () <$ swapMVar m old
(k, v) <- allocate alloc dealloc
return v
mv <- takeMVar m
return $ v && mv | 320 | false | true | 0 | 16 | 128 | 125 | 57 | 68 | null | null |
phischu/fragnix | tests/packages/scotty/System.FilePath.Windows.hs | bsd-3-clause | readDriveLetter (x:':':xs) | isLetter x = Just ([x,':'], xs) | 60 | readDriveLetter (x:':':xs) | isLetter x = Just ([x,':'], xs) | 60 | readDriveLetter (x:':':xs) | isLetter x = Just ([x,':'], xs) | 60 | false | false | 0 | 8 | 8 | 44 | 22 | 22 | null | null |
ml9951/ghc | compiler/llvmGen/Llvm/PpLlvm.hs | bsd-3-clause | ppPhi :: LlvmType -> [(LlvmVar,LlvmVar)] -> SDoc
ppPhi tp preds =
let ppPreds (val, label) = brackets $ ppName val <> comma <+> ppName label
in text "phi" <+> ppr tp <+> hsep (punctuate comma $ map ppPreds preds) | 216 | ppPhi :: LlvmType -> [(LlvmVar,LlvmVar)] -> SDoc
ppPhi tp preds =
let ppPreds (val, label) = brackets $ ppName val <> comma <+> ppName label
in text "phi" <+> ppr tp <+> hsep (punctuate comma $ map ppPreds preds) | 216 | ppPhi tp preds =
let ppPreds (val, label) = brackets $ ppName val <> comma <+> ppName label
in text "phi" <+> ppr tp <+> hsep (punctuate comma $ map ppPreds preds) | 167 | false | true | 0 | 12 | 42 | 107 | 51 | 56 | null | null |
hephaestus-pl/hephaestus | willian/hephaestus-integrated/feature-modeling/src/FeatureModel/Parsers/FMIde/PrintFMIde.hs | mit | render :: Doc -> String
render d = rend 0 (map ($ "") $ d []) "" where
rend i ss = case ss of
"[" :ts -> showChar '[' . rend i ts
"(" :ts -> showChar '(' . rend i ts
"{" :ts -> showChar '{' . new (i+1) . rend (i+1) ts
"}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts
"}" :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts
";" :ts -> showChar ';' . new i . rend i ts
t : "," :ts -> showString t . space "," . rend i ts
t : ")" :ts -> showString t . showChar ')' . rend i ts
t : "]" :ts -> showString t . showChar ']' . rend i ts
t :ts -> space t . rend i ts
_ -> id
new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
space t = showString t . (\s -> if null s then "" else (' ':s)) | 843 | render :: Doc -> String
render d = rend 0 (map ($ "") $ d []) "" where
rend i ss = case ss of
"[" :ts -> showChar '[' . rend i ts
"(" :ts -> showChar '(' . rend i ts
"{" :ts -> showChar '{' . new (i+1) . rend (i+1) ts
"}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts
"}" :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts
";" :ts -> showChar ';' . new i . rend i ts
t : "," :ts -> showString t . space "," . rend i ts
t : ")" :ts -> showString t . showChar ')' . rend i ts
t : "]" :ts -> showString t . showChar ']' . rend i ts
t :ts -> space t . rend i ts
_ -> id
new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
space t = showString t . (\s -> if null s then "" else (' ':s)) | 843 | render d = rend 0 (map ($ "") $ d []) "" where
rend i ss = case ss of
"[" :ts -> showChar '[' . rend i ts
"(" :ts -> showChar '(' . rend i ts
"{" :ts -> showChar '{' . new (i+1) . rend (i+1) ts
"}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts
"}" :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts
";" :ts -> showChar ';' . new i . rend i ts
t : "," :ts -> showString t . space "," . rend i ts
t : ")" :ts -> showString t . showChar ')' . rend i ts
t : "]" :ts -> showString t . showChar ']' . rend i ts
t :ts -> space t . rend i ts
_ -> id
new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
space t = showString t . (\s -> if null s then "" else (' ':s)) | 819 | false | true | 0 | 16 | 282 | 509 | 244 | 265 | null | null |
creichert/persistent-postgresql | Database/Persist/Postgresql.hs | mit | showAlter table (n, NoDefault) = T.concat
[ "ALTER TABLE "
, escape table
, " ALTER COLUMN "
, escape n
, " DROP DEFAULT"
] | 147 | showAlter table (n, NoDefault) = T.concat
[ "ALTER TABLE "
, escape table
, " ALTER COLUMN "
, escape n
, " DROP DEFAULT"
] | 147 | showAlter table (n, NoDefault) = T.concat
[ "ALTER TABLE "
, escape table
, " ALTER COLUMN "
, escape n
, " DROP DEFAULT"
] | 147 | false | false | 0 | 7 | 49 | 43 | 23 | 20 | null | null |
alexander-at-github/eta | compiler/ETA/SimplCore/SimplEnv.hs | bsd-3-clause | getFloatBinds :: SimplEnv -> [CoreBind]
getFloatBinds (SimplEnv {seFloats = Floats bs _})
= fromOL bs | 103 | getFloatBinds :: SimplEnv -> [CoreBind]
getFloatBinds (SimplEnv {seFloats = Floats bs _})
= fromOL bs | 103 | getFloatBinds (SimplEnv {seFloats = Floats bs _})
= fromOL bs | 63 | false | true | 0 | 10 | 16 | 41 | 21 | 20 | null | null |
urbanslug/ghc | compiler/stgSyn/CoreToStg.hs | bsd-3-clause | -- Misc.
filterStgBinders :: [Var] -> [Var]
filterStgBinders bndrs = filter isId bndrs | 87 | filterStgBinders :: [Var] -> [Var]
filterStgBinders bndrs = filter isId bndrs | 77 | filterStgBinders bndrs = filter isId bndrs | 42 | true | true | 0 | 8 | 13 | 35 | 17 | 18 | null | null |
brendanhay/gogol | gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/StoredInfoTypes/Create.hs | mpl-2.0 | -- | OAuth access token.
ositcAccessToken :: Lens' OrganizationsStoredInfoTypesCreate (Maybe Text)
ositcAccessToken
= lens _ositcAccessToken
(\ s a -> s{_ositcAccessToken = a}) | 184 | ositcAccessToken :: Lens' OrganizationsStoredInfoTypesCreate (Maybe Text)
ositcAccessToken
= lens _ositcAccessToken
(\ s a -> s{_ositcAccessToken = a}) | 159 | ositcAccessToken
= lens _ositcAccessToken
(\ s a -> s{_ositcAccessToken = a}) | 85 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
debug-ito/wild-bind | wild-bind-x11/test/WildBind/X11Spec.hs | bsd-3-clause | grabCase :: (Bounded i, Enum i, Show i, Eq i) => FrontEnd ActiveWindow i -> Expectation
grabCase front = mapM_ (grabExp front) (enumFromTo minBound maxBound) | 157 | grabCase :: (Bounded i, Enum i, Show i, Eq i) => FrontEnd ActiveWindow i -> Expectation
grabCase front = mapM_ (grabExp front) (enumFromTo minBound maxBound) | 157 | grabCase front = mapM_ (grabExp front) (enumFromTo minBound maxBound) | 69 | false | true | 0 | 8 | 24 | 74 | 35 | 39 | null | null |
atwupack/LearnOpenGL | app/1_Getting-started/7_Camera/Camera-mouse.hs | bsd-3-clause | restrictPitch :: GLfloat -> GLfloat
restrictPitch p
| p > 89.0 = 89.0
| p < (-89.0) = -89.0
| otherwise = p | 119 | restrictPitch :: GLfloat -> GLfloat
restrictPitch p
| p > 89.0 = 89.0
| p < (-89.0) = -89.0
| otherwise = p | 119 | restrictPitch p
| p > 89.0 = 89.0
| p < (-89.0) = -89.0
| otherwise = p | 83 | false | true | 0 | 10 | 34 | 67 | 30 | 37 | null | null |
garetxe/cabal | cabal-install/Distribution/Client/FileMonitor.hs | bsd-3-clause | -- | Similar to 'monitorFileSearchPath', but also instructs us to
-- monitor the hash of the found file.
monitorFileHashedSearchPath :: [FilePath] -> FilePath -> [MonitorFilePath]
monitorFileHashedSearchPath notFoundAtPaths foundAtPath =
MonitorFileHashed foundAtPath
: map MonitorNonExistentFile notFoundAtPaths | 318 | monitorFileHashedSearchPath :: [FilePath] -> FilePath -> [MonitorFilePath]
monitorFileHashedSearchPath notFoundAtPaths foundAtPath =
MonitorFileHashed foundAtPath
: map MonitorNonExistentFile notFoundAtPaths | 213 | monitorFileHashedSearchPath notFoundAtPaths foundAtPath =
MonitorFileHashed foundAtPath
: map MonitorNonExistentFile notFoundAtPaths | 138 | true | true | 2 | 7 | 40 | 45 | 23 | 22 | null | null |
brendanhay/gogol | gogol-ml/gen/Network/Google/Resource/Ml/Projects/Models/Versions/SetDefault.hs | mpl-2.0 | -- | Creates a value of 'ProjectsModelsVersionsSetDefault' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pmvsdXgafv'
--
-- * 'pmvsdUploadProtocol'
--
-- * 'pmvsdAccessToken'
--
-- * 'pmvsdUploadType'
--
-- * 'pmvsdPayload'
--
-- * 'pmvsdName'
--
-- * 'pmvsdCallback'
projectsModelsVersionsSetDefault
:: GoogleCloudMlV1__SetDefaultVersionRequest -- ^ 'pmvsdPayload'
-> Text -- ^ 'pmvsdName'
-> ProjectsModelsVersionsSetDefault
projectsModelsVersionsSetDefault pPmvsdPayload_ pPmvsdName_ =
ProjectsModelsVersionsSetDefault'
{ _pmvsdXgafv = Nothing
, _pmvsdUploadProtocol = Nothing
, _pmvsdAccessToken = Nothing
, _pmvsdUploadType = Nothing
, _pmvsdPayload = pPmvsdPayload_
, _pmvsdName = pPmvsdName_
, _pmvsdCallback = Nothing
} | 860 | projectsModelsVersionsSetDefault
:: GoogleCloudMlV1__SetDefaultVersionRequest -- ^ 'pmvsdPayload'
-> Text -- ^ 'pmvsdName'
-> ProjectsModelsVersionsSetDefault
projectsModelsVersionsSetDefault pPmvsdPayload_ pPmvsdName_ =
ProjectsModelsVersionsSetDefault'
{ _pmvsdXgafv = Nothing
, _pmvsdUploadProtocol = Nothing
, _pmvsdAccessToken = Nothing
, _pmvsdUploadType = Nothing
, _pmvsdPayload = pPmvsdPayload_
, _pmvsdName = pPmvsdName_
, _pmvsdCallback = Nothing
} | 505 | projectsModelsVersionsSetDefault pPmvsdPayload_ pPmvsdName_ =
ProjectsModelsVersionsSetDefault'
{ _pmvsdXgafv = Nothing
, _pmvsdUploadProtocol = Nothing
, _pmvsdAccessToken = Nothing
, _pmvsdUploadType = Nothing
, _pmvsdPayload = pPmvsdPayload_
, _pmvsdName = pPmvsdName_
, _pmvsdCallback = Nothing
} | 334 | true | true | 0 | 8 | 150 | 96 | 62 | 34 | null | null |
TomMD/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | strictType :: Q Strict -> TypeQ -> StrictTypeQ
strictType = liftM2 (,) | 70 | strictType :: Q Strict -> TypeQ -> StrictTypeQ
strictType = liftM2 (,) | 70 | strictType = liftM2 (,) | 23 | false | true | 0 | 6 | 11 | 28 | 14 | 14 | null | null |
danmane/abalone | unsupported/hs/src/abalone.hs | mit | winner :: Game -> Maybe Outcome
winner g | gameOver g = Just advantage
| otherwise = Nothing
where
advantage = case comparing (numPieces g) White Black of
GT -> WhiteWins
LT -> BlackWins
EQ -> TieGame | 235 | winner :: Game -> Maybe Outcome
winner g | gameOver g = Just advantage
| otherwise = Nothing
where
advantage = case comparing (numPieces g) White Black of
GT -> WhiteWins
LT -> BlackWins
EQ -> TieGame | 235 | winner g | gameOver g = Just advantage
| otherwise = Nothing
where
advantage = case comparing (numPieces g) White Black of
GT -> WhiteWins
LT -> BlackWins
EQ -> TieGame | 203 | false | true | 0 | 8 | 71 | 85 | 39 | 46 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.