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
nevrenato/Hets_Fork
Common/Parsec.hs
gpl-2.0
(>->) :: Monad m => m a -> (a -> b) -> m b (>->) p f = liftM f p
64
(>->) :: Monad m => m a -> (a -> b) -> m b (>->) p f = liftM f p
64
(>->) p f = liftM f p
21
false
true
0
9
20
53
27
26
null
null
ocharles/virtual-dom
src/VirtualDom/HTML/Attributes.hs
bsd-3-clause
itemId_ :: Traversal' HTMLElement (Maybe JSString) itemId_ = attributes . at "itemid"
85
itemId_ :: Traversal' HTMLElement (Maybe JSString) itemId_ = attributes . at "itemid"
85
itemId_ = attributes . at "itemid"
34
false
true
2
7
11
35
14
21
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/ReadableStreamBYOBReader.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader.read Mozilla ReadableStreamBYOBReader.read documentation> read :: (MonadDOM m, ToJSVal view) => ReadableStreamBYOBReader -> Maybe view -> m JSVal read self view = liftDOM (((self ^. jsf "read" [toJSVal view]) >>= readPromise) >>= toJSVal)
339
read :: (MonadDOM m, ToJSVal view) => ReadableStreamBYOBReader -> Maybe view -> m JSVal read self view = liftDOM (((self ^. jsf "read" [toJSVal view]) >>= readPromise) >>= toJSVal)
200
read self view = liftDOM (((self ^. jsf "read" [toJSVal view]) >>= readPromise) >>= toJSVal)
100
true
true
0
14
55
86
42
44
null
null
soenkehahn/findbin
src/System/Environment/FindBin.hs
mit
-- | Unsafe (/constant/) version of 'getProgPath'. __Bin__ :: String __Bin__ = let path = unsafePerformIO getProgPath in length path `seq` path
147
__Bin__ :: String __Bin__ = let path = unsafePerformIO getProgPath in length path `seq` path
96
__Bin__ = let path = unsafePerformIO getProgPath in length path `seq` path
78
true
true
0
9
25
44
20
24
null
null
saep/neil
src/Cabal.hs
bsd-3-clause
checkGhci :: IO () checkGhci = do let warns = words "-fwarn-unused-binds -fwarn-unused-imports" src <- words <$> readFile' ".ghci" unless ("-W" `elem` src || all (`elem` src) warns) $ error $ "The .ghci file does not enough of " ++ unwords ("-W":warns)
272
checkGhci :: IO () checkGhci = do let warns = words "-fwarn-unused-binds -fwarn-unused-imports" src <- words <$> readFile' ".ghci" unless ("-W" `elem` src || all (`elem` src) warns) $ error $ "The .ghci file does not enough of " ++ unwords ("-W":warns)
272
checkGhci = do let warns = words "-fwarn-unused-binds -fwarn-unused-imports" src <- words <$> readFile' ".ghci" unless ("-W" `elem` src || all (`elem` src) warns) $ error $ "The .ghci file does not enough of " ++ unwords ("-W":warns)
253
false
true
0
14
61
94
47
47
null
null
elieux/ghc
compiler/main/DynFlags.hs
bsd-3-clause
intSuffixM :: (Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags) intSuffixM fn = IntSuffix (\n -> updM (fn n))
125
intSuffixM :: (Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags) intSuffixM fn = IntSuffix (\n -> updM (fn n))
125
intSuffixM fn = IntSuffix (\n -> updM (fn n))
45
false
true
0
10
20
65
31
34
null
null
ice1000/OI-codes
codewars/101-200/tiny-three-pass-compiler-given-up.hs
agpl-3.0
tokenize :: String -> [Token] tokenize [] = []
46
tokenize :: String -> [Token] tokenize [] = []
46
tokenize [] = []
16
false
true
0
8
8
31
14
17
null
null
mrkkrp/stack
src/Stack/Build/Target.hs
bsd-3-clause
resolveIdents _ _ _ (ri, RTPackage x) = Right ((ri, RTPackage x), Map.empty)
76
resolveIdents _ _ _ (ri, RTPackage x) = Right ((ri, RTPackage x), Map.empty)
76
resolveIdents _ _ _ (ri, RTPackage x) = Right ((ri, RTPackage x), Map.empty)
76
false
false
0
8
12
44
23
21
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/Resource/YouTube/Activities/List.hs
mpl-2.0
-- | JSONP alCallback :: Lens' ActivitiesList (Maybe Text) alCallback = lens _alCallback (\ s a -> s{_alCallback = a})
120
alCallback :: Lens' ActivitiesList (Maybe Text) alCallback = lens _alCallback (\ s a -> s{_alCallback = a})
109
alCallback = lens _alCallback (\ s a -> s{_alCallback = a})
61
true
true
0
9
21
48
25
23
null
null
simonmar/Haxl
Haxl/Core/Monad.hs
bsd-3-clause
-- | Returns @'Left' e@ if the computation throws an exception @e@, or -- @'Right' a@ if it returns a result @a@. try :: Exception e => GenHaxl u a -> GenHaxl u (Either e a) try haxl = (Right <$> haxl) `catch` (return . Left)
225
try :: Exception e => GenHaxl u a -> GenHaxl u (Either e a) try haxl = (Right <$> haxl) `catch` (return . Left)
111
try haxl = (Right <$> haxl) `catch` (return . Left)
51
true
true
0
9
45
65
34
31
null
null
silkapp/starling
Network/Starling/Core.hs
bsd-3-clause
-- | Add a value to cache. Fails if -- already present. add :: Word32 -> Key -> Value -> Request add expiry key value = let extras = setExtras 0 expiry in request Add extras key value
193
add :: Word32 -> Key -> Value -> Request add expiry key value = let extras = setExtras 0 expiry in request Add extras key value
137
add expiry key value = let extras = setExtras 0 expiry in request Add extras key value
96
true
true
0
9
47
65
29
36
null
null
GaloisInc/pads-haskell
Examples/First.hs
bsd-3-clause
expect_IdInt = (Numeric 23,0,"")
32
expect_IdInt = (Numeric 23,0,"")
32
expect_IdInt = (Numeric 23,0,"")
32
false
false
0
6
3
18
10
8
null
null
elbrujohalcon/hPage
src/HPage/Control.hs
bsd-3-clause
isModifiedPageNth :: Int -> HPage Bool isModifiedPageNth i = withPageIndex i $ do page <- getPageNth i return $ expressions page /= original page
234
isModifiedPageNth :: Int -> HPage Bool isModifiedPageNth i = withPageIndex i $ do page <- getPageNth i return $ expressions page /= original page
234
isModifiedPageNth i = withPageIndex i $ do page <- getPageNth i return $ expressions page /= original page
195
false
true
0
11
112
60
25
35
null
null
nh2/WashNGo
WASH/HTML/HTMLMonadAttrs.hs
bsd-3-clause
datetime :: Monad m => String -> WithHTML x m () datetime = attr "datetime"
76
datetime :: Monad m => String -> WithHTML x m () datetime = attr "datetime"
76
datetime = attr "datetime"
27
false
true
0
8
15
34
16
18
null
null
dorchard/ypnos
src/Ypnos/Examples/Stencils.hs
bsd-2-clause
--zeroBoundF = [boundary| Float from (-1, -1) to (+1, +1) -> 0.0 |] runAvgY' = runF' avgY'
91
runAvgY' = runF' avgY'
22
runAvgY' = runF' avgY'
22
true
false
1
5
17
14
5
9
null
null
keera-studios/hsQt
Qtc/Network/QHttpHeader.hs
bsd-2-clause
hasContentLength :: QHttpHeader a -> (()) -> IO (Bool) hasContentLength x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QHttpHeader_hasContentLength cobj_x0
178
hasContentLength :: QHttpHeader a -> (()) -> IO (Bool) hasContentLength x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QHttpHeader_hasContentLength cobj_x0
178
hasContentLength x0 () = withBoolResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QHttpHeader_hasContentLength cobj_x0
123
false
true
0
8
31
59
29
30
null
null
leohahn/scheme-interpreter
src/Lib.hs
bsd-3-clause
-- | Entry point of the application, gets arguments and evaluates it with -- the readExpr function entry :: IO () entry = getArgs >>= putStrLn . show . eval . readExpr . head
178
entry :: IO () entry = getArgs >>= putStrLn . show . eval . readExpr . head
79
entry = getArgs >>= putStrLn . show . eval . readExpr . head
64
true
true
0
9
37
38
20
18
null
null
frantisekfarka/ghc-dsi
compiler/cmm/CLabel.hs
bsd-3-clause
externallyVisibleCLabel (LargeSRTLabel _) = False
55
externallyVisibleCLabel (LargeSRTLabel _) = False
55
externallyVisibleCLabel (LargeSRTLabel _) = False
55
false
false
0
7
10
15
7
8
null
null
snowleopard/alga
src/Algebra/Graph/Bipartite/AdjacencyMap/Algorithm.hs
mit
augmentingPath :: (Ord a, Ord b) => Matching a b -> AdjacencyMap a b -> Either (VertexCover a b) (List a b) augmentingPath = augmentingPathImpl
143
augmentingPath :: (Ord a, Ord b) => Matching a b -> AdjacencyMap a b -> Either (VertexCover a b) (List a b) augmentingPath = augmentingPathImpl
143
augmentingPath = augmentingPathImpl
35
false
true
0
10
24
65
32
33
null
null
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/GlassBR/ModuleDefs.hs
bsd-2-clause
x_z_2 = var "x_z_2" "list of x values at a specific z value" (sub lX (sub lZ two)) (Vect Real)
109
x_z_2 = var "x_z_2" "list of x values at a specific z value" (sub lX (sub lZ two)) (Vect Real)
109
x_z_2 = var "x_z_2" "list of x values at a specific z value" (sub lX (sub lZ two)) (Vect Real)
109
false
false
0
9
34
39
18
21
null
null
brendanhay/gogol
gogol-cloudkms/gen/Network/Google/Resource/CloudKMS/Projects/Locations/KeyRings/CryptoKeys/List.hs
mpl-2.0
-- | Optional. Optional pagination token, returned earlier via -- ListCryptoKeysResponse.next_page_token. plkrcklPageToken :: Lens' ProjectsLocationsKeyRingsCryptoKeysList (Maybe Text) plkrcklPageToken = lens _plkrcklPageToken (\ s a -> s{_plkrcklPageToken = a})
270
plkrcklPageToken :: Lens' ProjectsLocationsKeyRingsCryptoKeysList (Maybe Text) plkrcklPageToken = lens _plkrcklPageToken (\ s a -> s{_plkrcklPageToken = a})
164
plkrcklPageToken = lens _plkrcklPageToken (\ s a -> s{_plkrcklPageToken = a})
85
true
true
0
8
35
50
26
24
null
null
tdammers/templar
src/Control/MaybeEitherMonad.hs
bsd-3-clause
-- | Get 'Just' the value, or throw a 'NothingException' maybeThrow :: Maybe a -> a maybeThrow = fromMaybe (throw NothingException)
131
maybeThrow :: Maybe a -> a maybeThrow = fromMaybe (throw NothingException)
74
maybeThrow = fromMaybe (throw NothingException)
47
true
true
0
7
20
28
14
14
null
null
wxwxwwxxx/ghc
libraries/base/GHC/List.hs
bsd-3-clause
drop n xs | n <= 0 = xs
28
drop n xs | n <= 0 = xs
28
drop n xs | n <= 0 = xs
28
false
false
0
8
13
26
10
16
null
null
Lasokki/omanet
Settings.hs
agpl-3.0
combineStylesheets :: Name -> [Route Static] -> Q Exp combineStylesheets = combineStylesheets' (appSkipCombining compileTimeAppSettings) combineSettings
160
combineStylesheets :: Name -> [Route Static] -> Q Exp combineStylesheets = combineStylesheets' (appSkipCombining compileTimeAppSettings) combineSettings
160
combineStylesheets = combineStylesheets' (appSkipCombining compileTimeAppSettings) combineSettings
106
false
true
0
8
22
39
19
20
null
null
fpco/hlint
data/Default.hs
bsd-3-clause
error = compare x y /= GT ==> x <= y
36
error = compare x y /= GT ==> x <= y
36
error = compare x y /= GT ==> x <= y
36
false
false
0
8
10
23
11
12
null
null
sdiehl/ghc
libraries/base/GHC/Int.hs
bsd-3-clause
(I64# x) `leInt64` (I64# y) = isTrue# (x `leInt64#` y)
54
(I64# x) `leInt64` (I64# y) = isTrue# (x `leInt64#` y)
54
(I64# x) `leInt64` (I64# y) = isTrue# (x `leInt64#` y)
54
false
false
0
7
9
38
20
18
null
null
keithodulaigh/Hets
OMDoc/OMDocInterface.hs
gpl-2.0
mkInsort :: OMDocRef -> Insort mkInsort = Insort
48
mkInsort :: OMDocRef -> Insort mkInsort = Insort
48
mkInsort = Insort
17
false
true
0
7
7
22
9
13
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Orderreturns/List.hs
mpl-2.0
-- | Obtains order returns that match any shipment status provided in this -- parameter. When this parameter is not provided, order returns are -- obtained regardless of their shipment statuses. ol1ShipmentStatus :: Lens' OrderreturnsList [OrderreturnsListShipmentStatus] ol1ShipmentStatus = lens _ol1ShipmentStatus (\ s a -> s{_ol1ShipmentStatus = a}) . _Default . _Coerce
393
ol1ShipmentStatus :: Lens' OrderreturnsList [OrderreturnsListShipmentStatus] ol1ShipmentStatus = lens _ol1ShipmentStatus (\ s a -> s{_ol1ShipmentStatus = a}) . _Default . _Coerce
198
ol1ShipmentStatus = lens _ol1ShipmentStatus (\ s a -> s{_ol1ShipmentStatus = a}) . _Default . _Coerce
121
true
true
3
8
70
61
30
31
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpInfo PrefetchAddrOp0 = mkGenPrimOp (fsLit "prefetchAddr0#") [deltaTyVar] [addrPrimTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy)
150
primOpInfo PrefetchAddrOp0 = mkGenPrimOp (fsLit "prefetchAddr0#") [deltaTyVar] [addrPrimTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy)
150
primOpInfo PrefetchAddrOp0 = mkGenPrimOp (fsLit "prefetchAddr0#") [deltaTyVar] [addrPrimTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy)
150
false
false
0
7
13
46
23
23
null
null
dvtate/single-files
deBruijn_lambda_calc.hs
mit
deBruijn :: Term -> TermDB deBruijn term = deBruijnList (freeVars [] term) term where -- Generate a list of free vars freeVars vars (Lambda s body) = freeVars (s : vars) body freeVars vars (Apply a b) = (freeVars vars b) ++ (freeVars vars a) freeVars vars (Variable s) = if s `elem` vars then [] else [s] ------------------------- Assignment 4
362
deBruijn :: Term -> TermDB deBruijn term = deBruijnList (freeVars [] term) term where -- Generate a list of free vars freeVars vars (Lambda s body) = freeVars (s : vars) body freeVars vars (Apply a b) = (freeVars vars b) ++ (freeVars vars a) freeVars vars (Variable s) = if s `elem` vars then [] else [s] ------------------------- Assignment 4
362
deBruijn term = deBruijnList (freeVars [] term) term where -- Generate a list of free vars freeVars vars (Lambda s body) = freeVars (s : vars) body freeVars vars (Apply a b) = (freeVars vars b) ++ (freeVars vars a) freeVars vars (Variable s) = if s `elem` vars then [] else [s] ------------------------- Assignment 4
335
false
true
0
8
79
141
73
68
null
null
wavewave/madgraph-auto-dataset
src/HEP/Automation/MadGraph/Dataset/Set20110316set11.hs
gpl-3.0
ucut :: UserCut ucut = UserCut { uc_metcut = 15.0 , uc_etacutlep = 1.2 , uc_etcutlep = 18.0 , uc_etacutjet = 2.5 , uc_etcutjet = 15.0 }
156
ucut :: UserCut ucut = UserCut { uc_metcut = 15.0 , uc_etacutlep = 1.2 , uc_etcutlep = 18.0 , uc_etacutjet = 2.5 , uc_etcutjet = 15.0 }
156
ucut = UserCut { uc_metcut = 15.0 , uc_etacutlep = 1.2 , uc_etcutlep = 18.0 , uc_etacutjet = 2.5 , uc_etcutjet = 15.0 }
140
false
true
0
6
47
43
27
16
null
null
DanielSchuessler/hstri
MathUtil.hs
gpl-3.0
ratioToIntegral_Ratio :: Integral a => Ratio a -> Maybe a ratioToIntegral_Ratio r = guard (denominator r == 1) >> Just (numerator r)
132
ratioToIntegral_Ratio :: Integral a => Ratio a -> Maybe a ratioToIntegral_Ratio r = guard (denominator r == 1) >> Just (numerator r)
132
ratioToIntegral_Ratio r = guard (denominator r == 1) >> Just (numerator r)
74
false
true
0
9
21
57
26
31
null
null
Bodigrim/arithmoi
Math/NumberTheory/Moduli/Cbrt.hs
mit
-- | This function takes two Eisenstein intgers @alpha@ and @beta@ and returns -- three arguments @(gamma, delta, newSymbol)@. @gamma@ and @delta@ are the -- associated primary numbers of alpha and beta respectively. @newSymbol@ -- is the cubic symbol measuring the discrepancy between the cubic residue -- of @alpha@ and @beta@, and the cubic residue of @gamma@ and @delta@. extractPrimaryContributions :: EisensteinInteger -> EisensteinInteger -> (EisensteinInteger, EisensteinInteger, CubicSymbol) extractPrimaryContributions alpha beta = (gamma, delta, newSymbol) where newSymbol = stimes (j * m) Omega <> stimes (- m - n) i m :+ n = A.quot (delta - 1) 3 (i, gamma) = getPrimaryDecomposition alphaThreeFree (_, delta) = getPrimaryDecomposition beta j = wordToInteger jIntWord -- This function outputs data such that -- @(1 - ω)^jIntWord * alphaThreeFree = alpha@. (jIntWord, alphaThreeFree) = splitOff (1 - ω) alpha -- | This function takes an Eisenstein number @e@ and returns @(symbol, delta)@ -- where @delta@ is its associated primary integer and @symbol@ is the -- cubic symbol discrepancy between @e@ and @delta@. @delta@ is defined to be -- the unique associated Eisenstein Integer to @e@ such that -- \( \textrm{delta} \equiv 1 (\textrm{mod} 3) \). -- Note that @delta@ exists if and only if @e@ is coprime to 3. In this -- case, an error message is displayed.
1,407
extractPrimaryContributions :: EisensteinInteger -> EisensteinInteger -> (EisensteinInteger, EisensteinInteger, CubicSymbol) extractPrimaryContributions alpha beta = (gamma, delta, newSymbol) where newSymbol = stimes (j * m) Omega <> stimes (- m - n) i m :+ n = A.quot (delta - 1) 3 (i, gamma) = getPrimaryDecomposition alphaThreeFree (_, delta) = getPrimaryDecomposition beta j = wordToInteger jIntWord -- This function outputs data such that -- @(1 - ω)^jIntWord * alphaThreeFree = alpha@. (jIntWord, alphaThreeFree) = splitOff (1 - ω) alpha -- | This function takes an Eisenstein number @e@ and returns @(symbol, delta)@ -- where @delta@ is its associated primary integer and @symbol@ is the -- cubic symbol discrepancy between @e@ and @delta@. @delta@ is defined to be -- the unique associated Eisenstein Integer to @e@ such that -- \( \textrm{delta} \equiv 1 (\textrm{mod} 3) \). -- Note that @delta@ exists if and only if @e@ is coprime to 3. In this -- case, an error message is displayed.
1,031
extractPrimaryContributions alpha beta = (gamma, delta, newSymbol) where newSymbol = stimes (j * m) Omega <> stimes (- m - n) i m :+ n = A.quot (delta - 1) 3 (i, gamma) = getPrimaryDecomposition alphaThreeFree (_, delta) = getPrimaryDecomposition beta j = wordToInteger jIntWord -- This function outputs data such that -- @(1 - ω)^jIntWord * alphaThreeFree = alpha@. (jIntWord, alphaThreeFree) = splitOff (1 - ω) alpha -- | This function takes an Eisenstein number @e@ and returns @(symbol, delta)@ -- where @delta@ is its associated primary integer and @symbol@ is the -- cubic symbol discrepancy between @e@ and @delta@. @delta@ is defined to be -- the unique associated Eisenstein Integer to @e@ such that -- \( \textrm{delta} \equiv 1 (\textrm{mod} 3) \). -- Note that @delta@ exists if and only if @e@ is coprime to 3. In this -- case, an error message is displayed.
906
true
true
5
10
249
177
102
75
null
null
enolan/Idris-dev
src/Idris/Parser/Data.hs
bsd-3-clause
constructor :: SyntaxInfo -> IdrisParser (Docstring (Either Err PTerm), [(Name, Docstring (Either Err PTerm))], Name, FC, PTerm, FC, [Name]) constructor syn = do (doc, argDocs) <- option noDocs docComment (cn_in, nfc) <- fnName; fc <- getFC let cn = expandNS syn cn_in lchar ':' fs <- option [] (do lchar '%'; reserved "erase" sepBy1 (fst <$> name) (lchar ',')) ty <- typeExpr (allowImp syn) ist <- get let doc' = annotCode (tryFullExpr syn ist) doc argDocs' = [ (n, annotCode (tryFullExpr syn ist) d) | (n, d) <- argDocs ] checkNameFixity cn return (doc', argDocs', cn, nfc, ty, fc, fs) <?> "constructor"
762
constructor :: SyntaxInfo -> IdrisParser (Docstring (Either Err PTerm), [(Name, Docstring (Either Err PTerm))], Name, FC, PTerm, FC, [Name]) constructor syn = do (doc, argDocs) <- option noDocs docComment (cn_in, nfc) <- fnName; fc <- getFC let cn = expandNS syn cn_in lchar ':' fs <- option [] (do lchar '%'; reserved "erase" sepBy1 (fst <$> name) (lchar ',')) ty <- typeExpr (allowImp syn) ist <- get let doc' = annotCode (tryFullExpr syn ist) doc argDocs' = [ (n, annotCode (tryFullExpr syn ist) d) | (n, d) <- argDocs ] checkNameFixity cn return (doc', argDocs', cn, nfc, ty, fc, fs) <?> "constructor"
762
constructor syn = do (doc, argDocs) <- option noDocs docComment (cn_in, nfc) <- fnName; fc <- getFC let cn = expandNS syn cn_in lchar ':' fs <- option [] (do lchar '%'; reserved "erase" sepBy1 (fst <$> name) (lchar ',')) ty <- typeExpr (allowImp syn) ist <- get let doc' = annotCode (tryFullExpr syn ist) doc argDocs' = [ (n, annotCode (tryFullExpr syn ist) d) | (n, d) <- argDocs ] checkNameFixity cn return (doc', argDocs', cn, nfc, ty, fc, fs) <?> "constructor"
621
false
true
2
14
258
315
157
158
null
null
nlim/haskell-playground
src/Euler89.hs
mit
numeralValue M = 1000
21
numeralValue M = 1000
21
numeralValue M = 1000
21
false
false
1
5
3
13
4
9
null
null
energyflowanalysis/efa-2.1
src/EFA/Application/Optimisation/Loop.hs
bsd-3-clause
showBalanceLoopItem::(Show a, Show node,PrintfArg a,Arith.Constant a )=> Params.Optimisation node [] Sweep UV.Vector a -> (Counter, BalanceLoopItem node a z) -> String showBalanceLoopItem _optParams (bStp, BalanceLoopItem bForc _bFStep bal _) = printf " BL: %2d | " bStp ++ printfBalanceFMap bForc bal
309
showBalanceLoopItem::(Show a, Show node,PrintfArg a,Arith.Constant a )=> Params.Optimisation node [] Sweep UV.Vector a -> (Counter, BalanceLoopItem node a z) -> String showBalanceLoopItem _optParams (bStp, BalanceLoopItem bForc _bFStep bal _) = printf " BL: %2d | " bStp ++ printfBalanceFMap bForc bal
309
showBalanceLoopItem _optParams (bStp, BalanceLoopItem bForc _bFStep bal _) = printf " BL: %2d | " bStp ++ printfBalanceFMap bForc bal
135
false
true
0
9
48
112
56
56
null
null
zchn/ethereum-analyzer
ethereum-analyzer-deps/src/Legacy/Haskoin/V0102/Network/Haskoin/Crypto/NumberTheory.hs
apache-2.0
mulInverse :: Integer -> Integer -> Integer mulInverse a p | a * s `mod` p == 1 = s | otherwise = error "No multiplicative inverse (mod p) for a" where (s, _) = extendedModGCD a p p
191
mulInverse :: Integer -> Integer -> Integer mulInverse a p | a * s `mod` p == 1 = s | otherwise = error "No multiplicative inverse (mod p) for a" where (s, _) = extendedModGCD a p p
191
mulInverse a p | a * s `mod` p == 1 = s | otherwise = error "No multiplicative inverse (mod p) for a" where (s, _) = extendedModGCD a p p
147
false
true
1
10
48
76
38
38
null
null
netvl/udisksevt
UDisksEvt/Config.hs
gpl-2.0
- Just sequence of digits number :: ConfParser Int number = fmap read (many1 digit)
84
number :: ConfParser Int number = fmap read (many1 digit)
57
number = fmap read (many1 digit)
32
true
true
1
7
15
33
16
17
null
null
SKA-ScienceDataProcessor/RC
MS5/dna/flow/Flow/Run/DNA.hs
apache-2.0
execStep :: KernelSet -> Step -> DnaBuilder () execStep deps step = case step of DomainStep m_kid dh -> execDomainStep m_kid dh KernelStep kbind -> execKernelStep kbind DistributeStep dom sched steps -> execDistributeStep deps dom sched steps RecoverStep kbind kid -> execRecoverStep kbind kid -- | Generate code for creating a domain. This will register the -- domain for unmarshalling, and generate "DNA" code to register the -- domain with the run-time "DomainMap".
494
execStep :: KernelSet -> Step -> DnaBuilder () execStep deps step = case step of DomainStep m_kid dh -> execDomainStep m_kid dh KernelStep kbind -> execKernelStep kbind DistributeStep dom sched steps -> execDistributeStep deps dom sched steps RecoverStep kbind kid -> execRecoverStep kbind kid -- | Generate code for creating a domain. This will register the -- domain for unmarshalling, and generate "DNA" code to register the -- domain with the run-time "DomainMap".
494
execStep deps step = case step of DomainStep m_kid dh -> execDomainStep m_kid dh KernelStep kbind -> execKernelStep kbind DistributeStep dom sched steps -> execDistributeStep deps dom sched steps RecoverStep kbind kid -> execRecoverStep kbind kid -- | Generate code for creating a domain. This will register the -- domain for unmarshalling, and generate "DNA" code to register the -- domain with the run-time "DomainMap".
447
false
true
0
8
98
102
48
54
null
null
teleshoes/taffybar
src/System/Taffybar/Widget/FreedesktopNotifications.hs
bsd-3-clause
notePurge :: NotifyState -> Word32 -> IO () notePurge s nId = atomically . modifyTVar' (noteQueue s) $ S.filter ((nId /=) . noteId)
133
notePurge :: NotifyState -> Word32 -> IO () notePurge s nId = atomically . modifyTVar' (noteQueue s) $ S.filter ((nId /=) . noteId)
133
notePurge s nId = atomically . modifyTVar' (noteQueue s) $ S.filter ((nId /=) . noteId)
89
false
true
0
9
24
62
31
31
null
null
xcthulhu/lambda-geda
Geda/SExpr.hs
gpl-3.0
{- This is the quoted version of sx; used for lists without identifiers -} ql :: [String] -> SExpression ql ss = "'" ++ sx ss
125
ql :: [String] -> SExpression ql ss = "'" ++ sx ss
50
ql ss = "'" ++ sx ss
20
true
true
0
6
25
32
16
16
null
null
lexi-lambda/higher-rank
library/Language/HigherRank/Typecheck.hs
isc
(⊢) = typeWF
12
(⊢) = typeWF
12
(⊢) = typeWF
12
false
false
1
5
2
12
5
7
null
null
liuyang1/toy264
arith.hs
mit
decode v cp = decodeh v cp []
29
decode v cp = decodeh v cp []
29
decode v cp = decodeh v cp []
29
false
false
0
6
7
20
9
11
null
null
nevrenato/Hets_Fork
OMDoc/OMDocInterface.hs
gpl-2.0
showTheory :: Theory -> String showTheory t = show (t { theoryPresentations = [] })
83
showTheory :: Theory -> String showTheory t = show (t { theoryPresentations = [] })
83
showTheory t = show (t { theoryPresentations = [] })
52
false
true
0
9
14
34
18
16
null
null
markflorisson/hpack
testrepo/bytestring-0.10.4.1/Data/ByteString/Lazy.hs
bsd-3-clause
moduleError :: String -> String -> a moduleError fun msg = error ("Data.ByteString.Lazy." ++ fun ++ ':':' ':msg)
112
moduleError :: String -> String -> a moduleError fun msg = error ("Data.ByteString.Lazy." ++ fun ++ ':':' ':msg)
112
moduleError fun msg = error ("Data.ByteString.Lazy." ++ fun ++ ':':' ':msg)
75
false
true
0
10
17
46
23
23
null
null
zcleghern/hchess
src/test/AI_test.hs
mit
main = do runTestTT $ TestList [t1]
35
main = do runTestTT $ TestList [t1]
35
main = do runTestTT $ TestList [t1]
35
false
false
0
9
6
19
9
10
null
null
enolan/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
runIdeModeCommand h id orig fn mods (IdeMode.TypeOf name) = case splitName name of Left err -> iPrintError err Right n -> process "(idemode)" (Check (PRef (FC "(idemode)" (0,0) (0,0)) [] n))
217
runIdeModeCommand h id orig fn mods (IdeMode.TypeOf name) = case splitName name of Left err -> iPrintError err Right n -> process "(idemode)" (Check (PRef (FC "(idemode)" (0,0) (0,0)) [] n))
217
runIdeModeCommand h id orig fn mods (IdeMode.TypeOf name) = case splitName name of Left err -> iPrintError err Right n -> process "(idemode)" (Check (PRef (FC "(idemode)" (0,0) (0,0)) [] n))
217
false
false
0
15
57
100
49
51
null
null
bgamari/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
circ 'w' = "ŵ"
14
circ 'w' = "ŵ"
14
circ 'w' = "ŵ"
14
false
false
1
5
3
13
4
9
null
null
ezyang/ghc
compiler/typecheck/TcDerivUtils.hs
bsd-3-clause
-- This spec implies a dfun declaration of the form -- df :: forall tvs. theta => C tys -- The Name is the name for the DFun we'll build -- The tyvars bind all the variables in the theta -- For type families, the tycon in -- in ds_tys is the *family* tycon -- in ds_tc is the *representation* type -- For non-family tycons, both are the same -- the theta is either the given and final theta, in standalone deriving, -- or the not-yet-simplified list of constraints together with their origin -- ds_mechanism specifies the means by which GHC derives the instance. -- See Note [Deriving strategies] in TcDeriv {- Example: newtype instance T [a] = MkT (Tree a) deriving( C s ) ==> axiom T [a] = :RTList a axiom :RTList a = Tree a DS { ds_tvs = [a,s], ds_cls = C, ds_tys = [s, T [a]] , ds_tc = :RTList, ds_mechanism = DerivSpecNewtype (Tree a) } -} pprDerivSpec :: Outputable theta => DerivSpec theta -> SDoc pprDerivSpec (DS { ds_loc = l, ds_name = n, ds_tvs = tvs, ds_cls = c, ds_tys = tys, ds_theta = rhs, ds_mechanism = mech }) = hang (text "DerivSpec") 2 (vcat [ text "ds_loc =" <+> ppr l , text "ds_name =" <+> ppr n , text "ds_tvs =" <+> ppr tvs , text "ds_cls =" <+> ppr c , text "ds_tys =" <+> ppr tys , text "ds_theta =" <+> ppr rhs , text "ds_mechanism =" <+> ppr mech ])
1,569
pprDerivSpec :: Outputable theta => DerivSpec theta -> SDoc pprDerivSpec (DS { ds_loc = l, ds_name = n, ds_tvs = tvs, ds_cls = c, ds_tys = tys, ds_theta = rhs, ds_mechanism = mech }) = hang (text "DerivSpec") 2 (vcat [ text "ds_loc =" <+> ppr l , text "ds_name =" <+> ppr n , text "ds_tvs =" <+> ppr tvs , text "ds_cls =" <+> ppr c , text "ds_tys =" <+> ppr tys , text "ds_theta =" <+> ppr rhs , text "ds_mechanism =" <+> ppr mech ])
584
pprDerivSpec (DS { ds_loc = l, ds_name = n, ds_tvs = tvs, ds_cls = c, ds_tys = tys, ds_theta = rhs, ds_mechanism = mech }) = hang (text "DerivSpec") 2 (vcat [ text "ds_loc =" <+> ppr l , text "ds_name =" <+> ppr n , text "ds_tvs =" <+> ppr tvs , text "ds_cls =" <+> ppr c , text "ds_tys =" <+> ppr tys , text "ds_theta =" <+> ppr rhs , text "ds_mechanism =" <+> ppr mech ])
524
true
true
0
10
542
206
109
97
null
null
ingemaradahl/bilder
src/TypeChecker/Utils.hs
lgpl-3.0
returns (SVoidReturn _) = True
30
returns (SVoidReturn _) = True
30
returns (SVoidReturn _) = True
30
false
false
0
7
4
15
7
8
null
null
artuuge/IHaskell
ipython-kernel/src/IHaskell/IPython/Types.hs
mit
showMessageType DisplayDataMessage = "display_data"
51
showMessageType DisplayDataMessage = "display_data"
51
showMessageType DisplayDataMessage = "display_data"
51
false
false
0
5
3
9
4
5
null
null
uriba/dwarf
src/Data/Dwarf.hs
bsd-3-clause
dw_at 0x49 = DW_AT_type
23
dw_at 0x49 = DW_AT_type
23
dw_at 0x49 = DW_AT_type
23
false
false
0
5
3
9
4
5
null
null
DavidAlphaFox/ghc
utils/haddock/haddock-api/src/Haddock/Interface/LexParseRn.hs
bsd-3-clause
processDocStrings :: DynFlags -> GlobalRdrEnv -> [HsDocString] -> Maybe (MDoc Name) processDocStrings dflags gre strs = case metaDocConcat $ map (processDocStringParas dflags gre) strs of -- We check that we don't have any version info to render instead -- of just checking if there is no comment: there may not be a -- comment but we still want to pass through any meta data. MetaDoc { _meta = Meta { _version = Nothing }, _doc = DocEmpty } -> Nothing x -> Just x
504
processDocStrings :: DynFlags -> GlobalRdrEnv -> [HsDocString] -> Maybe (MDoc Name) processDocStrings dflags gre strs = case metaDocConcat $ map (processDocStringParas dflags gre) strs of -- We check that we don't have any version info to render instead -- of just checking if there is no comment: there may not be a -- comment but we still want to pass through any meta data. MetaDoc { _meta = Meta { _version = Nothing }, _doc = DocEmpty } -> Nothing x -> Just x
504
processDocStrings dflags gre strs = case metaDocConcat $ map (processDocStringParas dflags gre) strs of -- We check that we don't have any version info to render instead -- of just checking if there is no comment: there may not be a -- comment but we still want to pass through any meta data. MetaDoc { _meta = Meta { _version = Nothing }, _doc = DocEmpty } -> Nothing x -> Just x
402
false
true
2
10
123
101
54
47
null
null
christiaanb/ghc-typelits-extra
src/GHC/TypeLits/Extra/Solver/Unify.hs
bsd-2-clause
fvOP (CLog x y) = fvOP x `unionUniqSets` fvOP y
47
fvOP (CLog x y) = fvOP x `unionUniqSets` fvOP y
47
fvOP (CLog x y) = fvOP x `unionUniqSets` fvOP y
47
false
false
0
7
9
29
14
15
null
null
rahulmutt/ghcvm
compiler/Eta/Utils/Outputable.hs
bsd-3-clause
speakNth n = hcat [ int n, text suffix ] where suffix | n <= 20 = "th" -- 11,12,13 are non-std | last_dig == 1 = "st" | last_dig == 2 = "nd" | last_dig == 3 = "rd" | otherwise = "th" last_dig = n `rem` 10 -- | Converts an integer to a verbal multiplicity: -- -- > speakN 0 = text "none" -- > speakN 5 = text "five" -- > speakN 10 = text "10"
413
speakNth n = hcat [ int n, text suffix ] where suffix | n <= 20 = "th" -- 11,12,13 are non-std | last_dig == 1 = "st" | last_dig == 2 = "nd" | last_dig == 3 = "rd" | otherwise = "th" last_dig = n `rem` 10 -- | Converts an integer to a verbal multiplicity: -- -- > speakN 0 = text "none" -- > speakN 5 = text "five" -- > speakN 10 = text "10"
413
speakNth n = hcat [ int n, text suffix ] where suffix | n <= 20 = "th" -- 11,12,13 are non-std | last_dig == 1 = "st" | last_dig == 2 = "nd" | last_dig == 3 = "rd" | otherwise = "th" last_dig = n `rem` 10 -- | Converts an integer to a verbal multiplicity: -- -- > speakN 0 = text "none" -- > speakN 5 = text "five" -- > speakN 10 = text "10"
413
false
false
0
8
151
107
54
53
null
null
adept/hledger
hledger-ui/Hledger/UI/UIUtils.hs
gpl-3.0
minibuffer :: T.Text -> Editor String Name -> Widget Name minibuffer string ed = forceAttr ("border" <> "minibuffer") $ hBox [txt $ string <> ": ", renderEditor (str . unlines) True ed]
189
minibuffer :: T.Text -> Editor String Name -> Widget Name minibuffer string ed = forceAttr ("border" <> "minibuffer") $ hBox [txt $ string <> ": ", renderEditor (str . unlines) True ed]
189
minibuffer string ed = forceAttr ("border" <> "minibuffer") $ hBox [txt $ string <> ": ", renderEditor (str . unlines) True ed]
131
false
true
0
10
35
79
39
40
null
null
bergmark/clay
src/Clay/Selector.hs
bsd-3-clause
-- | Filter elements by pseudo selector or pseudo class. The preferred syntax -- is to enable @OverloadedStrings@ and use @\":pseudo-selector\"@ or use one -- of the predefined ones from "Clay.Pseudo". pseudo :: Text -> Refinement pseudo = Refinement . pure . Pseudo
267
pseudo :: Text -> Refinement pseudo = Refinement . pure . Pseudo
64
pseudo = Refinement . pure . Pseudo
35
true
true
0
7
43
33
16
17
null
null
alpheccar/HaskellViewer
AIFF.hs
bsd-3-clause
debug a = trace (show a) a
26
debug a = trace (show a) a
26
debug a = trace (show a) a
26
false
false
0
7
6
20
9
11
null
null
ekmett/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
phaseInputExt (Unlit HsBootFile) = "lhs-boot"
46
phaseInputExt (Unlit HsBootFile) = "lhs-boot"
46
phaseInputExt (Unlit HsBootFile) = "lhs-boot"
46
false
false
0
6
5
16
7
9
null
null
ecaustin/haskhol-core
src/HaskHOL/Core/Kernel/Terms.hs
bsd-2-clause
{-| Constructs an equation term given the left and right hand side arguments. Fails if the types of the terms are not alpha-equivalent. -} primMkEq :: MonadThrow m => HOLTerm -> HOLTerm -> m HOLTerm primMkEq l r | ty `tyAConv` typeOf r = return $! CombIn (CombIn (tmEq ty) l) r | otherwise = throwM $! HOLTermError l "primMkEq" where ty = typeOf l {-| Destructs an equation term, returning the left and right hand side arguments. Fails with 'Nothing' if the term is not an equation, i.e. of the form @l = r@. -}
541
primMkEq :: MonadThrow m => HOLTerm -> HOLTerm -> m HOLTerm primMkEq l r | ty `tyAConv` typeOf r = return $! CombIn (CombIn (tmEq ty) l) r | otherwise = throwM $! HOLTermError l "primMkEq" where ty = typeOf l {-| Destructs an equation term, returning the left and right hand side arguments. Fails with 'Nothing' if the term is not an equation, i.e. of the form @l = r@. -}
395
primMkEq l r | ty `tyAConv` typeOf r = return $! CombIn (CombIn (tmEq ty) l) r | otherwise = throwM $! HOLTermError l "primMkEq" where ty = typeOf l {-| Destructs an equation term, returning the left and right hand side arguments. Fails with 'Nothing' if the term is not an equation, i.e. of the form @l = r@. -}
335
true
true
2
11
125
108
50
58
null
null
mettekou/ghc
compiler/prelude/THNames.hs
bsd-3-clause
classDIdKey = mkPreludeMiscIdUnique 325
61
classDIdKey = mkPreludeMiscIdUnique 325
61
classDIdKey = mkPreludeMiscIdUnique 325
61
false
false
0
5
25
9
4
5
null
null
bsima/aristotl
api/app/Main.hs
mit
getEntry :: MonadIO m => String -> ActionCtxT ctx m b getEntry path = do response <- httpLBS $ parseRequest_ $ basePath ++ path text $ parseEntryText $ getResponseBody response
183
getEntry :: MonadIO m => String -> ActionCtxT ctx m b getEntry path = do response <- httpLBS $ parseRequest_ $ basePath ++ path text $ parseEntryText $ getResponseBody response
183
getEntry path = do response <- httpLBS $ parseRequest_ $ basePath ++ path text $ parseEntryText $ getResponseBody response
129
false
true
0
10
36
65
30
35
null
null
Heather/stack
src/Stack/Exec.hs
bsd-3-clause
-- | Default @EnvSettings@ which includes locals and GHC_PACKAGE_PATH defaultEnvSettings :: EnvSettings defaultEnvSettings = EnvSettings { esIncludeLocals = True , esIncludeGhcPackagePath = True , esStackExe = True , esLocaleUtf8 = False }
259
defaultEnvSettings :: EnvSettings defaultEnvSettings = EnvSettings { esIncludeLocals = True , esIncludeGhcPackagePath = True , esStackExe = True , esLocaleUtf8 = False }
189
defaultEnvSettings = EnvSettings { esIncludeLocals = True , esIncludeGhcPackagePath = True , esStackExe = True , esLocaleUtf8 = False }
155
true
true
0
7
51
42
25
17
null
null
pshendry/dsgen
src/Dsgen/GUIState.hs
gpl-3.0
mkSetSelectOptions :: GUIState -> [Card] -> SetSelectOptions mkSetSelectOptions gst cs = SetSelectOptions { ssoPickCount = pickCount - (length manualCards), -- TODO: Non-hardcode 10 ssoPool = (cs \\ manualCards) \\ (vetoedCardsList gst), ssoManualPicks = manualCards, ssoSources = sources, ssoEmphasis = emphasis, ssoFilters = filters, ssoRules = rules, ssoColPlatAddition = colPlat, ssoSheltersAddition = shelters } where pickCount = (pickCountValue gst) + 8 manualCards = manualCardsList gst sources = concat [ (if dominionCheckedState gst then [Dominion] else []), (if intrigueCheckedState gst then [Intrigue] else []), (if alchemyCheckedState gst then [Alchemy] else []), (if seasideCheckedState gst then [Seaside] else []), (if prosperityCheckedState gst then [Prosperity] else []), (if cornucopiaCheckedState gst then [Cornucopia] else []), (if hinterlandsCheckedState gst then [Hinterlands] else []), (if darkAgesCheckedState gst then [DarkAges] else []), (if guildsCheckedState gst then [Guilds] else []), (if envoyCheckedState gst then [EnvoyPromo] else []), (if blackMarketCheckedState gst then [BlackMarketPromo] else []), (if governorCheckedState gst then [GovernorPromo] else []), (if stashCheckedState gst then [StashPromo] else []), (if walledVillageCheckedState gst then [WalledVillagePromo] else []), (if customCheckedState gst then [Custom] else []) ] emphasis = if not $ emphasisCheckedState gst then NoEmphasis else case emphasisValue gst of 0 -> RandomEmphasis 1 -> DominionEmphasis 2 -> IntrigueEmphasis 3 -> SeasideEmphasis 4 -> AlchemyEmphasis 5 -> ProsperityEmphasis 6 -> CornucopiaEmphasis 7 -> HinterlandsEmphasis 8 -> DarkAgesEmphasis 9 -> GuildsEmphasis filters = concat [ (if actionFilterCheckedState gst then [actionFilter] else []), (if complexityFilterCheckedState gst then [complexityFilter $ convertComplexityFilterValue $ complexityFilterValue gst] else []) ] rules = concat [ (if reactionRuleCheckedState gst then [reactionRule $ convertReactionRuleValue $ reactionRuleValue gst] else []), (if trasherRuleCheckedState gst then [trasherRule $ convertTrasherRuleValue $ trasherRuleValue gst] else []), (if interactivityRuleCheckedState gst then [interactivityRule $ convertInteractivityRuleValue $ interactivityRuleValue gst] else []), (if costVarietyRuleCheckedState gst then [costVarietyRule] else []) ] colPlat = if colPlatAdditionCheckedState gst then RandomColPlat else NoColPlat shelters = if not $ sheltersAdditionCheckedState gst then NoShelters else case sheltersAdditionValue gst of 0 -> SheltersWithDarkAges 1 -> RandomShelters convertComplexityFilterValue v = case v of 0 -> LowComplexityOnly 1 -> MediumComplexityOrLower 2 -> HighComplexityOrLower convertReactionRuleValue v = case v of 0 -> RequireMoat 1 -> RequireBlocker 2 -> RequireReaction convertTrasherRuleValue v = case v of 0 -> TrasherWithCurse 1 -> AlwaysTrasher convertInteractivityRuleValue v = v + 1
4,163
mkSetSelectOptions :: GUIState -> [Card] -> SetSelectOptions mkSetSelectOptions gst cs = SetSelectOptions { ssoPickCount = pickCount - (length manualCards), -- TODO: Non-hardcode 10 ssoPool = (cs \\ manualCards) \\ (vetoedCardsList gst), ssoManualPicks = manualCards, ssoSources = sources, ssoEmphasis = emphasis, ssoFilters = filters, ssoRules = rules, ssoColPlatAddition = colPlat, ssoSheltersAddition = shelters } where pickCount = (pickCountValue gst) + 8 manualCards = manualCardsList gst sources = concat [ (if dominionCheckedState gst then [Dominion] else []), (if intrigueCheckedState gst then [Intrigue] else []), (if alchemyCheckedState gst then [Alchemy] else []), (if seasideCheckedState gst then [Seaside] else []), (if prosperityCheckedState gst then [Prosperity] else []), (if cornucopiaCheckedState gst then [Cornucopia] else []), (if hinterlandsCheckedState gst then [Hinterlands] else []), (if darkAgesCheckedState gst then [DarkAges] else []), (if guildsCheckedState gst then [Guilds] else []), (if envoyCheckedState gst then [EnvoyPromo] else []), (if blackMarketCheckedState gst then [BlackMarketPromo] else []), (if governorCheckedState gst then [GovernorPromo] else []), (if stashCheckedState gst then [StashPromo] else []), (if walledVillageCheckedState gst then [WalledVillagePromo] else []), (if customCheckedState gst then [Custom] else []) ] emphasis = if not $ emphasisCheckedState gst then NoEmphasis else case emphasisValue gst of 0 -> RandomEmphasis 1 -> DominionEmphasis 2 -> IntrigueEmphasis 3 -> SeasideEmphasis 4 -> AlchemyEmphasis 5 -> ProsperityEmphasis 6 -> CornucopiaEmphasis 7 -> HinterlandsEmphasis 8 -> DarkAgesEmphasis 9 -> GuildsEmphasis filters = concat [ (if actionFilterCheckedState gst then [actionFilter] else []), (if complexityFilterCheckedState gst then [complexityFilter $ convertComplexityFilterValue $ complexityFilterValue gst] else []) ] rules = concat [ (if reactionRuleCheckedState gst then [reactionRule $ convertReactionRuleValue $ reactionRuleValue gst] else []), (if trasherRuleCheckedState gst then [trasherRule $ convertTrasherRuleValue $ trasherRuleValue gst] else []), (if interactivityRuleCheckedState gst then [interactivityRule $ convertInteractivityRuleValue $ interactivityRuleValue gst] else []), (if costVarietyRuleCheckedState gst then [costVarietyRule] else []) ] colPlat = if colPlatAdditionCheckedState gst then RandomColPlat else NoColPlat shelters = if not $ sheltersAdditionCheckedState gst then NoShelters else case sheltersAdditionValue gst of 0 -> SheltersWithDarkAges 1 -> RandomShelters convertComplexityFilterValue v = case v of 0 -> LowComplexityOnly 1 -> MediumComplexityOrLower 2 -> HighComplexityOrLower convertReactionRuleValue v = case v of 0 -> RequireMoat 1 -> RequireBlocker 2 -> RequireReaction convertTrasherRuleValue v = case v of 0 -> TrasherWithCurse 1 -> AlwaysTrasher convertInteractivityRuleValue v = v + 1
4,163
mkSetSelectOptions gst cs = SetSelectOptions { ssoPickCount = pickCount - (length manualCards), -- TODO: Non-hardcode 10 ssoPool = (cs \\ manualCards) \\ (vetoedCardsList gst), ssoManualPicks = manualCards, ssoSources = sources, ssoEmphasis = emphasis, ssoFilters = filters, ssoRules = rules, ssoColPlatAddition = colPlat, ssoSheltersAddition = shelters } where pickCount = (pickCountValue gst) + 8 manualCards = manualCardsList gst sources = concat [ (if dominionCheckedState gst then [Dominion] else []), (if intrigueCheckedState gst then [Intrigue] else []), (if alchemyCheckedState gst then [Alchemy] else []), (if seasideCheckedState gst then [Seaside] else []), (if prosperityCheckedState gst then [Prosperity] else []), (if cornucopiaCheckedState gst then [Cornucopia] else []), (if hinterlandsCheckedState gst then [Hinterlands] else []), (if darkAgesCheckedState gst then [DarkAges] else []), (if guildsCheckedState gst then [Guilds] else []), (if envoyCheckedState gst then [EnvoyPromo] else []), (if blackMarketCheckedState gst then [BlackMarketPromo] else []), (if governorCheckedState gst then [GovernorPromo] else []), (if stashCheckedState gst then [StashPromo] else []), (if walledVillageCheckedState gst then [WalledVillagePromo] else []), (if customCheckedState gst then [Custom] else []) ] emphasis = if not $ emphasisCheckedState gst then NoEmphasis else case emphasisValue gst of 0 -> RandomEmphasis 1 -> DominionEmphasis 2 -> IntrigueEmphasis 3 -> SeasideEmphasis 4 -> AlchemyEmphasis 5 -> ProsperityEmphasis 6 -> CornucopiaEmphasis 7 -> HinterlandsEmphasis 8 -> DarkAgesEmphasis 9 -> GuildsEmphasis filters = concat [ (if actionFilterCheckedState gst then [actionFilter] else []), (if complexityFilterCheckedState gst then [complexityFilter $ convertComplexityFilterValue $ complexityFilterValue gst] else []) ] rules = concat [ (if reactionRuleCheckedState gst then [reactionRule $ convertReactionRuleValue $ reactionRuleValue gst] else []), (if trasherRuleCheckedState gst then [trasherRule $ convertTrasherRuleValue $ trasherRuleValue gst] else []), (if interactivityRuleCheckedState gst then [interactivityRule $ convertInteractivityRuleValue $ interactivityRuleValue gst] else []), (if costVarietyRuleCheckedState gst then [costVarietyRule] else []) ] colPlat = if colPlatAdditionCheckedState gst then RandomColPlat else NoColPlat shelters = if not $ sheltersAdditionCheckedState gst then NoShelters else case sheltersAdditionValue gst of 0 -> SheltersWithDarkAges 1 -> RandomShelters convertComplexityFilterValue v = case v of 0 -> LowComplexityOnly 1 -> MediumComplexityOrLower 2 -> HighComplexityOrLower convertReactionRuleValue v = case v of 0 -> RequireMoat 1 -> RequireBlocker 2 -> RequireReaction convertTrasherRuleValue v = case v of 0 -> TrasherWithCurse 1 -> AlwaysTrasher convertInteractivityRuleValue v = v + 1
4,102
false
true
0
11
1,618
905
505
400
null
null
postgres-haskell/postgres-wire
bench/Codecs.hs
mit
main :: IO () main = defaultMain [ bgroup "Encoding" [ bench "Message" $ nf encodeMessage queryParams , bench "Scientific" $ nf (runEncode . PE.numeric) testScientific , bench "UTCTime" $ nf (runEncode . PE.timestamptz) testUTCTime , bench "UUID" $ nf (runEncode . PE.uuid) testUUID ] , bgroup "Decoding" [ bench "Message" $ nf decodeMessage testDataRows , bench "Message as bytes" $ nf decodeMessageBytes testDataRows , bench "Scientific" $ nf (runDecode $ PD.numeric 0) testScientificEncoded , bench "UTCTime" $ nf (runDecode $ PD.timestamptz 0) testUTCTimeEncoded , bench "UUID" $ nf (runDecode $ PD.uuid 0) testUUIDEncoded ] ]
730
main :: IO () main = defaultMain [ bgroup "Encoding" [ bench "Message" $ nf encodeMessage queryParams , bench "Scientific" $ nf (runEncode . PE.numeric) testScientific , bench "UTCTime" $ nf (runEncode . PE.timestamptz) testUTCTime , bench "UUID" $ nf (runEncode . PE.uuid) testUUID ] , bgroup "Decoding" [ bench "Message" $ nf decodeMessage testDataRows , bench "Message as bytes" $ nf decodeMessageBytes testDataRows , bench "Scientific" $ nf (runDecode $ PD.numeric 0) testScientificEncoded , bench "UTCTime" $ nf (runDecode $ PD.timestamptz 0) testUTCTimeEncoded , bench "UUID" $ nf (runDecode $ PD.uuid 0) testUUIDEncoded ] ]
730
main = defaultMain [ bgroup "Encoding" [ bench "Message" $ nf encodeMessage queryParams , bench "Scientific" $ nf (runEncode . PE.numeric) testScientific , bench "UTCTime" $ nf (runEncode . PE.timestamptz) testUTCTime , bench "UUID" $ nf (runEncode . PE.uuid) testUUID ] , bgroup "Decoding" [ bench "Message" $ nf decodeMessage testDataRows , bench "Message as bytes" $ nf decodeMessageBytes testDataRows , bench "Scientific" $ nf (runDecode $ PD.numeric 0) testScientificEncoded , bench "UTCTime" $ nf (runDecode $ PD.timestamptz 0) testUTCTimeEncoded , bench "UUID" $ nf (runDecode $ PD.uuid 0) testUUIDEncoded ] ]
716
false
true
0
14
195
239
114
125
null
null
fmthoma/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
failM_RDR = nameRdrName failMName
47
failM_RDR = nameRdrName failMName
47
failM_RDR = nameRdrName failMName
47
false
false
0
5
17
9
4
5
null
null
google/codeworld
codeworld-prediction/tests/Common.hs
apache-2.0
shrinkOne :: Arbitrary a => a -> ShrinkOne a shrinkOne x = ShrinkOne x (shrink x)
81
shrinkOne :: Arbitrary a => a -> ShrinkOne a shrinkOne x = ShrinkOne x (shrink x)
81
shrinkOne x = ShrinkOne x (shrink x)
36
false
true
0
7
15
39
18
21
null
null
nevrenato/Hets_Fork
CSL/InteractiveTests.hs
gpl-2.0
test :: (Pretty a, MonadIO m) => Int -> ([Named CMD] -> m a) -> m () test i f = testResult i f >>= liftIO . putStrLn . show . pretty
132
test :: (Pretty a, MonadIO m) => Int -> ([Named CMD] -> m a) -> m () test i f = testResult i f >>= liftIO . putStrLn . show . pretty
132
test i f = testResult i f >>= liftIO . putStrLn . show . pretty
63
false
true
0
12
31
86
41
45
null
null
wochinge/CacheSimulator
app/Main.hs
bsd-3-clause
calculateLfu :: (String, CacheSize, WriteStrategy) -> IO() calculateLfu (logPath, sizeOfCache, strategy) = do let cache = empty sizeOfCache strategy :: Lfu.Lfu simulate "LFU" logPath cache
196
calculateLfu :: (String, CacheSize, WriteStrategy) -> IO() calculateLfu (logPath, sizeOfCache, strategy) = do let cache = empty sizeOfCache strategy :: Lfu.Lfu simulate "LFU" logPath cache
196
calculateLfu (logPath, sizeOfCache, strategy) = do let cache = empty sizeOfCache strategy :: Lfu.Lfu simulate "LFU" logPath cache
137
false
true
0
10
32
70
36
34
null
null
patperry/permutation
lib/Data/Permute/MPermute.hs
bsd-3-clause
-- | @getRank n xs@ eturns a permutation, the inverse of which rearranges the -- first @n@ elements of @xs@ into ascending order. The returned permutation, -- @p@, has the property that @p[i]@ is the rank of the @i@th element of @xs@. -- The results are undefined if @n@ is greater than the length of @xs@. -- This is a special case of 'getRankBy'. getRank :: (Ord a, MPermute p m) => Int -> [a] -> m p getRank = getRankBy compare
435
getRank :: (Ord a, MPermute p m) => Int -> [a] -> m p getRank = getRankBy compare
81
getRank = getRankBy compare
27
true
true
0
9
86
55
29
26
null
null
chrisjpn/CPIB_ILMCompiler
src/VM/VirtualMachineIO.hs
bsd-3-clause
execInstr (Gt Int64VmTy) (pc, fp, Int64VmVal y : Int64VmVal x : stack) = return2 (pc + 1, fp, IntVmVal (boolToInt (x > y)) : stack)
133
execInstr (Gt Int64VmTy) (pc, fp, Int64VmVal y : Int64VmVal x : stack) = return2 (pc + 1, fp, IntVmVal (boolToInt (x > y)) : stack)
133
execInstr (Gt Int64VmTy) (pc, fp, Int64VmVal y : Int64VmVal x : stack) = return2 (pc + 1, fp, IntVmVal (boolToInt (x > y)) : stack)
133
false
false
0
12
26
76
39
37
null
null
Zoetermeer/latro
src/Latro/Ast.hs
mit
synTyArrowTys :: SynTy a id -> [SynTy a id] synTyArrowTys (SynTyArrow _ tyArgs retTy) = tyArgs ++ [retTy]
105
synTyArrowTys :: SynTy a id -> [SynTy a id] synTyArrowTys (SynTyArrow _ tyArgs retTy) = tyArgs ++ [retTy]
105
synTyArrowTys (SynTyArrow _ tyArgs retTy) = tyArgs ++ [retTy]
61
false
true
0
7
17
48
24
24
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_COMBINER6_NV :: GLenum gl_COMBINER6_NV = 0x8556
50
gl_COMBINER6_NV :: GLenum gl_COMBINER6_NV = 0x8556
50
gl_COMBINER6_NV = 0x8556
24
false
true
0
4
5
11
6
5
null
null
arirahikkala/straylight-divergence
src/Main.hs
gpl-3.0
introduceObj (o, loc) = do r <- supplyId level <- playerLevel mGlobal (positions ^: Loc.introduce r (OnMap level loc)) touch r o
153
introduceObj (o, loc) = do r <- supplyId level <- playerLevel mGlobal (positions ^: Loc.introduce r (OnMap level loc)) touch r o
153
introduceObj (o, loc) = do r <- supplyId level <- playerLevel mGlobal (positions ^: Loc.introduce r (OnMap level loc)) touch r o
153
false
false
0
12
46
65
30
35
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxLANGUAGE_INUKTITUT :: Int wxLANGUAGE_INUKTITUT = 105
54
wxLANGUAGE_INUKTITUT :: Int wxLANGUAGE_INUKTITUT = 105
54
wxLANGUAGE_INUKTITUT = 105
26
false
true
0
4
5
11
6
5
null
null
da-x/lamdu
Lamdu/Sugar/Convert/Apply.hs
gpl-3.0
orderedInnerHoles :: Val a -> [Val a] orderedInnerHoles e = case e ^. Val.body of V.BLeaf V.LHole -> [e] V.BApp (V.Apply func@(Val _ (V.BLeaf V.LHole)) arg) -> orderedInnerHoles arg ++ [func] body -> Foldable.concatMap orderedInnerHoles body
265
orderedInnerHoles :: Val a -> [Val a] orderedInnerHoles e = case e ^. Val.body of V.BLeaf V.LHole -> [e] V.BApp (V.Apply func@(Val _ (V.BLeaf V.LHole)) arg) -> orderedInnerHoles arg ++ [func] body -> Foldable.concatMap orderedInnerHoles body
265
orderedInnerHoles e = case e ^. Val.body of V.BLeaf V.LHole -> [e] V.BApp (V.Apply func@(Val _ (V.BLeaf V.LHole)) arg) -> orderedInnerHoles arg ++ [func] body -> Foldable.concatMap orderedInnerHoles body
227
false
true
0
16
59
118
58
60
null
null
abstools/abs-haskell-formal
benchmarks/6_hanoi/progs/20.hs
bsd-3-clause
(a:b:tmp:n:n1:res:the_end:_)=[1..]
34
(a:b:tmp:n:n1:res:the_end:_)=[1..]
34
(a:b:tmp:n:n1:res:the_end:_)=[1..]
34
false
false
0
12
0
41
21
20
null
null
valderman/selda
selda/src/Database/Selda/Migrations.hs
mit
-- | Perform all given migrations as a single transaction. migrateAll :: (MonadSelda m, MonadMask m) => Bool -- ^ Enforce foreign keys during migration? -> MigrationStep (Backend m) -- ^ Migration step to perform. -> m () migrateAll fks = wrap fks . mapM_ (\(Migration t1 t2 upg) -> migrateInternal t1 t2 upg)
344
migrateAll :: (MonadSelda m, MonadMask m) => Bool -- ^ Enforce foreign keys during migration? -> MigrationStep (Backend m) -- ^ Migration step to perform. -> m () migrateAll fks = wrap fks . mapM_ (\(Migration t1 t2 upg) -> migrateInternal t1 t2 upg)
285
migrateAll fks = wrap fks . mapM_ (\(Migration t1 t2 upg) -> migrateInternal t1 t2 upg)
89
true
true
0
10
88
89
45
44
null
null
Gathros/algorithm-archive
contents/huffman_encoding/code/haskell/huffman.hs
mit
encode :: (Ord a) => [a] -> (Maybe (Tree a), [Bit]) encode s = (tree, msg) where tree = buildTree s msg = concatMap (table M.!) s table = case tree of Nothing -> M.empty Just t -> M.fromList $ mkTable (t, []) mkTable (Leaf _ a, p) = [(a, reverse p)] mkTable (Node _ t1 t2, p) = concatMap mkTable [(t1, Zero:p), (t2, One:p)]
349
encode :: (Ord a) => [a] -> (Maybe (Tree a), [Bit]) encode s = (tree, msg) where tree = buildTree s msg = concatMap (table M.!) s table = case tree of Nothing -> M.empty Just t -> M.fromList $ mkTable (t, []) mkTable (Leaf _ a, p) = [(a, reverse p)] mkTable (Node _ t1 t2, p) = concatMap mkTable [(t1, Zero:p), (t2, One:p)]
349
encode s = (tree, msg) where tree = buildTree s msg = concatMap (table M.!) s table = case tree of Nothing -> M.empty Just t -> M.fromList $ mkTable (t, []) mkTable (Leaf _ a, p) = [(a, reverse p)] mkTable (Node _ t1 t2, p) = concatMap mkTable [(t1, Zero:p), (t2, One:p)]
297
false
true
3
12
90
224
113
111
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/OpCodes.hs
bsd-2-clause
opSummaryVal OpGroupRemove { opGroupName = s } = Just (fromNonEmpty s)
70
opSummaryVal OpGroupRemove { opGroupName = s } = Just (fromNonEmpty s)
70
opSummaryVal OpGroupRemove { opGroupName = s } = Just (fromNonEmpty s)
70
false
false
0
8
10
27
13
14
null
null
projectorhq/haskell-liquid
src/Text/Liquid/Renderer.hs
bsd-3-clause
-- | Apply the array filter if the targeted value is an array, otherwise the reg filter arrayFilterM :: Value -> Expr -> Maybe Text arrayFilterM v fc | isn't _Nothing $ st = st >>= (flip applyFilterM) fc | otherwise = applyArrayFilterM arr fc where st = v ^? _String arr = v ^.. values -- | Apply an array filter to an array
370
arrayFilterM :: Value -> Expr -> Maybe Text arrayFilterM v fc | isn't _Nothing $ st = st >>= (flip applyFilterM) fc | otherwise = applyArrayFilterM arr fc where st = v ^? _String arr = v ^.. values -- | Apply an array filter to an array
282
arrayFilterM v fc | isn't _Nothing $ st = st >>= (flip applyFilterM) fc | otherwise = applyArrayFilterM arr fc where st = v ^? _String arr = v ^.. values -- | Apply an array filter to an array
232
true
true
7
9
110
102
45
57
null
null
Unisay/dancher
src/Topic/Controller.hs
bsd-3-clause
deleteTopic :: TopicId -> Response NoContent deleteTopic id = do db <- dbConnections <$> ask deleted <- liftIO $ Repo.delete db id if deleted then return NoContent else lift (throwError err404)
207
deleteTopic :: TopicId -> Response NoContent deleteTopic id = do db <- dbConnections <$> ask deleted <- liftIO $ Repo.delete db id if deleted then return NoContent else lift (throwError err404)
207
deleteTopic id = do db <- dbConnections <$> ask deleted <- liftIO $ Repo.delete db id if deleted then return NoContent else lift (throwError err404)
162
false
true
0
11
44
78
35
43
null
null
Cordite-Studios/asteroid-core
src/Solar/Asteroid/Core/Valuable/Derive.hs
mit
useReadShowInstance :: Name -> Q [Dec] useReadShowInstance val = [d| instance TextValuable $(conT val) String where encodeAsText = T.pack . show decodeFromText = readEither . T.unpack |]
211
useReadShowInstance :: Name -> Q [Dec] useReadShowInstance val = [d| instance TextValuable $(conT val) String where encodeAsText = T.pack . show decodeFromText = readEither . T.unpack |]
211
useReadShowInstance val = [d| instance TextValuable $(conT val) String where encodeAsText = T.pack . show decodeFromText = readEither . T.unpack |]
172
false
true
0
7
51
28
16
12
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/RequestSpotFleet.hs
mpl-2.0
-- | Creates a value of 'RequestSpotFleetResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'rsfrsResponseStatus' -- -- * 'rsfrsSpotFleetRequestId' requestSpotFleetResponse :: Int -- ^ 'rsfrsResponseStatus' -> Text -- ^ 'rsfrsSpotFleetRequestId' -> RequestSpotFleetResponse requestSpotFleetResponse pResponseStatus_ pSpotFleetRequestId_ = RequestSpotFleetResponse' { _rsfrsResponseStatus = pResponseStatus_ , _rsfrsSpotFleetRequestId = pSpotFleetRequestId_ }
578
requestSpotFleetResponse :: Int -- ^ 'rsfrsResponseStatus' -> Text -- ^ 'rsfrsSpotFleetRequestId' -> RequestSpotFleetResponse requestSpotFleetResponse pResponseStatus_ pSpotFleetRequestId_ = RequestSpotFleetResponse' { _rsfrsResponseStatus = pResponseStatus_ , _rsfrsSpotFleetRequestId = pSpotFleetRequestId_ }
338
requestSpotFleetResponse pResponseStatus_ pSpotFleetRequestId_ = RequestSpotFleetResponse' { _rsfrsResponseStatus = pResponseStatus_ , _rsfrsSpotFleetRequestId = pSpotFleetRequestId_ }
200
true
true
0
6
92
47
30
17
null
null
AlainODea-haskell/zonemaker
MachineJSON.hs
apache-2.0
ipString :: String -> IPAddress ipString addr = ipList $ map (\x -> readIPAddress $ T.unpack x) (T.split (== '.') (T.pack addr))
128
ipString :: String -> IPAddress ipString addr = ipList $ map (\x -> readIPAddress $ T.unpack x) (T.split (== '.') (T.pack addr))
128
ipString addr = ipList $ map (\x -> readIPAddress $ T.unpack x) (T.split (== '.') (T.pack addr))
96
false
true
0
11
21
69
35
34
null
null
sonyandy/tnt
Control/Monad/Code/Internal.hs
bsd-3-clause
double :: ArrayType double = ArrayType 7
40
double :: ArrayType double = ArrayType 7
40
double = ArrayType 7
20
false
true
0
5
6
14
7
7
null
null
trxeste/wrk
haskell/haskellTextEditor/haskellEd.hs
bsd-3-clause
numLines (n, (('i':'m':'p':'o':'r':'t':x):xs)) m= do putStr (mkNumCursor " " n) setSGR [SetColor Foreground Vivid Red] putStr "import" setSGR [Reset] putStrLn x numLines (n+1, xs) (m-1)
198
numLines (n, (('i':'m':'p':'o':'r':'t':x):xs)) m= do putStr (mkNumCursor " " n) setSGR [SetColor Foreground Vivid Red] putStr "import" setSGR [Reset] putStrLn x numLines (n+1, xs) (m-1)
198
numLines (n, (('i':'m':'p':'o':'r':'t':x):xs)) m= do putStr (mkNumCursor " " n) setSGR [SetColor Foreground Vivid Red] putStr "import" setSGR [Reset] putStrLn x numLines (n+1, xs) (m-1)
198
false
false
0
15
37
127
61
66
null
null
egaburov/funstuff
Haskell/thsk/QQAst.hs
apache-2.0
intExpr (Sub e1 e2) = (-) <$> intExpr e1 <*> intExpr e2
55
intExpr (Sub e1 e2) = (-) <$> intExpr e1 <*> intExpr e2
55
intExpr (Sub e1 e2) = (-) <$> intExpr e1 <*> intExpr e2
55
false
false
0
7
11
34
16
18
null
null
bobjflong/scalpel
src/Shelduck/Configuration.hs
apache-2.0
alarmThreshold :: Double alarmThreshold = 0.5
45
alarmThreshold :: Double alarmThreshold = 0.5
45
alarmThreshold = 0.5
20
false
true
0
6
5
18
7
11
null
null
d0kt0r0/Tidal
src/Sound/Tidal/Params.hs
gpl-3.0
lclaves :: Pattern Double -> ControlPattern lclaves = pF "lclaves"
66
lclaves :: Pattern Double -> ControlPattern lclaves = pF "lclaves"
66
lclaves = pF "lclaves"
22
false
true
0
6
9
21
10
11
null
null
wskplho/stack
src/Stack/Types/Config.hs
bsd-3-clause
-- | Get the extra bin directories (for the PATH). Puts more local first -- -- Bool indicates whether or not to include the locals extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir]) extraBinDirs = do deps <- installationRootDeps local <- installationRootLocal return $ \locals -> if locals then [local </> bindirSuffix, deps </> bindirSuffix] else [deps </> bindirSuffix] -- | Get the minimal environment override, useful for just calling external -- processes like git or ghc
565
extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir]) extraBinDirs = do deps <- installationRootDeps local <- installationRootLocal return $ \locals -> if locals then [local </> bindirSuffix, deps </> bindirSuffix] else [deps </> bindirSuffix] -- | Get the minimal environment override, useful for just calling external -- processes like git or ghc
434
extraBinDirs = do deps <- installationRootDeps local <- installationRootLocal return $ \locals -> if locals then [local </> bindirSuffix, deps </> bindirSuffix] else [deps </> bindirSuffix] -- | Get the minimal environment override, useful for just calling external -- processes like git or ghc
323
true
true
0
11
126
112
61
51
null
null
Bodigrim/arithmoi
test-suite/Math/NumberTheory/Recurrences/LinearTests.hs
mit
generalLucasProperty3 :: AnySign Integer -> AnySign Integer -> Bool generalLucasProperty3 (AnySign p) (AnySign q) = generalLucas p q 0 == (0, 1, 2, p)
150
generalLucasProperty3 :: AnySign Integer -> AnySign Integer -> Bool generalLucasProperty3 (AnySign p) (AnySign q) = generalLucas p q 0 == (0, 1, 2, p)
150
generalLucasProperty3 (AnySign p) (AnySign q) = generalLucas p q 0 == (0, 1, 2, p)
82
false
true
0
7
23
65
33
32
null
null
gnn/Hets
GUI/GtkLinkTypeChoice.hs
gpl-2.0
-- | Displays the linktype selection window showLinkTypeChoice :: IORef [String] -> ([DGEdgeType] -> IO ()) -> IO () showLinkTypeChoice ioRefDeselect updateFunction = postGUIAsync $ do xml <- getGladeXML LinkTypeChoice.get window <- xmlGetWidget xml castToWindow "linktypechoice" ok <- xmlGetWidget xml castToButton "btnOk" cancel <- xmlGetWidget xml castToButton "btnCancel" select <- xmlGetWidget xml castToButton "btnSelect" deselect <- xmlGetWidget xml castToButton "btnDeselect" invert <- xmlGetWidget xml castToButton "btnInvert" deselectEdgeTypes <- readIORef ioRefDeselect mapM_ (\ name -> do cb <- xmlGetWidget xml castToCheckButton name toggleButtonSetActive cb False ) deselectEdgeTypes let edgeMap = mapEdgeTypesToNames keys = Map.keys edgeMap setAllTo to = mapM_ (\ name -> do cb <- xmlGetWidget xml castToCheckButton name to' <- to cb toggleButtonSetActive cb to' ) keys onClicked select $ setAllTo (\ _ -> return True) onClicked deselect $ setAllTo (\ _ -> return False) onClicked invert $ setAllTo (\ cb -> do selected <- toggleButtonGetActive cb return $ not selected ) onClicked cancel $ widgetDestroy window onClicked ok $ do edgeTypeNames <- filterM (\ name -> do cb <- xmlGetWidget xml castToCheckButton name selected <- toggleButtonGetActive cb return $ not selected ) keys writeIORef ioRefDeselect edgeTypeNames let edgeTypes = foldl (\ eList (e, eI) -> e : eI : eList) [] $ map (flip (Map.findWithDefault (error "GtkLinkTypeChoice: lookup error!")) edgeMap ) edgeTypeNames forkIO_ $ updateFunction edgeTypes widgetDestroy window widgetShow window
2,140
showLinkTypeChoice :: IORef [String] -> ([DGEdgeType] -> IO ()) -> IO () showLinkTypeChoice ioRefDeselect updateFunction = postGUIAsync $ do xml <- getGladeXML LinkTypeChoice.get window <- xmlGetWidget xml castToWindow "linktypechoice" ok <- xmlGetWidget xml castToButton "btnOk" cancel <- xmlGetWidget xml castToButton "btnCancel" select <- xmlGetWidget xml castToButton "btnSelect" deselect <- xmlGetWidget xml castToButton "btnDeselect" invert <- xmlGetWidget xml castToButton "btnInvert" deselectEdgeTypes <- readIORef ioRefDeselect mapM_ (\ name -> do cb <- xmlGetWidget xml castToCheckButton name toggleButtonSetActive cb False ) deselectEdgeTypes let edgeMap = mapEdgeTypesToNames keys = Map.keys edgeMap setAllTo to = mapM_ (\ name -> do cb <- xmlGetWidget xml castToCheckButton name to' <- to cb toggleButtonSetActive cb to' ) keys onClicked select $ setAllTo (\ _ -> return True) onClicked deselect $ setAllTo (\ _ -> return False) onClicked invert $ setAllTo (\ cb -> do selected <- toggleButtonGetActive cb return $ not selected ) onClicked cancel $ widgetDestroy window onClicked ok $ do edgeTypeNames <- filterM (\ name -> do cb <- xmlGetWidget xml castToCheckButton name selected <- toggleButtonGetActive cb return $ not selected ) keys writeIORef ioRefDeselect edgeTypeNames let edgeTypes = foldl (\ eList (e, eI) -> e : eI : eList) [] $ map (flip (Map.findWithDefault (error "GtkLinkTypeChoice: lookup error!")) edgeMap ) edgeTypeNames forkIO_ $ updateFunction edgeTypes widgetDestroy window widgetShow window
2,096
showLinkTypeChoice ioRefDeselect updateFunction = postGUIAsync $ do xml <- getGladeXML LinkTypeChoice.get window <- xmlGetWidget xml castToWindow "linktypechoice" ok <- xmlGetWidget xml castToButton "btnOk" cancel <- xmlGetWidget xml castToButton "btnCancel" select <- xmlGetWidget xml castToButton "btnSelect" deselect <- xmlGetWidget xml castToButton "btnDeselect" invert <- xmlGetWidget xml castToButton "btnInvert" deselectEdgeTypes <- readIORef ioRefDeselect mapM_ (\ name -> do cb <- xmlGetWidget xml castToCheckButton name toggleButtonSetActive cb False ) deselectEdgeTypes let edgeMap = mapEdgeTypesToNames keys = Map.keys edgeMap setAllTo to = mapM_ (\ name -> do cb <- xmlGetWidget xml castToCheckButton name to' <- to cb toggleButtonSetActive cb to' ) keys onClicked select $ setAllTo (\ _ -> return True) onClicked deselect $ setAllTo (\ _ -> return False) onClicked invert $ setAllTo (\ cb -> do selected <- toggleButtonGetActive cb return $ not selected ) onClicked cancel $ widgetDestroy window onClicked ok $ do edgeTypeNames <- filterM (\ name -> do cb <- xmlGetWidget xml castToCheckButton name selected <- toggleButtonGetActive cb return $ not selected ) keys writeIORef ioRefDeselect edgeTypeNames let edgeTypes = foldl (\ eList (e, eI) -> e : eI : eList) [] $ map (flip (Map.findWithDefault (error "GtkLinkTypeChoice: lookup error!")) edgeMap ) edgeTypeNames forkIO_ $ updateFunction edgeTypes widgetDestroy window widgetShow window
2,023
true
true
0
21
790
538
243
295
null
null
ekmett/hashable
tests/Properties.hs
bsd-3-clause
-- | Content equality implies hash equality. pBSLazy :: BL.ByteString -> BL.ByteString -> Bool pBSLazy a b = if (a == b) then (hash a == hash b) else True
154
pBSLazy :: BL.ByteString -> BL.ByteString -> Bool pBSLazy a b = if (a == b) then (hash a == hash b) else True
109
pBSLazy a b = if (a == b) then (hash a == hash b) else True
59
true
true
0
8
29
62
31
31
null
null
ocramz/petsc-hs
src/Numerical/PETSc/Internal/InlineC.hs
gpl-3.0
vecCopy1 :: Vec -> Vec -> IO CInt vecCopy1 vorig vcopy = [C.exp|int{VecCopy($(Vec vorig), $(Vec vcopy))}|]
106
vecCopy1 :: Vec -> Vec -> IO CInt vecCopy1 vorig vcopy = [C.exp|int{VecCopy($(Vec vorig), $(Vec vcopy))}|]
106
vecCopy1 vorig vcopy = [C.exp|int{VecCopy($(Vec vorig), $(Vec vcopy))}|]
72
false
true
0
7
15
38
19
19
null
null
rzeigler/advent-of-code-2016
Lib/AoC/Day7.hs
mit
containsAddrABBA :: IPAddr -> Bool containsAddrABBA = foldl' (||) False . fmap predicate where predicate (AddrSeg str) = containsABBA str predicate (HyperSeg _) = False
179
containsAddrABBA :: IPAddr -> Bool containsAddrABBA = foldl' (||) False . fmap predicate where predicate (AddrSeg str) = containsABBA str predicate (HyperSeg _) = False
179
containsAddrABBA = foldl' (||) False . fmap predicate where predicate (AddrSeg str) = containsABBA str predicate (HyperSeg _) = False
144
false
true
0
7
35
73
32
41
null
null
jwiegley/svndump
test/doctests.hs
bsd-3-clause
getSources :: IO [FilePath] getSources = filter (isSuffixOf ".hs") <$> go "src" where go dir = do (dirs, files) <- getFilesAndDirectories dir (files ++) . concat <$> mapM go dirs
196
getSources :: IO [FilePath] getSources = filter (isSuffixOf ".hs") <$> go "src" where go dir = do (dirs, files) <- getFilesAndDirectories dir (files ++) . concat <$> mapM go dirs
196
getSources = filter (isSuffixOf ".hs") <$> go "src" where go dir = do (dirs, files) <- getFilesAndDirectories dir (files ++) . concat <$> mapM go dirs
168
false
true
0
9
47
79
39
40
null
null
neale/CS-program
581-FunctionalProgramming/week5/HW4.sol.hs
unlicense
prettyTest Empty = "empty?"
32
prettyTest Empty = "empty?"
32
prettyTest Empty = "empty?"
32
false
false
1
5
8
13
4
9
null
null
ashnikel/haskellbook
ch10/ch10.10_ex.hs
mit
-- 3 myElem :: Eq a => a -> [a] -> Bool myElem x = foldr (\a b -> if a == x then True else b) False
99
myElem :: Eq a => a -> [a] -> Bool myElem x = foldr (\a b -> if a == x then True else b) False
94
myElem x = foldr (\a b -> if a == x then True else b) False
59
true
true
0
9
27
66
33
33
null
null
tangboyun/miranda
src/writeSheet.hs
gpl-3.0
aOrignFile = "/home/tangboyun/miRNADB/microarray_033010_human_lncRNA_V2_annotation_20120105.txt"
96
aOrignFile = "/home/tangboyun/miRNADB/microarray_033010_human_lncRNA_V2_annotation_20120105.txt"
96
aOrignFile = "/home/tangboyun/miRNADB/microarray_033010_human_lncRNA_V2_annotation_20120105.txt"
96
false
false
1
5
2
10
3
7
null
null