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
Yuras/hfd
src/Proto.hs
bsd-3-clause
-- | Send @next@ command to player execNext :: MonadIO m => App m () execNext = sendMsg OMsgNext
97
execNext :: MonadIO m => App m () execNext = sendMsg OMsgNext
62
execNext = sendMsg OMsgNext
28
true
true
0
7
19
29
14
15
null
null
yakovs83/Hakerrank-problems
src/Palindrome.hs
mit
--more efficient implementation where left branch always splits into two branched while right recursion branch --always calls itself --bool parameter is a flag that controls recursion, true -> two branches, false - only right branch --THERE IS AN ISSUE WITH THIS ONE IF PALINDROME IS ON THE RIGHT SIDE OF THE STRING recP2::String->String recP2 s = recP2' s True
361
recP2::String->String recP2 s = recP2' s True
45
recP2 s = recP2' s True
23
true
true
0
5
58
27
15
12
null
null
lordi/jazzmate
src/Main.hs
gpl-2.0
setMIDIProvider arg opt = case arg of #ifdef USE_ALSA "alsa" -> return opt { midiProvider = ALSA.run } #endif #ifdef USE_JACK "jack" -> return opt { midiProvider = JACK.run } #endif "dummy" -> return opt { midiProvider = Dummy.run } _ -> error $ "unrecognized midi provider: " ++ arg
347
setMIDIProvider arg opt = case arg of #ifdef USE_ALSA "alsa" -> return opt { midiProvider = ALSA.run } #endif #ifdef USE_JACK "jack" -> return opt { midiProvider = JACK.run } #endif "dummy" -> return opt { midiProvider = Dummy.run } _ -> error $ "unrecognized midi provider: " ++ arg
347
setMIDIProvider arg opt = case arg of #ifdef USE_ALSA "alsa" -> return opt { midiProvider = ALSA.run } #endif #ifdef USE_JACK "jack" -> return opt { midiProvider = JACK.run } #endif "dummy" -> return opt { midiProvider = Dummy.run } _ -> error $ "unrecognized midi provider: " ++ arg
347
false
false
0
11
113
91
48
43
null
null
mikesteele81/Win32-dhcp-server
src/Data/Ip.hs
bsd-3-clause
readIp :: Text -> Either String Ip readIp s = fmapL (\e -> "Error parsing IP address: " ++ e) $ do (a, s2) <- decimal s (b, s3) <- dot s2 >>= decimal (c, s4) <- dot s3 >>= decimal (d, s5) <- dot s4 >>= decimal unless (s5 == "") $ Left "exactly 4 octets were expected." -- Confirm that all digits are in range fromOctets <$> digit a <*> digit b <*> digit c <*> digit d where dot = note "Expected '.' character." . T.stripPrefix "." digit :: Int -> Either String Word8 digit x | x < 0 || x > 255 = Left "digit out of range." | otherwise = Right $ fromIntegral x -- |An IP address is 32-bits wide. This function will construct an `Ip` from -- 4 octets.
697
readIp :: Text -> Either String Ip readIp s = fmapL (\e -> "Error parsing IP address: " ++ e) $ do (a, s2) <- decimal s (b, s3) <- dot s2 >>= decimal (c, s4) <- dot s3 >>= decimal (d, s5) <- dot s4 >>= decimal unless (s5 == "") $ Left "exactly 4 octets were expected." -- Confirm that all digits are in range fromOctets <$> digit a <*> digit b <*> digit c <*> digit d where dot = note "Expected '.' character." . T.stripPrefix "." digit :: Int -> Either String Word8 digit x | x < 0 || x > 255 = Left "digit out of range." | otherwise = Right $ fromIntegral x -- |An IP address is 32-bits wide. This function will construct an `Ip` from -- 4 octets.
697
readIp s = fmapL (\e -> "Error parsing IP address: " ++ e) $ do (a, s2) <- decimal s (b, s3) <- dot s2 >>= decimal (c, s4) <- dot s3 >>= decimal (d, s5) <- dot s4 >>= decimal unless (s5 == "") $ Left "exactly 4 octets were expected." -- Confirm that all digits are in range fromOctets <$> digit a <*> digit b <*> digit c <*> digit d where dot = note "Expected '.' character." . T.stripPrefix "." digit :: Int -> Either String Word8 digit x | x < 0 || x > 255 = Left "digit out of range." | otherwise = Right $ fromIntegral x -- |An IP address is 32-bits wide. This function will construct an `Ip` from -- 4 octets.
662
false
true
1
12
184
264
123
141
null
null
keera-studios/hsQt
Qtc/Enums/Gui/QAbstractItemView.hs
bsd-2-clause
eEnsureVisible :: ScrollHint eEnsureVisible = ieScrollHint $ 0
64
eEnsureVisible :: ScrollHint eEnsureVisible = ieScrollHint $ 0
64
eEnsureVisible = ieScrollHint $ 0
35
false
true
2
6
9
23
9
14
null
null
wincent/docvim
lib/Text/Docvim/Parse.hs
mit
parse :: String -> IO Node parse fileName = parseFromFile unit fileName >>= either report return where report err = do hPutStrLn stderr $ "Error: " ++ show err exitFailure
189
parse :: String -> IO Node parse fileName = parseFromFile unit fileName >>= either report return where report err = do hPutStrLn stderr $ "Error: " ++ show err exitFailure
189
parse fileName = parseFromFile unit fileName >>= either report return where report err = do hPutStrLn stderr $ "Error: " ++ show err exitFailure
162
false
true
1
9
47
74
30
44
null
null
abakst/Zoepis
Zoepis/ZGame.hs
gpl-3.0
-- Time -- zTickPrec = 100000000
33
zTickPrec = 100000000
21
zTickPrec = 100000000
21
true
false
0
4
6
7
4
3
null
null
utdemir/wai
warp/Network/Wai/Handler/Warp.hs
mit
-- | Size in bytes read to prevent Slowloris protection. Default value: 2048 -- -- Since 3.1.2 setSlowlorisSize :: Int -> Settings -> Settings setSlowlorisSize x y = y { settingsSlowlorisSize = x }
197
setSlowlorisSize :: Int -> Settings -> Settings setSlowlorisSize x y = y { settingsSlowlorisSize = x }
102
setSlowlorisSize x y = y { settingsSlowlorisSize = x }
54
true
true
0
8
33
44
22
22
null
null
neothemachine/monadiccp
src/Control/CP/ComposableTransformers.hs
bsd-3-clause
evalCT :: CSearchSig c a evalCT tree c es ts eval continue exit = eval tree es ts
83
evalCT :: CSearchSig c a evalCT tree c es ts eval continue exit = eval tree es ts
83
evalCT tree c es ts eval continue exit = eval tree es ts
58
false
true
1
5
19
43
18
25
null
null
chwthewke/passman-hs
test/Passman/Engine/KeyDerivationSpec.hs
bsd-3-clause
pbkdf2DerivesExpectedKeyAscii :: () -> Expectation pbkdf2DerivesExpectedKeyAscii _ = actual `shouldBe` Right expected where actual = B.unpack <$> deriveKey (PBKDF2WithHmacSHA1 1000) (Parameters 1 20) (k "passw0rd") pbkdf2Salt expected = [ 0xac, 0x22, 0x98, 0xff, 0x9e, 0xc6, 0xd2, 0xaa , 0x17, 0x16, 0x81, 0x29, 0x12, 0x48, 0xb5, 0x16 , 0xc7, 0x79, 0xca, 0xaa ]
423
pbkdf2DerivesExpectedKeyAscii :: () -> Expectation pbkdf2DerivesExpectedKeyAscii _ = actual `shouldBe` Right expected where actual = B.unpack <$> deriveKey (PBKDF2WithHmacSHA1 1000) (Parameters 1 20) (k "passw0rd") pbkdf2Salt expected = [ 0xac, 0x22, 0x98, 0xff, 0x9e, 0xc6, 0xd2, 0xaa , 0x17, 0x16, 0x81, 0x29, 0x12, 0x48, 0xb5, 0x16 , 0xc7, 0x79, 0xca, 0xaa ]
423
pbkdf2DerivesExpectedKeyAscii _ = actual `shouldBe` Right expected where actual = B.unpack <$> deriveKey (PBKDF2WithHmacSHA1 1000) (Parameters 1 20) (k "passw0rd") pbkdf2Salt expected = [ 0xac, 0x22, 0x98, 0xff, 0x9e, 0xc6, 0xd2, 0xaa , 0x17, 0x16, 0x81, 0x29, 0x12, 0x48, 0xb5, 0x16 , 0xc7, 0x79, 0xca, 0xaa ]
372
false
true
1
8
113
138
79
59
null
null
evansb/sacred
sacred/Logic.hs
mit
diff p bef@(SNode h _ c) (SLeaf txt1 _) = S.fromList [Remove p h, Add p (hash txt1)]
88
diff p bef@(SNode h _ c) (SLeaf txt1 _) = S.fromList [Remove p h, Add p (hash txt1)]
88
diff p bef@(SNode h _ c) (SLeaf txt1 _) = S.fromList [Remove p h, Add p (hash txt1)]
88
false
false
0
8
21
66
30
36
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/vectorise/Vectorise/Utils/Closure.hs
bsd-3-clause
buildEnv vs = do (lenv_tc, lenv_tyargs) <- pdataReprTyCon ty let venv_con = tupleCon BoxedTuple (length vs) [lenv_con] = tyConDataCons lenv_tc venv = mkCoreTup (map Var vvs) lenv = Var (dataConWrapId lenv_con) `mkTyApps` lenv_tyargs `mkApps` map Var lvs vbind env body = mkWildCase env ty (exprType body) [(DataAlt venv_con, vvs, body)] lbind env body = let scrut = unwrapFamInstScrut lenv_tc lenv_tyargs env in mkWildCase scrut (exprType scrut) (exprType body) [(DataAlt lenv_con, lvs, body)] bind (venv, lenv) (vbody, lbody) = (vbind venv vbody, lbind lenv lbody) return (ty, (venv, lenv), bind) where (vvs, lvs) = unzip vs tys = map vVarType vs ty = mkBoxedTupleTy tys
965
buildEnv vs = do (lenv_tc, lenv_tyargs) <- pdataReprTyCon ty let venv_con = tupleCon BoxedTuple (length vs) [lenv_con] = tyConDataCons lenv_tc venv = mkCoreTup (map Var vvs) lenv = Var (dataConWrapId lenv_con) `mkTyApps` lenv_tyargs `mkApps` map Var lvs vbind env body = mkWildCase env ty (exprType body) [(DataAlt venv_con, vvs, body)] lbind env body = let scrut = unwrapFamInstScrut lenv_tc lenv_tyargs env in mkWildCase scrut (exprType scrut) (exprType body) [(DataAlt lenv_con, lvs, body)] bind (venv, lenv) (vbody, lbody) = (vbind venv vbody, lbind lenv lbody) return (ty, (venv, lenv), bind) where (vvs, lvs) = unzip vs tys = map vVarType vs ty = mkBoxedTupleTy tys
965
buildEnv vs = do (lenv_tc, lenv_tyargs) <- pdataReprTyCon ty let venv_con = tupleCon BoxedTuple (length vs) [lenv_con] = tyConDataCons lenv_tc venv = mkCoreTup (map Var vvs) lenv = Var (dataConWrapId lenv_con) `mkTyApps` lenv_tyargs `mkApps` map Var lvs vbind env body = mkWildCase env ty (exprType body) [(DataAlt venv_con, vvs, body)] lbind env body = let scrut = unwrapFamInstScrut lenv_tc lenv_tyargs env in mkWildCase scrut (exprType scrut) (exprType body) [(DataAlt lenv_con, lvs, body)] bind (venv, lenv) (vbody, lbody) = (vbind venv vbody, lbind lenv lbody) return (ty, (venv, lenv), bind) where (vvs, lvs) = unzip vs tys = map vVarType vs ty = mkBoxedTupleTy tys
965
false
false
0
15
397
303
156
147
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
-- | The error. csfreiError :: Lens' CancelSpotFleetRequestsErrorItem CancelSpotFleetRequestsError csfreiError = lens _csfreiError (\s a -> s { _csfreiError = a })
163
csfreiError :: Lens' CancelSpotFleetRequestsErrorItem CancelSpotFleetRequestsError csfreiError = lens _csfreiError (\s a -> s { _csfreiError = a })
147
csfreiError = lens _csfreiError (\s a -> s { _csfreiError = a })
64
true
true
1
9
21
45
22
23
null
null
kelecorix/api-hasoffers
src/HasOffers/API/Brand/Affiliate.hs
bsd-3-clause
removeCustomReferralCommission params = Call "Affiliate" "removeCustomReferralCommission" "GET" [ Param "id" True $ getParam params 0 ]
172
removeCustomReferralCommission params = Call "Affiliate" "removeCustomReferralCommission" "GET" [ Param "id" True $ getParam params 0 ]
172
removeCustomReferralCommission params = Call "Affiliate" "removeCustomReferralCommission" "GET" [ Param "id" True $ getParam params 0 ]
172
false
false
0
8
52
35
16
19
null
null
peteg/ADHOC
Tests/08_Kesterel/143a_nondet_exn.hs
gpl-2.0
Just (m, (_, ())) = isConstructive system
41
Just (m, (_, ())) = isConstructive system
41
Just (m, (_, ())) = isConstructive system
41
false
false
0
8
6
27
14
13
null
null
enolan/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
tldeclared (PClauses _ _ n _) = []
54
tldeclared (PClauses _ _ n _) = []
54
tldeclared (PClauses _ _ n _) = []
54
false
false
0
6
27
24
11
13
null
null
lennart/Tidal
Sound/Tidal/Pattern.hs
gpl-3.0
-- | @sinewave1@ is equivalent to @sinewave@, but with amplitude from 0 to 1. sinewave1 :: Pattern Double sinewave1 = fmap ((/ 2) . (+ 1)) sinewave
147
sinewave1 :: Pattern Double sinewave1 = fmap ((/ 2) . (+ 1)) sinewave
69
sinewave1 = fmap ((/ 2) . (+ 1)) sinewave
41
true
true
0
8
26
35
20
15
null
null
crogers1/manager
xenmgr/Vm/Config.hs
gpl-2.0
vmMemoryStaticMax = property "config.memory-static-max"
55
vmMemoryStaticMax = property "config.memory-static-max"
55
vmMemoryStaticMax = property "config.memory-static-max"
55
false
false
0
5
3
9
4
5
null
null
nick8325/kbc
src/Data/ChurchList.hs
bsd-3-clause
fromList :: [a] -> ChurchList a fromList xs = ChurchList (\c n -> Prelude.foldr c n xs)
87
fromList :: [a] -> ChurchList a fromList xs = ChurchList (\c n -> Prelude.foldr c n xs)
87
fromList xs = ChurchList (\c n -> Prelude.foldr c n xs)
55
false
true
0
9
16
46
23
23
null
null
minoki/LambdaQuest
src/LambdaQuest/SystemFsub/Coercion.hs
bsd-3-clause
mapTerm ctx (TLet name def body) = do (def', defType) <- mapTerm ctx def (body', bodyType) <- mapTerm (VarBind name defType : ctx) body return (F.TLet name def' body', bodyType)
183
mapTerm ctx (TLet name def body) = do (def', defType) <- mapTerm ctx def (body', bodyType) <- mapTerm (VarBind name defType : ctx) body return (F.TLet name def' body', bodyType)
183
mapTerm ctx (TLet name def body) = do (def', defType) <- mapTerm ctx def (body', bodyType) <- mapTerm (VarBind name defType : ctx) body return (F.TLet name def' body', bodyType)
183
false
false
0
11
35
90
44
46
null
null
urbanslug/ghc
compiler/coreSyn/CoreFVs.hs
bsd-3-clause
{- Note [Rule free var hack] (Not a hack any more) ~~~~~~~~~~~~~~~~~~~~~~~~~ We used not to include the Id in its own rhs free-var set. Otherwise the occurrence analyser makes bindings recursive: f x y = x+y RULE: f (f x y) z ==> f x (f y z) However, the occurrence analyser distinguishes "non-rule loop breakers" from "rule-only loop breakers" (see BasicTypes.OccInfo). So it will put this 'f' in a Rec block, but will mark the binding as a non-rule loop breaker, which is perfectly inlinable. -} -- |Free variables of a vectorisation declaration vectsFreeVars :: [CoreVect] -> VarSet vectsFreeVars = mapUnionVarSet vectFreeVars where vectFreeVars (Vect _ rhs) = expr_fvs rhs isLocalId emptyVarSet vectFreeVars (NoVect _) = noFVs vectFreeVars (VectType _ _ _) = noFVs vectFreeVars (VectClass _) = noFVs vectFreeVars (VectInst _) = noFVs -- this function is only concerned with values, not types {- ************************************************************************ * * \section[freevars-everywhere]{Attaching free variables to every sub-expression} * * ************************************************************************ The free variable pass annotates every node in the expression with its NON-GLOBAL free variables and type variables. -} -- | Every node in a binding group annotated with its -- (non-global) free variables, both Ids and TyVars
1,566
vectsFreeVars :: [CoreVect] -> VarSet vectsFreeVars = mapUnionVarSet vectFreeVars where vectFreeVars (Vect _ rhs) = expr_fvs rhs isLocalId emptyVarSet vectFreeVars (NoVect _) = noFVs vectFreeVars (VectType _ _ _) = noFVs vectFreeVars (VectClass _) = noFVs vectFreeVars (VectInst _) = noFVs -- this function is only concerned with values, not types {- ************************************************************************ * * \section[freevars-everywhere]{Attaching free variables to every sub-expression} * * ************************************************************************ The free variable pass annotates every node in the expression with its NON-GLOBAL free variables and type variables. -} -- | Every node in a binding group annotated with its -- (non-global) free variables, both Ids and TyVars
996
vectsFreeVars = mapUnionVarSet vectFreeVars where vectFreeVars (Vect _ rhs) = expr_fvs rhs isLocalId emptyVarSet vectFreeVars (NoVect _) = noFVs vectFreeVars (VectType _ _ _) = noFVs vectFreeVars (VectClass _) = noFVs vectFreeVars (VectInst _) = noFVs -- this function is only concerned with values, not types {- ************************************************************************ * * \section[freevars-everywhere]{Attaching free variables to every sub-expression} * * ************************************************************************ The free variable pass annotates every node in the expression with its NON-GLOBAL free variables and type variables. -} -- | Every node in a binding group annotated with its -- (non-global) free variables, both Ids and TyVars
958
true
true
0
7
404
125
60
65
null
null
thielema/wxhaskell
wx/src/Graphics/UI/WX/Controls.hs
lgpl-2.1
listViewSetHandler :: ListView a -> (EventList -> IO ()) -> IO () listViewSetHandler list handler = set (listViewCtrl list) [on listEvent := handler]
151
listViewSetHandler :: ListView a -> (EventList -> IO ()) -> IO () listViewSetHandler list handler = set (listViewCtrl list) [on listEvent := handler]
151
listViewSetHandler list handler = set (listViewCtrl list) [on listEvent := handler]
85
false
true
0
10
24
66
31
35
null
null
robeverest/accelerate
Data/Array/Accelerate/Internal/Check.hs
bsd-3-clause
doChecks Internal = doInternalChecks
36
doChecks Internal = doInternalChecks
36
doChecks Internal = doInternalChecks
36
false
false
0
5
3
9
4
5
null
null
thomaseding/radix
src/Radix.hs
bsd-3-clause
mapKnowingLast f (x:xs) = f NotLast x : mapKnowingLast f xs
59
mapKnowingLast f (x:xs) = f NotLast x : mapKnowingLast f xs
59
mapKnowingLast f (x:xs) = f NotLast x : mapKnowingLast f xs
59
false
false
0
7
10
32
15
17
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | Default delay target measured in sectors defaultDelayTarget :: Int defaultDelayTarget = 1
94
defaultDelayTarget :: Int defaultDelayTarget = 1
48
defaultDelayTarget = 1
22
true
true
0
4
13
12
7
5
null
null
verement/etamoo
src/MOO/Object.hs
bsd-3-clause
replaceVerb :: Int -> Verb -> Object -> VTx Object replaceVerb index verb obj = return obj { objectVerbs = pre ++ [(verbKey verb, verbRef)] ++ tail post } where (pre, post) = splitAt index (objectVerbs obj) :: ([VerbDef], [VerbDef]) verbRef = snd (head post) :: PVar (VRef Verb)
310
replaceVerb :: Int -> Verb -> Object -> VTx Object replaceVerb index verb obj = return obj { objectVerbs = pre ++ [(verbKey verb, verbRef)] ++ tail post } where (pre, post) = splitAt index (objectVerbs obj) :: ([VerbDef], [VerbDef]) verbRef = snd (head post) :: PVar (VRef Verb)
310
replaceVerb index verb obj = return obj { objectVerbs = pre ++ [(verbKey verb, verbRef)] ++ tail post } where (pre, post) = splitAt index (objectVerbs obj) :: ([VerbDef], [VerbDef]) verbRef = snd (head post) :: PVar (VRef Verb)
259
false
true
1
12
80
135
70
65
null
null
brendanhay/gogol
gogol-cloudidentity/gen/Network/Google/CloudIdentity/Types/Product.hs
mpl-2.0
-- | Creates a value of 'GoogleAppsCloudidentityDevicesV1CustomAttributeValue' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'gacdvcavBoolValue' -- -- * 'gacdvcavNumberValue' -- -- * 'gacdvcavStringValue' googleAppsCloudidentityDevicesV1CustomAttributeValue :: GoogleAppsCloudidentityDevicesV1CustomAttributeValue googleAppsCloudidentityDevicesV1CustomAttributeValue = GoogleAppsCloudidentityDevicesV1CustomAttributeValue' { _gacdvcavBoolValue = Nothing , _gacdvcavNumberValue = Nothing , _gacdvcavStringValue = Nothing }
630
googleAppsCloudidentityDevicesV1CustomAttributeValue :: GoogleAppsCloudidentityDevicesV1CustomAttributeValue googleAppsCloudidentityDevicesV1CustomAttributeValue = GoogleAppsCloudidentityDevicesV1CustomAttributeValue' { _gacdvcavBoolValue = Nothing , _gacdvcavNumberValue = Nothing , _gacdvcavStringValue = Nothing }
338
googleAppsCloudidentityDevicesV1CustomAttributeValue = GoogleAppsCloudidentityDevicesV1CustomAttributeValue' { _gacdvcavBoolValue = Nothing , _gacdvcavNumberValue = Nothing , _gacdvcavStringValue = Nothing }
225
true
true
1
7
82
47
29
18
null
null
snoyberg/ghc
testsuite/tests/dependent/should_compile/dynamic-paper.hs
bsd-3-clause
typeOf = undefined
18
typeOf = undefined
18
typeOf = undefined
18
false
false
1
5
2
10
3
7
null
null
brendanhay/gogol
gogol-appengine/gen/Network/Google/AppEngine/Types/Product.hs
mpl-2.0
-- | Output only. The IP address of this instance. Only applicable for -- instances in App Engine flexible environment. iVMIP :: Lens' Instance (Maybe Text) iVMIP = lens _iVMIP (\ s a -> s{_iVMIP = a})
201
iVMIP :: Lens' Instance (Maybe Text) iVMIP = lens _iVMIP (\ s a -> s{_iVMIP = a})
81
iVMIP = lens _iVMIP (\ s a -> s{_iVMIP = a})
44
true
true
2
9
36
56
26
30
null
null
flippedAben/hascheme
src/Evaluate.hs
mit
showVal (Bool False) = "#f"
27
showVal (Bool False) = "#f"
27
showVal (Bool False) = "#f"
27
false
false
0
7
4
15
7
8
null
null
haslab/SecreC
src/Language/SecreC/Parser/Parsec.hs
gpl-3.0
scTemplateStructDatatypeSpecifier :: (Monad m,MonadCatch m) => ScParserT m (DatatypeSpecifier Identifier Position) scTemplateStructDatatypeSpecifier = apA2 scTypeId (scABrackets scTemplateTypeArguments) (\x1 x2 -> TemplateSpecifier (loc x1) x1 x2) <?> "template struct specifier"
279
scTemplateStructDatatypeSpecifier :: (Monad m,MonadCatch m) => ScParserT m (DatatypeSpecifier Identifier Position) scTemplateStructDatatypeSpecifier = apA2 scTypeId (scABrackets scTemplateTypeArguments) (\x1 x2 -> TemplateSpecifier (loc x1) x1 x2) <?> "template struct specifier"
279
scTemplateStructDatatypeSpecifier = apA2 scTypeId (scABrackets scTemplateTypeArguments) (\x1 x2 -> TemplateSpecifier (loc x1) x1 x2) <?> "template struct specifier"
164
false
true
0
11
28
79
40
39
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
mlrPageInfo :: Lens' MemberListResponse (Maybe PageInfo) mlrPageInfo = lens _mlrPageInfo (\ s a -> s{_mlrPageInfo = a})
121
mlrPageInfo :: Lens' MemberListResponse (Maybe PageInfo) mlrPageInfo = lens _mlrPageInfo (\ s a -> s{_mlrPageInfo = a})
121
mlrPageInfo = lens _mlrPageInfo (\ s a -> s{_mlrPageInfo = a})
64
false
true
0
9
18
47
24
23
null
null
ctimmons/hs_rosalind
9 - Consensus and Profile/Main.hs
unlicense
getProfileTuple 'C' = (0, 1, 0, 0)
34
getProfileTuple 'C' = (0, 1, 0, 0)
34
getProfileTuple 'C' = (0, 1, 0, 0)
34
false
false
0
5
6
21
12
9
null
null
betaveros/bcodex
Text/Bcodex/Alpha.hs
mit
alphaToInt :: Char -> Maybe Int alphaToInt ch | 'a' <= ch && ch <= 'z' = Just $ ord ch - ord '`' | 'A' <= ch && ch <= 'Z' = Just $ ord ch - ord '@' | otherwise = Nothing
194
alphaToInt :: Char -> Maybe Int alphaToInt ch | 'a' <= ch && ch <= 'z' = Just $ ord ch - ord '`' | 'A' <= ch && ch <= 'Z' = Just $ ord ch - ord '@' | otherwise = Nothing
194
alphaToInt ch | 'a' <= ch && ch <= 'z' = Just $ ord ch - ord '`' | 'A' <= ch && ch <= 'Z' = Just $ ord ch - ord '@' | otherwise = Nothing
162
false
true
4
10
68
108
47
61
null
null
philopon/arib
src/Data/Arib/PSI/PMT/Internal.hs
bsd-3-clause
pmt :: Int -> PSITag PMT pmt i = pmt' (== i)
44
pmt :: Int -> PSITag PMT pmt i = pmt' (== i)
44
pmt i = pmt' (== i)
19
false
true
0
6
11
31
15
16
null
null
mrakgr/futhark
src/Futhark/Optimise/Simplifier/Engine.hs
bsd-3-clause
blockUnhoistedDeps :: Attributes lore => [Either (Binding lore) (Binding lore)] -> [Either (Binding lore) (Binding lore)] blockUnhoistedDeps = snd . mapAccumL block HS.empty where block blocked (Left need) = (blocked <> HS.fromList (provides need), Left need) block blocked (Right need) | blocked `intersects` requires need = (blocked <> HS.fromList (provides need), Left need) | otherwise = (blocked, Right need)
518
blockUnhoistedDeps :: Attributes lore => [Either (Binding lore) (Binding lore)] -> [Either (Binding lore) (Binding lore)] blockUnhoistedDeps = snd . mapAccumL block HS.empty where block blocked (Left need) = (blocked <> HS.fromList (provides need), Left need) block blocked (Right need) | blocked `intersects` requires need = (blocked <> HS.fromList (provides need), Left need) | otherwise = (blocked, Right need)
518
blockUnhoistedDeps = snd . mapAccumL block HS.empty where block blocked (Left need) = (blocked <> HS.fromList (provides need), Left need) block blocked (Right need) | blocked `intersects` requires need = (blocked <> HS.fromList (provides need), Left need) | otherwise = (blocked, Right need)
355
false
true
0
12
163
202
95
107
null
null
travitch/dalvik
src/Dalvik/Printer.hs
bsd-3-clause
prettyInstruction _ _ (Cmp CLFloat dst r1 r2) = mkInsn'8 "cmpl-float" [dst, r1, r2]
85
prettyInstruction _ _ (Cmp CLFloat dst r1 r2) = mkInsn'8 "cmpl-float" [dst, r1, r2]
85
prettyInstruction _ _ (Cmp CLFloat dst r1 r2) = mkInsn'8 "cmpl-float" [dst, r1, r2]
85
false
false
0
7
15
39
20
19
null
null
konn/random-effin
Control/Effect/Random.hs
bsd-3-clause
-- | Sample a random value from a weighted list. The total weight of all elements must not be 0. -- -- Since 0.1.0.0 fromList :: EffectRandom g l => [(a, Rational)] -> Effect l a fromList [] = error "Effect.Random.fromList called with empty list"
246
fromList :: EffectRandom g l => [(a, Rational)] -> Effect l a fromList [] = error "Effect.Random.fromList called with empty list"
129
fromList [] = error "Effect.Random.fromList called with empty list"
67
true
true
0
8
44
49
26
23
null
null
pgavin/secdh
lib/SECDH/Eval.hs
bsd-3-clause
applyPrim ZeroPP [ConstA (IntegerC 0)] = trueA
74
applyPrim ZeroPP [ConstA (IntegerC 0)] = trueA
74
applyPrim ZeroPP [ConstA (IntegerC 0)] = trueA
74
false
false
0
8
34
25
11
14
null
null
Hrothen/textwrap
test/Spec.hs
bsd-3-clause
maxLinesTests :: Spec maxLinesTests = describe "Max Lines" $ do let text = "Hello there, how are you this fine day? I'm glad to hear it!" describe "Simple" $ it "truncates everything after the line maximum" $ do testWrapLines 12 0 text ["Hello [...]"] testWrapLines 12 1 text ["Hello [...]"] testWrapLines 12 2 text ["Hello there,", "how [...]"] testWrapLines 13 2 text ["Hello there,", "how are [...]"] testWrapLines 80 1 text [text] testWrapLines 12 6 text [ "Hello there," , "how are you" , "this fine" , "day? I'm" , "glad to hear" , "it!" ] describe "Spaces" $ do it "strips spaces before the placeholder" $ testWrapLines 12 4 text [ "Hello there," , "how are you" , "this fine" , "day? [...]" ] it "puts the placeholder at the start of the line if nothing fits" $ testWrapLines 6 2 text ["Hello", "[...]"] it "doesn't use a placeholder for trailing spaces" $ testWrapLines 12 6 (text `T.append` T.replicate 10 " ") [ "Hello there," , "how are you" , "this fine" , "day? I'm" , "glad to hear" , "it!" ] describe "Placeholder" $ do let check w lns plc txt expected = TW.wrap testConfig{ width = w, maxLines = Just lns, placeholder = plc } txt `shouldBe` Right expected it "takes a custom placeholder" $ do check 12 1 "..." text ["Hello..."] check 12 2 "..." text ["Hello there,", "how are..."] it "returns nothing when the placeholder and indentation are too long" $ do TW.wrap testConfig{ width = 16 , maxLines = Just 1 , initialIndent = " " , placeholder = " [truncated]..." } text `shouldBe` Left TW.PlaceholderTooLarge TW.wrap testConfig{ width = 16 , maxLines = Just 2 , subsequentIndent = " " , placeholder = " [truncated]..." } text `shouldBe` Left TW.PlaceholderTooLarge it "handles long placeholders and indentation" $ do testWrap testConfig{ width = 16 , maxLines = Just 2 , initialIndent = " " , subsequentIndent = " " , placeholder = " [truncated]..." } text [" Hello there,", " [truncated]..."] testWrap testConfig{ width = 16 , maxLines = Just 1 , initialIndent = " " , subsequentIndent = " " , placeholder = " [truncated]..." } text [" [truncated]..."] testWrap testConfig{ width = 80, placeholder = T.replicate 1000 "." } text [text]
2,919
maxLinesTests :: Spec maxLinesTests = describe "Max Lines" $ do let text = "Hello there, how are you this fine day? I'm glad to hear it!" describe "Simple" $ it "truncates everything after the line maximum" $ do testWrapLines 12 0 text ["Hello [...]"] testWrapLines 12 1 text ["Hello [...]"] testWrapLines 12 2 text ["Hello there,", "how [...]"] testWrapLines 13 2 text ["Hello there,", "how are [...]"] testWrapLines 80 1 text [text] testWrapLines 12 6 text [ "Hello there," , "how are you" , "this fine" , "day? I'm" , "glad to hear" , "it!" ] describe "Spaces" $ do it "strips spaces before the placeholder" $ testWrapLines 12 4 text [ "Hello there," , "how are you" , "this fine" , "day? [...]" ] it "puts the placeholder at the start of the line if nothing fits" $ testWrapLines 6 2 text ["Hello", "[...]"] it "doesn't use a placeholder for trailing spaces" $ testWrapLines 12 6 (text `T.append` T.replicate 10 " ") [ "Hello there," , "how are you" , "this fine" , "day? I'm" , "glad to hear" , "it!" ] describe "Placeholder" $ do let check w lns plc txt expected = TW.wrap testConfig{ width = w, maxLines = Just lns, placeholder = plc } txt `shouldBe` Right expected it "takes a custom placeholder" $ do check 12 1 "..." text ["Hello..."] check 12 2 "..." text ["Hello there,", "how are..."] it "returns nothing when the placeholder and indentation are too long" $ do TW.wrap testConfig{ width = 16 , maxLines = Just 1 , initialIndent = " " , placeholder = " [truncated]..." } text `shouldBe` Left TW.PlaceholderTooLarge TW.wrap testConfig{ width = 16 , maxLines = Just 2 , subsequentIndent = " " , placeholder = " [truncated]..." } text `shouldBe` Left TW.PlaceholderTooLarge it "handles long placeholders and indentation" $ do testWrap testConfig{ width = 16 , maxLines = Just 2 , initialIndent = " " , subsequentIndent = " " , placeholder = " [truncated]..." } text [" Hello there,", " [truncated]..."] testWrap testConfig{ width = 16 , maxLines = Just 1 , initialIndent = " " , subsequentIndent = " " , placeholder = " [truncated]..." } text [" [truncated]..."] testWrap testConfig{ width = 80, placeholder = T.replicate 1000 "." } text [text]
2,919
maxLinesTests = describe "Max Lines" $ do let text = "Hello there, how are you this fine day? I'm glad to hear it!" describe "Simple" $ it "truncates everything after the line maximum" $ do testWrapLines 12 0 text ["Hello [...]"] testWrapLines 12 1 text ["Hello [...]"] testWrapLines 12 2 text ["Hello there,", "how [...]"] testWrapLines 13 2 text ["Hello there,", "how are [...]"] testWrapLines 80 1 text [text] testWrapLines 12 6 text [ "Hello there," , "how are you" , "this fine" , "day? I'm" , "glad to hear" , "it!" ] describe "Spaces" $ do it "strips spaces before the placeholder" $ testWrapLines 12 4 text [ "Hello there," , "how are you" , "this fine" , "day? [...]" ] it "puts the placeholder at the start of the line if nothing fits" $ testWrapLines 6 2 text ["Hello", "[...]"] it "doesn't use a placeholder for trailing spaces" $ testWrapLines 12 6 (text `T.append` T.replicate 10 " ") [ "Hello there," , "how are you" , "this fine" , "day? I'm" , "glad to hear" , "it!" ] describe "Placeholder" $ do let check w lns plc txt expected = TW.wrap testConfig{ width = w, maxLines = Just lns, placeholder = plc } txt `shouldBe` Right expected it "takes a custom placeholder" $ do check 12 1 "..." text ["Hello..."] check 12 2 "..." text ["Hello there,", "how are..."] it "returns nothing when the placeholder and indentation are too long" $ do TW.wrap testConfig{ width = 16 , maxLines = Just 1 , initialIndent = " " , placeholder = " [truncated]..." } text `shouldBe` Left TW.PlaceholderTooLarge TW.wrap testConfig{ width = 16 , maxLines = Just 2 , subsequentIndent = " " , placeholder = " [truncated]..." } text `shouldBe` Left TW.PlaceholderTooLarge it "handles long placeholders and indentation" $ do testWrap testConfig{ width = 16 , maxLines = Just 2 , initialIndent = " " , subsequentIndent = " " , placeholder = " [truncated]..." } text [" Hello there,", " [truncated]..."] testWrap testConfig{ width = 16 , maxLines = Just 1 , initialIndent = " " , subsequentIndent = " " , placeholder = " [truncated]..." } text [" [truncated]..."] testWrap testConfig{ width = 80, placeholder = T.replicate 1000 "." } text [text]
2,897
false
true
0
18
1,144
645
335
310
null
null
pbl64k/HackerRank-Contests
2014-10-10-FP/Infer/i.nlp.hs
bsd-2-clause
display t = (if c > 'a' then "forall[" ++ intercalate " " ((: []) `map` ['a' .. pred c]) ++ "] " else "") ++ str where (str, c, m) = disp 'a' M.empty t
163
display t = (if c > 'a' then "forall[" ++ intercalate " " ((: []) `map` ['a' .. pred c]) ++ "] " else "") ++ str where (str, c, m) = disp 'a' M.empty t
163
display t = (if c > 'a' then "forall[" ++ intercalate " " ((: []) `map` ['a' .. pred c]) ++ "] " else "") ++ str where (str, c, m) = disp 'a' M.empty t
163
false
false
0
14
47
91
50
41
null
null
olorin/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/Types/Product.hs
mpl-2.0
-- | The default value for this configuration option. codDefaultValue :: Lens' ConfigurationOptionDescription (Maybe Text) codDefaultValue = lens _codDefaultValue (\ s a -> s{_codDefaultValue = a})
197
codDefaultValue :: Lens' ConfigurationOptionDescription (Maybe Text) codDefaultValue = lens _codDefaultValue (\ s a -> s{_codDefaultValue = a})
143
codDefaultValue = lens _codDefaultValue (\ s a -> s{_codDefaultValue = a})
74
true
true
0
9
25
46
25
21
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Metadata.hs
bsd-3-clause
defBase ∷ Base defBase = Base Nothing Nothing Nothing Nothing
61
defBase ∷ Base defBase = Base Nothing Nothing Nothing Nothing
61
defBase = Base Nothing Nothing Nothing Nothing
46
false
true
0
5
9
20
10
10
null
null
gridaphobe/target
examples/XMonad/Properties.hs
mit
prop_swap_right_local (x :: T) = hidden_spaces x == hidden_spaces (swapDown x)
80
prop_swap_right_local (x :: T) = hidden_spaces x == hidden_spaces (swapDown x)
80
prop_swap_right_local (x :: T) = hidden_spaces x == hidden_spaces (swapDown x)
80
false
false
0
8
12
32
15
17
null
null
kishoredbn/barrelfish
tools/sockeye/SockeyeParser.hs
mit
typeName = identString <?> "type name"
44
typeName = identString <?> "type name"
44
typeName = identString <?> "type name"
44
false
false
0
5
11
10
5
5
null
null
ajnsit/haste-markup
src/Util/GenerateHtmlCombinators.hs
mit
-- | A warning to not edit the generated code. -- doNotEdit :: FilePath -> Int -> String doNotEdit fileName lineNumber = init $ unlines [ "-- WARNING: The next block of code was automatically generated by" , "-- " ++ fileName ++ ":" ++ show lineNumber , "--" ]
276
doNotEdit :: FilePath -> Int -> String doNotEdit fileName lineNumber = init $ unlines [ "-- WARNING: The next block of code was automatically generated by" , "-- " ++ fileName ++ ":" ++ show lineNumber , "--" ]
226
doNotEdit fileName lineNumber = init $ unlines [ "-- WARNING: The next block of code was automatically generated by" , "-- " ++ fileName ++ ":" ++ show lineNumber , "--" ]
187
true
true
0
8
65
57
30
27
null
null
ford-prefect/haskell-gi
lib/Data/GI/GIR/Type.hs
lgpl-2.1
nameToBasicType "guint64" = Just TUInt64
41
nameToBasicType "guint64" = Just TUInt64
41
nameToBasicType "guint64" = Just TUInt64
41
false
false
0
5
5
12
5
7
null
null
bnarnold/Penrose
src/Main.hs
bsd-3-clause
main = getLine >>= draw . Scale 500 500 . (tilingPics!!) . read
63
main = getLine >>= draw . Scale 500 500 . (tilingPics!!) . read
63
main = getLine >>= draw . Scale 500 500 . (tilingPics!!) . read
63
false
false
0
8
12
31
16
15
null
null
antalsz/hs-to-coq
examples/ghc/gen-files/Lexer.hs
mit
generateSemic, dontGenerateSemic :: GenSemic generateSemic = True
69
generateSemic, dontGenerateSemic :: GenSemic generateSemic = True
69
generateSemic = True
24
false
true
0
4
10
13
8
5
null
null
aisamanra/matterhorn
src/Draw/ChannelList.hs
bsd-3-clause
renderChannelSelectListEntry :: Maybe MatchValue -> (Text -> MatchValue) -> SelectedChannelListEntry -> Widget Name renderChannelSelectListEntry selMatch mkMatchValue (SCLE entry match) = let ChannelSelectMatch preMatch inMatch postMatch fullName = match maybeSelect = if Just (mkMatchValue fullName) == selMatch then visible . withDefAttr currentChannelNameAttr else id in maybeSelect $ decorateRecent entry $ padRight Max $ hBox [ txt $ entrySigil entry , txt preMatch , forceAttr channelSelectMatchAttr $ txt inMatch , txt postMatch ]
676
renderChannelSelectListEntry :: Maybe MatchValue -> (Text -> MatchValue) -> SelectedChannelListEntry -> Widget Name renderChannelSelectListEntry selMatch mkMatchValue (SCLE entry match) = let ChannelSelectMatch preMatch inMatch postMatch fullName = match maybeSelect = if Just (mkMatchValue fullName) == selMatch then visible . withDefAttr currentChannelNameAttr else id in maybeSelect $ decorateRecent entry $ padRight Max $ hBox [ txt $ entrySigil entry , txt preMatch , forceAttr channelSelectMatchAttr $ txt inMatch , txt postMatch ]
676
renderChannelSelectListEntry selMatch mkMatchValue (SCLE entry match) = let ChannelSelectMatch preMatch inMatch postMatch fullName = match maybeSelect = if Just (mkMatchValue fullName) == selMatch then visible . withDefAttr currentChannelNameAttr else id in maybeSelect $ decorateRecent entry $ padRight Max $ hBox [ txt $ entrySigil entry , txt preMatch , forceAttr channelSelectMatchAttr $ txt inMatch , txt postMatch ]
560
false
true
0
13
209
162
77
85
null
null
nomeata/codeworld
codeworld-prediction/src/CodeWorld/Prediction/Trivial.hs
apache-2.0
-- Move state forward in fixed animation rate steps, and get -- the timestamp as close to the given target as possible, and then do a final small step timePasses :: StepFun s -> AnimationRate -> Timestamp -> TState s -> TState s timePasses step rate target = stepTo step target . timePassesBigStep step rate target
318
timePasses :: StepFun s -> AnimationRate -> Timestamp -> TState s -> TState s timePasses step rate target = stepTo step target . timePassesBigStep step rate target
167
timePasses step rate target = stepTo step target . timePassesBigStep step rate target
89
true
true
0
9
59
61
29
32
null
null
karamellpelle/MEnv
source/OpenGL/IOS/Values.hs
bsd-2-clause
gl_STENCIL_INDEX :: GLenum gl_STENCIL_INDEX = 0x1901
85
gl_STENCIL_INDEX :: GLenum gl_STENCIL_INDEX = 0x1901
85
gl_STENCIL_INDEX = 0x1901
58
false
true
0
4
38
11
6
5
null
null
futufeld/eclogues
eclogues-impl/gen-hs/AuroraSchedulerManager.hs
bsd-3-clause
encode_ReplaceCronTemplate_result :: (T.Protocol p, T.Transport t) => p t -> ReplaceCronTemplate_result -> LBS.ByteString encode_ReplaceCronTemplate_result oprot record = T.serializeVal oprot $ from_ReplaceCronTemplate_result record
232
encode_ReplaceCronTemplate_result :: (T.Protocol p, T.Transport t) => p t -> ReplaceCronTemplate_result -> LBS.ByteString encode_ReplaceCronTemplate_result oprot record = T.serializeVal oprot $ from_ReplaceCronTemplate_result record
232
encode_ReplaceCronTemplate_result oprot record = T.serializeVal oprot $ from_ReplaceCronTemplate_result record
110
false
true
0
8
21
60
29
31
null
null
s9gf4ult/yesod
yesod-static/Yesod/EmbeddedStatic.hs
mit
mkRoute :: ComputedEntry -> Q [Dec] mkRoute (ComputedEntry { cHaskellName = Nothing }) = return []
98
mkRoute :: ComputedEntry -> Q [Dec] mkRoute (ComputedEntry { cHaskellName = Nothing }) = return []
98
mkRoute (ComputedEntry { cHaskellName = Nothing }) = return []
62
false
true
0
9
15
41
21
20
null
null
gustavoramos00/tecnicas-topdown
S8_4.hs
mit
graphEx::(Graph Int Int) graphEx = mkGraph True (1,5) [(1,2,12),(1,3,34),(1,5,78),(2,1,12),(2,5,32),(2,4,55), (3,1,34),(3,5,44),(3,4,61),(4,2,55),(4,3,61),(4,5,93), (5,1,78),(5,2,32),(5,3,44),(5,4,93)]
236
graphEx::(Graph Int Int) graphEx = mkGraph True (1,5) [(1,2,12),(1,3,34),(1,5,78),(2,1,12),(2,5,32),(2,4,55), (3,1,34),(3,5,44),(3,4,61),(4,2,55),(4,3,61),(4,5,93), (5,1,78),(5,2,32),(5,3,44),(5,4,93)]
236
graphEx = mkGraph True (1,5) [(1,2,12),(1,3,34),(1,5,78),(2,1,12),(2,5,32),(2,4,55), (3,1,34),(3,5,44),(3,4,61),(4,2,55),(4,3,61),(4,5,93), (5,1,78),(5,2,32),(5,3,44),(5,4,93)]
211
false
true
0
8
45
233
146
87
null
null
florianpilz/autotool
src/Baum/AVL/Type.hs
gpl-2.0
leaf = Leaf { weight = 0, height = 0 }
39
leaf = Leaf { weight = 0, height = 0 }
39
leaf = Leaf { weight = 0, height = 0 }
39
false
false
0
6
11
20
12
8
null
null
madjar/fhue
src/Network/Wreq/Extras.hs
bsd-3-clause
partFileWithProgress :: Text -> FilePath -> Part partFileWithProgress name file = partFileRequestBodyM name file $ do size <- withBinaryFile file ReadMode hFileSize pg <- liftIO $ newProgressBar def { pgTotal = size } let source = sourceFile file =$= updateProgress pg return $ requestBodySource (fromIntegral size) source -- From https://github.com/yamadapc/haskell-ascii-progress/blob/master/bin/DownloadExample.hs
426
partFileWithProgress :: Text -> FilePath -> Part partFileWithProgress name file = partFileRequestBodyM name file $ do size <- withBinaryFile file ReadMode hFileSize pg <- liftIO $ newProgressBar def { pgTotal = size } let source = sourceFile file =$= updateProgress pg return $ requestBodySource (fromIntegral size) source -- From https://github.com/yamadapc/haskell-ascii-progress/blob/master/bin/DownloadExample.hs
426
partFileWithProgress name file = partFileRequestBodyM name file $ do size <- withBinaryFile file ReadMode hFileSize pg <- liftIO $ newProgressBar def { pgTotal = size } let source = sourceFile file =$= updateProgress pg return $ requestBodySource (fromIntegral size) source -- From https://github.com/yamadapc/haskell-ascii-progress/blob/master/bin/DownloadExample.hs
377
false
true
0
12
59
107
50
57
null
null
silkapp/generic-aeson
src/Generics/Generic/Aeson/Util.hs
bsd-3-clause
stripTrailingUnderscore :: Text -> Text stripTrailingUnderscore x = fromMaybe x $ T.stripSuffix "_" x
101
stripTrailingUnderscore :: Text -> Text stripTrailingUnderscore x = fromMaybe x $ T.stripSuffix "_" x
101
stripTrailingUnderscore x = fromMaybe x $ T.stripSuffix "_" x
61
false
true
0
7
13
32
15
17
null
null
robrix/ui-effects
src/Data/Functor/Algebraic.hs
bsd-3-clause
annotatingBidi :: Algebra (Bidi (FreerF f c) b) a -> Algebra (Bidi (FreerF f c) b) (Cofreer (FreerF f c) a) annotatingBidi algebra base = Cofree (algebra (extract <$> base)) (tailF base) id
189
annotatingBidi :: Algebra (Bidi (FreerF f c) b) a -> Algebra (Bidi (FreerF f c) b) (Cofreer (FreerF f c) a) annotatingBidi algebra base = Cofree (algebra (extract <$> base)) (tailF base) id
189
annotatingBidi algebra base = Cofree (algebra (extract <$> base)) (tailF base) id
81
false
true
0
10
32
104
51
53
null
null
JustusAdam/marvin
src/Marvin/Run.hs
bsd-3-clause
-- | Retrieve a value from the application config, given the whole config structure. Fails if value not parseable as @a@ or not present. requireFromAppConfig :: (Configured a, MonadIO m) => Config -> Name -> m a requireFromAppConfig cfg n = do subconf <- subconfig (unwrapScriptId applicationScriptId) cfg require subconf n -- | Retrieve a value from the application config, given the whole config structure. -- Returns 'Nothing' if value not parseable as @a@ or not present.
485
requireFromAppConfig :: (Configured a, MonadIO m) => Config -> Name -> m a requireFromAppConfig cfg n = do subconf <- subconfig (unwrapScriptId applicationScriptId) cfg require subconf n -- | Retrieve a value from the application config, given the whole config structure. -- Returns 'Nothing' if value not parseable as @a@ or not present.
348
requireFromAppConfig cfg n = do subconf <- subconfig (unwrapScriptId applicationScriptId) cfg require subconf n -- | Retrieve a value from the application config, given the whole config structure. -- Returns 'Nothing' if value not parseable as @a@ or not present.
273
true
true
0
10
86
71
35
36
null
null
genos/Programming
workbench/ebmc/src/Main.hs
mit
main :: IO () main = do mts <- scrapeURL url allTweets case mts of Nothing -> die "Unable to scrape tweets" Just ts -> T.putStrLn . fmt =<< randomTweet ts
166
main :: IO () main = do mts <- scrapeURL url allTweets case mts of Nothing -> die "Unable to scrape tweets" Just ts -> T.putStrLn . fmt =<< randomTweet ts
166
main = do mts <- scrapeURL url allTweets case mts of Nothing -> die "Unable to scrape tweets" Just ts -> T.putStrLn . fmt =<< randomTweet ts
152
false
true
0
12
42
66
30
36
null
null
rasata/iyql
src/main/haskell/Yql/UI/Cli.hs
gpl-3.0
iyql :: (SessionMgr s,Yql y) => s -> y -> IO () iyql s y0 = do { y <- putenvM y0 ; alltables <- runShowTables y ; cmdDB <- cmdDBM s y0 ; funcDB <- funcDBM ; myCfg <- fmap (settings (mkTrie cmdDB funcDB alltables)) basedir ; runInputT myCfg (run s y) } where settings trie home = Settings { complete = let func = return . completeCli trie in completeQuotedWord (Just '\\') "\"'" func (completeWord (Just '\\') " \t;" func) , historyFile = Just $ joinPath [home,"history"] , autoAddHistory = False } mkTrie cmdDB funcDB alltables = fromList . concat $ [ allcommands , allfunctions , keywords , alltables ] where allcommands = map (':':) (M.keys cmdDB) allfunctions = map ('.':) (M.keys funcDB)
1,262
iyql :: (SessionMgr s,Yql y) => s -> y -> IO () iyql s y0 = do { y <- putenvM y0 ; alltables <- runShowTables y ; cmdDB <- cmdDBM s y0 ; funcDB <- funcDBM ; myCfg <- fmap (settings (mkTrie cmdDB funcDB alltables)) basedir ; runInputT myCfg (run s y) } where settings trie home = Settings { complete = let func = return . completeCli trie in completeQuotedWord (Just '\\') "\"'" func (completeWord (Just '\\') " \t;" func) , historyFile = Just $ joinPath [home,"history"] , autoAddHistory = False } mkTrie cmdDB funcDB alltables = fromList . concat $ [ allcommands , allfunctions , keywords , alltables ] where allcommands = map (':':) (M.keys cmdDB) allfunctions = map ('.':) (M.keys funcDB)
1,262
iyql s y0 = do { y <- putenvM y0 ; alltables <- runShowTables y ; cmdDB <- cmdDBM s y0 ; funcDB <- funcDBM ; myCfg <- fmap (settings (mkTrie cmdDB funcDB alltables)) basedir ; runInputT myCfg (run s y) } where settings trie home = Settings { complete = let func = return . completeCli trie in completeQuotedWord (Just '\\') "\"'" func (completeWord (Just '\\') " \t;" func) , historyFile = Just $ joinPath [home,"history"] , autoAddHistory = False } mkTrie cmdDB funcDB alltables = fromList . concat $ [ allcommands , allfunctions , keywords , alltables ] where allcommands = map (':':) (M.keys cmdDB) allfunctions = map ('.':) (M.keys funcDB)
1,214
false
true
0
13
695
315
158
157
null
null
leshchevds/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
ssInstanceList :: String ssInstanceList = "instance_list"
57
ssInstanceList :: String ssInstanceList = "instance_list"
57
ssInstanceList = "instance_list"
32
false
true
0
4
5
11
6
5
null
null
mike-burns/this-week-in-open-source
Main.hs
bsd-3-clause
userLink login content = "<a href=\"http://github.com/" ++ login ++ "\" title=\"" ++ login ++ "\">" ++ content ++ "</a>"
126
userLink login content = "<a href=\"http://github.com/" ++ login ++ "\" title=\"" ++ login ++ "\">" ++ content ++ "</a>"
126
userLink login content = "<a href=\"http://github.com/" ++ login ++ "\" title=\"" ++ login ++ "\">" ++ content ++ "</a>"
126
false
false
0
10
24
35
17
18
null
null
msullivan/advent-of-code
2017/Template.hs
mit
do2 f g x = (f x, g x)
22
do2 f g x = (f x, g x)
22
do2 f g x = (f x, g x)
22
false
false
1
7
8
31
12
19
null
null
fmapfmapfmap/amazonka
amazonka-ssm/gen/Network/AWS/SSM/Types/Product.hs
mpl-2.0
-- | The value of the filter. dfValue :: Lens' DocumentFilter Text dfValue = lens _dfValue (\ s a -> s{_dfValue = a})
117
dfValue :: Lens' DocumentFilter Text dfValue = lens _dfValue (\ s a -> s{_dfValue = a})
87
dfValue = lens _dfValue (\ s a -> s{_dfValue = a})
50
true
true
1
9
22
46
22
24
null
null
prash471/GraphDraw
GraphDraw/TestFgl.hs
bsd-3-clause
updateLoc :: ((Double,Double),(Double,Double)) -> ((Double,Double),(Double,Double)) updateLoc l = newl where ((f1,f2),(x,y)) = l newl = ((f1,f2),(f1,f2))
179
updateLoc :: ((Double,Double),(Double,Double)) -> ((Double,Double),(Double,Double)) updateLoc l = newl where ((f1,f2),(x,y)) = l newl = ((f1,f2),(f1,f2))
179
updateLoc l = newl where ((f1,f2),(x,y)) = l newl = ((f1,f2),(f1,f2))
95
false
true
1
7
41
105
64
41
null
null
geophf/1HaskellADay
exercises/HAD/Y2020/M11/D20/Exercise.hs
mit
{-- >>> :set -XOverloadedStrings >>> airbasesOf abc cim "Belgium" Just (AirPower (CI {country = WD {qid = "http://www.wikidata.org/entity/Q31",... 3. Output the XML for the country and its airbases, something like: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.0"> <Document> <name>Belgium's Air Power</name> <Folder> <name>Belgium</name> <Description>It's Tuesday</Description> <Placemark> <name>Brussels</name> <Description>Capital</Description> <Point> <coordinates>4.351666666,50.846666666,1000.0</coordinates> </Point> </Placemark> <Folder> <name>Air Bases</name> <Folder> <name>Jehonville Air Base</name> <Placemark> <name>Jehonville Air Base</name> <Point> <coordinates>5.22389,49.89167,1000.0</coordinates> </Point> </Placemark> <Placemark> <name>Brussels - Jehonville Air Base</name> <LineString> <coordinates> 4.351666666,50.846666666,1000.0 5.22389,49.89167,1000.0 </coordinates> </LineString> </Placemark> </Folder> ... A sample, demonstrative, KML is located in this directory. --} belgianDir :: FilePath belgianDir = "Y2020/M11/D20/"
1,238
belgianDir :: FilePath belgianDir = "Y2020/M11/D20/"
52
belgianDir = "Y2020/M11/D20/"
29
true
true
0
6
251
19
8
11
null
null
dmalikov/posets
src/Data/Poset.hs
mit
-- | Find LowerCone of Poset element -- LowerCone is a set of elements connected with element by Binary Relation ρ -- lowerCone ∷ Eq α ⇒ Poset α → α → [α] lowerCone (Poset es ρ) a = [ b | b ← es, b `ρ` a ]
206
lowerCone ∷ Eq α ⇒ Poset α → α → [α] lowerCone (Poset es ρ) a = [ b | b ← es, b `ρ` a ]
87
lowerCone (Poset es ρ) a = [ b | b ← es, b `ρ` a ]
50
true
true
0
8
49
69
37
32
null
null
buckie/juno
src/Juno/Hoplite/Eval.hs
bsd-3-clause
applyPrim :: (Ord ty,Show ty) => ExpContext ty Ref -> PrimOpId -> [Ref] -> InterpStack s ty b (HeapVal (Exp ty), Ref) applyPrim ctxt opid argsRef = do resPair <- applyPrimDemo opid argsRef applyStack ctxt resPair
226
applyPrim :: (Ord ty,Show ty) => ExpContext ty Ref -> PrimOpId -> [Ref] -> InterpStack s ty b (HeapVal (Exp ty), Ref) applyPrim ctxt opid argsRef = do resPair <- applyPrimDemo opid argsRef applyStack ctxt resPair
226
applyPrim ctxt opid argsRef = do resPair <- applyPrimDemo opid argsRef applyStack ctxt resPair
98
false
true
0
13
49
97
47
50
null
null
foreverbell/project-euler-solutions
src/17.hs
bsd-3-clause
numberToWord 7 = "seven"
24
numberToWord 7 = "seven"
24
numberToWord 7 = "seven"
24
false
false
0
5
3
9
4
5
null
null
phadej/reflex
src/Reflex/Spider/Internal.hs
bsd-3-clause
newInvalidatorPull :: Pull a -> IO Invalidator newInvalidatorPull p = return $! InvalidatorPull p
97
newInvalidatorPull :: Pull a -> IO Invalidator newInvalidatorPull p = return $! InvalidatorPull p
97
newInvalidatorPull p = return $! InvalidatorPull p
50
false
true
2
7
13
36
15
21
null
null
TomMD/cryptol
src/Cryptol/TypeCheck/Solver/Eval.hs
bsd-3-clause
tfMul :: OrdFacts -> Type -> Type -> Maybe Type tfMul i t1 t2 | Just (Nat 0) <- arg1 = Just t1 | Just (Nat 1) <- arg1 = Just t2 | Just (Nat 0) <- arg2 = Just t2 | Just (Nat 1) <- arg2 = Just t1 | Just Inf <- arg1 , oneOrMore i t2 = Just tInf | Just Inf <- arg2 , oneOrMore i t1 = Just tInf | Just (Nat x) <- arg1 , Just (Nat y) <- arg2 = Just $ tNum $ x * y -- k1 * (k2 * t) = (k1 * k2) * t | Just k1 <- arg1 , TCon (TF TCMul) [s1,s2] <- t2 , Just k2 <- toNat' s1 = Just $ fromNat' (nMul k1 k2) .*. s2 | otherwise = Nothing where arg1 = toNat' t1 arg2 = toNat' t2 {- y * q + r = x x / y = q with remainder r 0 <= r && r < y -}
718
tfMul :: OrdFacts -> Type -> Type -> Maybe Type tfMul i t1 t2 | Just (Nat 0) <- arg1 = Just t1 | Just (Nat 1) <- arg1 = Just t2 | Just (Nat 0) <- arg2 = Just t2 | Just (Nat 1) <- arg2 = Just t1 | Just Inf <- arg1 , oneOrMore i t2 = Just tInf | Just Inf <- arg2 , oneOrMore i t1 = Just tInf | Just (Nat x) <- arg1 , Just (Nat y) <- arg2 = Just $ tNum $ x * y -- k1 * (k2 * t) = (k1 * k2) * t | Just k1 <- arg1 , TCon (TF TCMul) [s1,s2] <- t2 , Just k2 <- toNat' s1 = Just $ fromNat' (nMul k1 k2) .*. s2 | otherwise = Nothing where arg1 = toNat' t1 arg2 = toNat' t2 {- y * q + r = x x / y = q with remainder r 0 <= r && r < y -}
718
tfMul i t1 t2 | Just (Nat 0) <- arg1 = Just t1 | Just (Nat 1) <- arg1 = Just t2 | Just (Nat 0) <- arg2 = Just t2 | Just (Nat 1) <- arg2 = Just t1 | Just Inf <- arg1 , oneOrMore i t2 = Just tInf | Just Inf <- arg2 , oneOrMore i t1 = Just tInf | Just (Nat x) <- arg1 , Just (Nat y) <- arg2 = Just $ tNum $ x * y -- k1 * (k2 * t) = (k1 * k2) * t | Just k1 <- arg1 , TCon (TF TCMul) [s1,s2] <- t2 , Just k2 <- toNat' s1 = Just $ fromNat' (nMul k1 k2) .*. s2 | otherwise = Nothing where arg1 = toNat' t1 arg2 = toNat' t2 {- y * q + r = x x / y = q with remainder r 0 <= r && r < y -}
670
false
true
2
11
261
368
165
203
null
null
vTurbine/ghc
compiler/types/InstEnv.hs
bsd-3-clause
mkLocalInstance :: DFunId -> OverlapFlag -> [TyVar] -> Class -> [Type] -> ClsInst -- Used for local instances, where we can safely pull on the DFunId. -- Consider using newClsInst instead; this will also warn if -- the instance is an orphan. mkLocalInstance dfun oflag tvs cls tys = ClsInst { is_flag = oflag, is_dfun = dfun , is_tvs = tvs , is_cls = cls, is_cls_nm = cls_name , is_tys = tys, is_tcs = roughMatchTcs tys , is_orphan = orph } where cls_name = className cls dfun_name = idName dfun this_mod = ASSERT( isExternalName dfun_name ) nameModule dfun_name is_local name = nameIsLocalOrFrom this_mod name -- Compute orphanhood. See Note [Orphans] in InstEnv (cls_tvs, fds) = classTvsFds cls arg_names = [filterNameSet is_local (orphNamesOfType ty) | ty <- tys] -- See Note [When exactly is an instance decl an orphan?] orph | is_local cls_name = NotOrphan (nameOccName cls_name) | all notOrphan mb_ns = ASSERT( not (null mb_ns) ) head mb_ns | otherwise = IsOrphan notOrphan NotOrphan{} = True notOrphan _ = False mb_ns :: [IsOrphan] -- One for each fundep; a locally-defined name -- that is not in the "determined" arguments mb_ns | null fds = [choose_one arg_names] | otherwise = map do_one fds do_one (_ltvs, rtvs) = choose_one [ns | (tv,ns) <- cls_tvs `zip` arg_names , not (tv `elem` rtvs)] choose_one nss = chooseOrphanAnchor (unionNameSets nss)
1,636
mkLocalInstance :: DFunId -> OverlapFlag -> [TyVar] -> Class -> [Type] -> ClsInst mkLocalInstance dfun oflag tvs cls tys = ClsInst { is_flag = oflag, is_dfun = dfun , is_tvs = tvs , is_cls = cls, is_cls_nm = cls_name , is_tys = tys, is_tcs = roughMatchTcs tys , is_orphan = orph } where cls_name = className cls dfun_name = idName dfun this_mod = ASSERT( isExternalName dfun_name ) nameModule dfun_name is_local name = nameIsLocalOrFrom this_mod name -- Compute orphanhood. See Note [Orphans] in InstEnv (cls_tvs, fds) = classTvsFds cls arg_names = [filterNameSet is_local (orphNamesOfType ty) | ty <- tys] -- See Note [When exactly is an instance decl an orphan?] orph | is_local cls_name = NotOrphan (nameOccName cls_name) | all notOrphan mb_ns = ASSERT( not (null mb_ns) ) head mb_ns | otherwise = IsOrphan notOrphan NotOrphan{} = True notOrphan _ = False mb_ns :: [IsOrphan] -- One for each fundep; a locally-defined name -- that is not in the "determined" arguments mb_ns | null fds = [choose_one arg_names] | otherwise = map do_one fds do_one (_ltvs, rtvs) = choose_one [ns | (tv,ns) <- cls_tvs `zip` arg_names , not (tv `elem` rtvs)] choose_one nss = chooseOrphanAnchor (unionNameSets nss)
1,476
mkLocalInstance dfun oflag tvs cls tys = ClsInst { is_flag = oflag, is_dfun = dfun , is_tvs = tvs , is_cls = cls, is_cls_nm = cls_name , is_tys = tys, is_tcs = roughMatchTcs tys , is_orphan = orph } where cls_name = className cls dfun_name = idName dfun this_mod = ASSERT( isExternalName dfun_name ) nameModule dfun_name is_local name = nameIsLocalOrFrom this_mod name -- Compute orphanhood. See Note [Orphans] in InstEnv (cls_tvs, fds) = classTvsFds cls arg_names = [filterNameSet is_local (orphNamesOfType ty) | ty <- tys] -- See Note [When exactly is an instance decl an orphan?] orph | is_local cls_name = NotOrphan (nameOccName cls_name) | all notOrphan mb_ns = ASSERT( not (null mb_ns) ) head mb_ns | otherwise = IsOrphan notOrphan NotOrphan{} = True notOrphan _ = False mb_ns :: [IsOrphan] -- One for each fundep; a locally-defined name -- that is not in the "determined" arguments mb_ns | null fds = [choose_one arg_names] | otherwise = map do_one fds do_one (_ltvs, rtvs) = choose_one [ns | (tv,ns) <- cls_tvs `zip` arg_names , not (tv `elem` rtvs)] choose_one nss = chooseOrphanAnchor (unionNameSets nss)
1,362
true
true
0
10
504
400
211
189
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'VG.scanl1' vg_scanl1 = VG.scanl1
37
vg_scanl1 = VG.scanl1
21
vg_scanl1 = VG.scanl1
21
true
false
0
5
4
9
5
4
null
null
romanb/amazonka
amazonka-cognito-sync/gen/Network/AWS/CognitoSync/UnsubscribeFromDataset.hs
mpl-2.0
-- | The name of the dataset from which to unsubcribe. ufdDatasetName :: Lens' UnsubscribeFromDataset Text ufdDatasetName = lens _ufdDatasetName (\s a -> s { _ufdDatasetName = a })
180
ufdDatasetName :: Lens' UnsubscribeFromDataset Text ufdDatasetName = lens _ufdDatasetName (\s a -> s { _ufdDatasetName = a })
125
ufdDatasetName = lens _ufdDatasetName (\s a -> s { _ufdDatasetName = a })
73
true
true
0
9
28
40
22
18
null
null
gallais/potpourri
haskell/poc/LEM.hs
gpl-3.0
-- | @lem@ evaluates the continuation with a negative answer in an environment where -- the tags have been incremented by one. -- If the user tries to use that negative information, they must provide us with -- evidence which we promptly return in a @Backtrack@. We recover from the error -- by restarting the continuation with a positive answer using the evidence we -- were just provided. lem :: forall a b ss m. (Monad m, Typeable a, NFData a, NFData b) => (forall s. Either a (a -> LEMT (s ': ss) m Void) -> LEMT (s ': ss) m b) -> LEMT ss m b lem k = LEMT $ do i <- ask local (const (i+1)) (runLEMT $ k $ Right $ \ a -> rnf a `seq` throwError (Backtrack i $ toDyn a)) `catchError` \ e -> case e of -- It is crucial here to make sure that the @Backtrack@ we get corresponds to this -- use of @lem@. Otherwise the call to @fromDyn@ would probably fail to typecheck. -- If we are talking about an earlier call, we propagate the @Backtrack@ by re-throwing -- the error. Backtrack i' v | i == i' -> runLEMT $ k (Left $ fromDyn v undefined) _ -> throwError e
1,093
lem :: forall a b ss m. (Monad m, Typeable a, NFData a, NFData b) => (forall s. Either a (a -> LEMT (s ': ss) m Void) -> LEMT (s ': ss) m b) -> LEMT ss m b lem k = LEMT $ do i <- ask local (const (i+1)) (runLEMT $ k $ Right $ \ a -> rnf a `seq` throwError (Backtrack i $ toDyn a)) `catchError` \ e -> case e of -- It is crucial here to make sure that the @Backtrack@ we get corresponds to this -- use of @lem@. Otherwise the call to @fromDyn@ would probably fail to typecheck. -- If we are talking about an earlier call, we propagate the @Backtrack@ by re-throwing -- the error. Backtrack i' v | i == i' -> runLEMT $ k (Left $ fromDyn v undefined) _ -> throwError e
691
lem k = LEMT $ do i <- ask local (const (i+1)) (runLEMT $ k $ Right $ \ a -> rnf a `seq` throwError (Backtrack i $ toDyn a)) `catchError` \ e -> case e of -- It is crucial here to make sure that the @Backtrack@ we get corresponds to this -- use of @lem@. Otherwise the call to @fromDyn@ would probably fail to typecheck. -- If we are talking about an earlier call, we propagate the @Backtrack@ by re-throwing -- the error. Backtrack i' v | i == i' -> runLEMT $ k (Left $ fromDyn v undefined) _ -> throwError e
528
true
true
0
19
249
271
141
130
null
null
urbanslug/ghc
libraries/base/Data/Data.hs
bsd-3-clause
justConstr :: Constr justConstr = mkConstr maybeDataType "Just" [] Prefix
79
justConstr :: Constr justConstr = mkConstr maybeDataType "Just" [] Prefix
79
justConstr = mkConstr maybeDataType "Just" [] Prefix
58
false
true
0
6
15
29
12
17
null
null
arjunguha/haskell-couchdb
src/Database/CouchDB.hs
bsd-3-clause
isDocString (first:rest) = isFirstDocChar first && and (map isDocChar rest)
75
isDocString (first:rest) = isFirstDocChar first && and (map isDocChar rest)
75
isDocString (first:rest) = isFirstDocChar first && and (map isDocChar rest)
75
false
false
0
8
9
34
16
18
null
null
narurien/ganeti-ceph
src/Ganeti/HTools/CLI.hs
gpl-2.0
oDiskTemplate :: OptType oDiskTemplate = (Option "" ["disk-template"] (reqWithConversion diskTemplateFromRaw (\dt opts -> Ok opts { optDiskTemplate = Just dt }) "TEMPLATE") "select the desired disk template", optComplDiskTemplate)
246
oDiskTemplate :: OptType oDiskTemplate = (Option "" ["disk-template"] (reqWithConversion diskTemplateFromRaw (\dt opts -> Ok opts { optDiskTemplate = Just dt }) "TEMPLATE") "select the desired disk template", optComplDiskTemplate)
246
oDiskTemplate = (Option "" ["disk-template"] (reqWithConversion diskTemplateFromRaw (\dt opts -> Ok opts { optDiskTemplate = Just dt }) "TEMPLATE") "select the desired disk template", optComplDiskTemplate)
221
false
true
0
14
43
63
34
29
null
null
eliben/code-for-blog
2017/folds/hsfolds.hs
unlicense
mydouble (x:xs) = [2 * x] ++ mydouble xs
40
mydouble (x:xs) = [2 * x] ++ mydouble xs
40
mydouble (x:xs) = [2 * x] ++ mydouble xs
40
false
false
2
6
8
32
15
17
null
null
thoughtbot/yesod-auth-oauth2
src/Yesod/Auth/OAuth2/EveOnline.hs
mit
oauth2EveScoped :: YesodAuth m => [Text] -> WidgetType m -> Text -> Text -> AuthPlugin m oauth2EveScoped scopes widgetType clientId clientSecret = authOAuth2Widget (asWidget widgetType) pluginName oauth2 $ \manager token -> do (User userId, userResponse) <- authGetProfile pluginName manager token "https://login.eveonline.com/oauth/verify" pure Creds { credsPlugin = "eveonline" -- FIXME: Preserved bug. See similar comment in Bitbucket provider. , credsIdent = T.pack $ show userId , credsExtra = setExtra token userResponse } where oauth2 = OAuth2 { oauthClientId = clientId , oauthClientSecret = Just clientSecret , oauthOAuthorizeEndpoint = "https://login.eveonline.com/oauth/authorize" `withQuery` [("response_type", "code"), scopeParam " " scopes] , oauthAccessTokenEndpoint = "https://login.eveonline.com/oauth/token" , oauthCallback = Nothing }
1,142
oauth2EveScoped :: YesodAuth m => [Text] -> WidgetType m -> Text -> Text -> AuthPlugin m oauth2EveScoped scopes widgetType clientId clientSecret = authOAuth2Widget (asWidget widgetType) pluginName oauth2 $ \manager token -> do (User userId, userResponse) <- authGetProfile pluginName manager token "https://login.eveonline.com/oauth/verify" pure Creds { credsPlugin = "eveonline" -- FIXME: Preserved bug. See similar comment in Bitbucket provider. , credsIdent = T.pack $ show userId , credsExtra = setExtra token userResponse } where oauth2 = OAuth2 { oauthClientId = clientId , oauthClientSecret = Just clientSecret , oauthOAuthorizeEndpoint = "https://login.eveonline.com/oauth/authorize" `withQuery` [("response_type", "code"), scopeParam " " scopes] , oauthAccessTokenEndpoint = "https://login.eveonline.com/oauth/token" , oauthCallback = Nothing }
1,142
oauth2EveScoped scopes widgetType clientId clientSecret = authOAuth2Widget (asWidget widgetType) pluginName oauth2 $ \manager token -> do (User userId, userResponse) <- authGetProfile pluginName manager token "https://login.eveonline.com/oauth/verify" pure Creds { credsPlugin = "eveonline" -- FIXME: Preserved bug. See similar comment in Bitbucket provider. , credsIdent = T.pack $ show userId , credsExtra = setExtra token userResponse } where oauth2 = OAuth2 { oauthClientId = clientId , oauthClientSecret = Just clientSecret , oauthOAuthorizeEndpoint = "https://login.eveonline.com/oauth/authorize" `withQuery` [("response_type", "code"), scopeParam " " scopes] , oauthAccessTokenEndpoint = "https://login.eveonline.com/oauth/token" , oauthCallback = Nothing }
1,049
false
true
0
13
392
208
111
97
null
null
mitchellwrosen/language-lua2
src/Language/Lua/Token.hs
bsd-3-clause
showToken TkLShift = "<<"
32
showToken TkLShift = "<<"
32
showToken TkLShift = "<<"
32
false
false
0
5
10
9
4
5
null
null
ku-fpg/ecc-manifold
src/ECC/Code/Repetition.hs
bsd-3-clause
mkSoftRepetition :: Applicative f => Int -> ECC f mkSoftRepetition n = ECC { name = "repetition/soft/" ++ show n , encode = pure . U.fromList . take n . repeat . head . U.toList , decode = pure . (,True) . U.fromList . (: []) . hard . sum . U.toList , message_length = 1 , codeword_length = n }
351
mkSoftRepetition :: Applicative f => Int -> ECC f mkSoftRepetition n = ECC { name = "repetition/soft/" ++ show n , encode = pure . U.fromList . take n . repeat . head . U.toList , decode = pure . (,True) . U.fromList . (: []) . hard . sum . U.toList , message_length = 1 , codeword_length = n }
351
mkSoftRepetition n = ECC { name = "repetition/soft/" ++ show n , encode = pure . U.fromList . take n . repeat . head . U.toList , decode = pure . (,True) . U.fromList . (: []) . hard . sum . U.toList , message_length = 1 , codeword_length = n }
301
false
true
0
14
117
140
73
67
null
null
mtolly/rhythm
src/Data/Rhythm/FeedBack/Show.hs
gpl-3.0
toFile :: FilePath -> File Ticks Ticks -> IO () toFile fp db = writeFile fp $ showFile db ""
92
toFile :: FilePath -> File Ticks Ticks -> IO () toFile fp db = writeFile fp $ showFile db ""
92
toFile fp db = writeFile fp $ showFile db ""
44
false
true
0
8
19
46
21
25
null
null
ekmett/hmpfr
src/Data/Number/MPFR/Mutable/Special.hs
bsd-3-clause
log :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int log = withMutableMPFRS mpfr_log
82
log :: MMPFR s -> MMPFR s -> RoundMode -> ST s Int log = withMutableMPFRS mpfr_log
82
log = withMutableMPFRS mpfr_log
31
false
true
0
9
16
42
18
24
null
null
spechub/Hets
OWL2/XMLKeywords.hs
gpl-2.0
objectMinCardinalityK :: String objectMinCardinalityK = "ObjectMinCardinality"
78
objectMinCardinalityK :: String objectMinCardinalityK = "ObjectMinCardinality"
78
objectMinCardinalityK = "ObjectMinCardinality"
46
false
true
0
4
5
11
6
5
null
null
relrod/chordpro
test/test.hs
bsd-2-clause
simpleLyric :: String simpleLyric = concat [ "[C]Cecilia, you're [F]breaking my [C]heart, you're " , "[F]shaking my [C]confidence [G7]daily.\n" ]
187
simpleLyric :: String simpleLyric = concat [ "[C]Cecilia, you're [F]breaking my [C]heart, you're " , "[F]shaking my [C]confidence [G7]daily.\n" ]
187
simpleLyric = concat [ "[C]Cecilia, you're [F]breaking my [C]heart, you're " , "[F]shaking my [C]confidence [G7]daily.\n" ]
165
false
true
0
6
61
20
11
9
null
null
olsner/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
needsCDecl (IdLabel _ _ _) = True
46
needsCDecl (IdLabel _ _ _) = True
46
needsCDecl (IdLabel _ _ _) = True
46
false
false
0
6
19
20
9
11
null
null
joelburget/haste-compiler
src/Haste/CodeGen.hs
bsd-3-clause
genResultVar :: Var.Var -> JSGen Config J.Var genResultVar v = do cfg <- getCfg (\mn -> toJSVar cfg mn v (Just "#result")) <$> getModName -- | Generate a new variable and add a dependency on it to the function -- currently being generated.
246
genResultVar :: Var.Var -> JSGen Config J.Var genResultVar v = do cfg <- getCfg (\mn -> toJSVar cfg mn v (Just "#result")) <$> getModName -- | Generate a new variable and add a dependency on it to the function -- currently being generated.
246
genResultVar v = do cfg <- getCfg (\mn -> toJSVar cfg mn v (Just "#result")) <$> getModName -- | Generate a new variable and add a dependency on it to the function -- currently being generated.
200
false
true
0
12
49
71
34
37
null
null
andreasbock/hql
src/Utils/RootFinding.hs
gpl-2.0
-- Bisection method implementation finding the root of f(x) in the interval [a,b] -- tolerance function 'f' a b y bisection :: Double -> (Double -> Double) -> Double -> Double -> Double bisection eps f a b = let m = (a + b)/2 fa = f a fm = f m in if (b-a < eps || fm == 0) then m else if (signum fa /= signum fm) then bisection eps f a m else bisection eps f m b
447
bisection :: Double -> (Double -> Double) -> Double -> Double -> Double bisection eps f a b = let m = (a + b)/2 fa = f a fm = f m in if (b-a < eps || fm == 0) then m else if (signum fa /= signum fm) then bisection eps f a m else bisection eps f m b
295
bisection eps f a b = let m = (a + b)/2 fa = f a fm = f m in if (b-a < eps || fm == 0) then m else if (signum fa /= signum fm) then bisection eps f a m else bisection eps f m b
223
true
true
0
12
167
155
78
77
null
null
ziman/idris-py
src/IRTS/CodegenPython.hs
bsd-3-clause
cgExp tailPos (DC _ tag n args) | Just (ctor, test, match) <- specialCased n = ctor <$> mapM (cgExp False) args | otherwise = cgCtor tag n <$> mapM (cgExp False) args
174
cgExp tailPos (DC _ tag n args) | Just (ctor, test, match) <- specialCased n = ctor <$> mapM (cgExp False) args | otherwise = cgCtor tag n <$> mapM (cgExp False) args
174
cgExp tailPos (DC _ tag n args) | Just (ctor, test, match) <- specialCased n = ctor <$> mapM (cgExp False) args | otherwise = cgCtor tag n <$> mapM (cgExp False) args
174
false
false
2
10
40
98
44
54
null
null
dragosboca/xmobar
src/Actions.hs
bsd-3-clause
stripActions :: String -> String stripActions s = case matchRegex actionRegex s of Nothing -> s Just _ -> stripActions strippedOneLevel where strippedOneLevel = subRegex actionRegex s "[action=\\1\\2]\\3[/action]"
226
stripActions :: String -> String stripActions s = case matchRegex actionRegex s of Nothing -> s Just _ -> stripActions strippedOneLevel where strippedOneLevel = subRegex actionRegex s "[action=\\1\\2]\\3[/action]"
226
stripActions s = case matchRegex actionRegex s of Nothing -> s Just _ -> stripActions strippedOneLevel where strippedOneLevel = subRegex actionRegex s "[action=\\1\\2]\\3[/action]"
193
false
true
2
6
40
60
28
32
null
null
input-output-hk/pos-haskell-prototype
util/src/Pos/Util/Log.hs
mit
closeLogScribes :: MonadIO m => LoggingHandler -> m () closeLogScribes lh = do mayle <- liftIO $ Internal.getLogEnv lh case mayle of Nothing -> error "logging not yet initialized. Abort." Just le -> void $ liftIO $ K.closeScribes le {- | * interactive tests >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logInfo "This is a message" } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logDebug "You won't see this message" } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logWarning "Attention!"; addLoggerName "levelUp" $ do { logError "..now it happened" } } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> usingLoggerName lh "testmore" $ do { logInfo "hello..." } >>> lc0 <- return $ defaultInteractiveConfiguration Info >>> newlt <- return $ lc0 ^. lcLoggerTree & ltNamedSeverity .~ Data.HashMap.Strict.fromList [("cardano-sl.silent", Error)] >>> lc <- return $ lc0 & lcLoggerTree .~ newlt >>> lh <- setupLogging "test" lc >>> usingLoggerName lh "silent" $ do { logWarning "you won't see this!" } >>> usingLoggerName lh "verbose" $ do { logWarning "now you read this!" } -} -- | Equivalent to katip's logItem without the `Katip m` constraint
1,434
closeLogScribes :: MonadIO m => LoggingHandler -> m () closeLogScribes lh = do mayle <- liftIO $ Internal.getLogEnv lh case mayle of Nothing -> error "logging not yet initialized. Abort." Just le -> void $ liftIO $ K.closeScribes le {- | * interactive tests >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logInfo "This is a message" } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logDebug "You won't see this message" } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logWarning "Attention!"; addLoggerName "levelUp" $ do { logError "..now it happened" } } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> usingLoggerName lh "testmore" $ do { logInfo "hello..." } >>> lc0 <- return $ defaultInteractiveConfiguration Info >>> newlt <- return $ lc0 ^. lcLoggerTree & ltNamedSeverity .~ Data.HashMap.Strict.fromList [("cardano-sl.silent", Error)] >>> lc <- return $ lc0 & lcLoggerTree .~ newlt >>> lh <- setupLogging "test" lc >>> usingLoggerName lh "silent" $ do { logWarning "you won't see this!" } >>> usingLoggerName lh "verbose" $ do { logWarning "now you read this!" } -} -- | Equivalent to katip's logItem without the `Katip m` constraint
1,434
closeLogScribes lh = do mayle <- liftIO $ Internal.getLogEnv lh case mayle of Nothing -> error "logging not yet initialized. Abort." Just le -> void $ liftIO $ K.closeScribes le {- | * interactive tests >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logInfo "This is a message" } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logDebug "You won't see this message" } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> loggerBracket lh "testtest" $ do { logWarning "Attention!"; addLoggerName "levelUp" $ do { logError "..now it happened" } } >>> lh <- setupLogging "test" $ defaultInteractiveConfiguration Info >>> usingLoggerName lh "testmore" $ do { logInfo "hello..." } >>> lc0 <- return $ defaultInteractiveConfiguration Info >>> newlt <- return $ lc0 ^. lcLoggerTree & ltNamedSeverity .~ Data.HashMap.Strict.fromList [("cardano-sl.silent", Error)] >>> lc <- return $ lc0 & lcLoggerTree .~ newlt >>> lh <- setupLogging "test" lc >>> usingLoggerName lh "silent" $ do { logWarning "you won't see this!" } >>> usingLoggerName lh "verbose" $ do { logWarning "now you read this!" } -} -- | Equivalent to katip's logItem without the `Katip m` constraint
1,379
false
true
0
13
291
91
41
50
null
null
mrkkrp/stack
src/Stack/Types/Config/Build.hs
bsd-3-clause
buildMonoidHaddockInternalArgName :: Text buildMonoidHaddockInternalArgName = "haddock-internal"
96
buildMonoidHaddockInternalArgName :: Text buildMonoidHaddockInternalArgName = "haddock-internal"
96
buildMonoidHaddockInternalArgName = "haddock-internal"
54
false
true
0
4
5
11
6
5
null
null
j-rock/tutte-your-stuff
src/Main.hs
mit
right (Zipper ys y (x:xs)) = Zipper (y:ys) x xs
47
right (Zipper ys y (x:xs)) = Zipper (y:ys) x xs
47
right (Zipper ys y (x:xs)) = Zipper (y:ys) x xs
47
false
false
0
9
9
40
20
20
null
null
davideGiovannini/scheme-repl
src/Evaluation/Primitives.hs
bsd-3-clause
numLessT, numGreatT, numGE, numLE :: LispFunction numLessT = numBoolBinop (<)
78
numLessT, numGreatT, numGE, numLE :: LispFunction numLessT = numBoolBinop (<)
78
numLessT = numBoolBinop (<)
28
false
true
5
5
10
33
15
18
null
null
da-x/lamdu
bottlelib/Graphics/UI/Bottle/Animation.hs
gpl-3.0
scale :: Vector2 R -> Frame -> Frame scale factor = images . iRect . Rect.topLeftAndSize *~ factor
98
scale :: Vector2 R -> Frame -> Frame scale factor = images . iRect . Rect.topLeftAndSize *~ factor
98
scale factor = images . iRect . Rect.topLeftAndSize *~ factor
61
false
true
0
8
17
45
20
25
null
null
mwerbos/2048haskell
main.hs
mit
-- Takes a row and scoots all numbers through zeroes *once* -- Example: [2,0,0,2] -> [0,2,0,2] and [0,2,0,2] -> [0,0,2,2] scootRowRightOnce :: [Int] -> [Int] scootRowRightOnce = foldr scootLambda []
198
scootRowRightOnce = foldr scootLambda []
40
scootRowRightOnce = foldr scootLambda []
40
true
false
1
6
29
18
8
10
null
null
jqyu/bustle-chi
src/Rad/QL/Define/Field.hs
bsd-3-clause
field :: forall d m a b. (HasFields d m a, GraphQLValue m b) => Name -> FieldDefM a m b -> d m a () field n fdef = fieldSingleton fdef' where fdef' = GraphQLFieldDef { fieldDef = def , fieldResolver = res } def = FieldDef n (fdDesc fdef) (fdArgs fdef) (graphQLValueTypeRef (undefined :: m b)) (graphQLValueTypeDef (undefined :: m b)) (fdDepr fdef) res :: QArgs -> a -> QSelectionSet -> Result m res args = resultM . fdFunc fdef args
594
field :: forall d m a b. (HasFields d m a, GraphQLValue m b) => Name -> FieldDefM a m b -> d m a () field n fdef = fieldSingleton fdef' where fdef' = GraphQLFieldDef { fieldDef = def , fieldResolver = res } def = FieldDef n (fdDesc fdef) (fdArgs fdef) (graphQLValueTypeRef (undefined :: m b)) (graphQLValueTypeDef (undefined :: m b)) (fdDepr fdef) res :: QArgs -> a -> QSelectionSet -> Result m res args = resultM . fdFunc fdef args
594
field n fdef = fieldSingleton fdef' where fdef' = GraphQLFieldDef { fieldDef = def , fieldResolver = res } def = FieldDef n (fdDesc fdef) (fdArgs fdef) (graphQLValueTypeRef (undefined :: m b)) (graphQLValueTypeDef (undefined :: m b)) (fdDepr fdef) res :: QArgs -> a -> QSelectionSet -> Result m res args = resultM . fdFunc fdef args
488
false
true
4
10
244
197
102
95
null
null