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
alvare/hs-nombre-generator
Web/NombreGenerator/Scrapper/BsAs.hs
mit
takeTwo :: [a] -> (a, a) takeTwo (x:y:_) = (x, y)
49
takeTwo :: [a] -> (a, a) takeTwo (x:y:_) = (x, y)
49
takeTwo (x:y:_) = (x, y)
24
false
true
0
10
10
50
26
24
null
null
comraq/scheme-interpreter
src/Variable.hs
bsd-3-clause
------- Utility Functions to work with Map with LispErrors ------- fromMap :: Ord k => LispError -> k -> M.Map k v -> IOEvaled v fromMap err key mmap = maybe (throwError err) return $ M.lookup key mmap
202
fromMap :: Ord k => LispError -> k -> M.Map k v -> IOEvaled v fromMap err key mmap = maybe (throwError err) return $ M.lookup key mmap
134
fromMap err key mmap = maybe (throwError err) return $ M.lookup key mmap
72
true
true
0
11
38
74
34
40
null
null
jberryman/shapely-data
src/Data/Shapely/TH.hs
bsd-3-clause
varName (KindedTV n _) = n
26
varName (KindedTV n _) = n
26
varName (KindedTV n _) = n
26
false
false
0
6
5
18
8
10
null
null
geraldus/transient-universe
src/Transient/MapReduce.hs
mit
distribute _ = undefined
24
distribute _ = undefined
24
distribute _ = undefined
24
false
false
0
5
3
9
4
5
null
null
frantisekfarka/ghc-dsi
compiler/main/GhcMake.hs
bsd-3-clause
home_imps :: [Located (ImportDecl RdrName)] -> [Located ModuleName] home_imps imps = [ ideclName i | L _ i <- imps, isLocal (ideclPkgQual i) ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False
277
home_imps :: [Located (ImportDecl RdrName)] -> [Located ModuleName] home_imps imps = [ ideclName i | L _ i <- imps, isLocal (ideclPkgQual i) ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False
277
home_imps imps = [ ideclName i | L _ i <- imps, isLocal (ideclPkgQual i) ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False
209
false
true
3
9
65
113
55
58
null
null
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
bsd-3-clause
-- * V1beta1APIServiceSpec -- | 'v1beta1APIServiceSpecCaBundle' Lens v1beta1APIServiceSpecCaBundleL :: Lens_' V1beta1APIServiceSpec (ByteArray) v1beta1APIServiceSpecCaBundleL f V1beta1APIServiceSpec{..} = (\v1beta1APIServiceSpecCaBundle -> V1beta1APIServiceSpec { v1beta1APIServiceSpecCaBundle, ..} ) <$> f v1beta1APIServiceSpecCaBundle
337
v1beta1APIServiceSpecCaBundleL :: Lens_' V1beta1APIServiceSpec (ByteArray) v1beta1APIServiceSpecCaBundleL f V1beta1APIServiceSpec{..} = (\v1beta1APIServiceSpecCaBundle -> V1beta1APIServiceSpec { v1beta1APIServiceSpecCaBundle, ..} ) <$> f v1beta1APIServiceSpecCaBundle
267
v1beta1APIServiceSpecCaBundleL f V1beta1APIServiceSpec{..} = (\v1beta1APIServiceSpecCaBundle -> V1beta1APIServiceSpec { v1beta1APIServiceSpecCaBundle, ..} ) <$> f v1beta1APIServiceSpecCaBundle
192
true
true
0
8
26
55
30
25
null
null
nevrenato/HetsAlloy
SoftFOL/ProveMetis.hs
gpl-2.0
-- | The Prover implementation. metisProver :: Prover Sign Sentence SoftFOLMorphism () ProofTree metisProver = mkAutomaticProver "metis" () metisGUI metisProveCMDLautomaticBatch
179
metisProver :: Prover Sign Sentence SoftFOLMorphism () ProofTree metisProver = mkAutomaticProver "metis" () metisGUI metisProveCMDLautomaticBatch
147
metisProver = mkAutomaticProver "metis" () metisGUI metisProveCMDLautomaticBatch
82
true
true
0
6
21
37
18
19
null
null
snape/LooplessFunctionalAlgorithms
LooplessJohnson.hs
apache-2.0
prolog sp lg pg = wrapQueue . fst . foldr (tmix sp) (empty,empty) . list lg pg
80
prolog sp lg pg = wrapQueue . fst . foldr (tmix sp) (empty,empty) . list lg pg
80
prolog sp lg pg = wrapQueue . fst . foldr (tmix sp) (empty,empty) . list lg pg
80
false
false
1
9
18
52
23
29
null
null
ArturB/Multilinear
test/all/Test/QuickCheck/Multilinear/Generic/Sequential.hs
gpl-3.0
{-| More complex (up to 3D) tensors, built as sums and differences of tensor products of all pairs from tensors list above List contains 18^3 = 5832 tensors in total -} tensors3D :: [Tensor Double] tensors3D = pure (*) <*> ts <*> tensors1D where ts = pure (*) <*> tensors1D <*> tensors1D -- | Arbitrary random generating instance of Tensor Double -- | Simply choose a tensor from tensors list above
406
tensors3D :: [Tensor Double] tensors3D = pure (*) <*> ts <*> tensors1D where ts = pure (*) <*> tensors1D <*> tensors1D -- | Arbitrary random generating instance of Tensor Double -- | Simply choose a tensor from tensors list above
232
tensors3D = pure (*) <*> ts <*> tensors1D where ts = pure (*) <*> tensors1D <*> tensors1D -- | Arbitrary random generating instance of Tensor Double -- | Simply choose a tensor from tensors list above
203
true
true
0
7
78
54
30
24
null
null
quchen/stg
test/Testsuite/Test/Machine/Evaluate/TestTemplates/MachineState.hs
bsd-3-clause
fail_failPredicateTrue :: MachineStateTestSpec -> StgState -> Assertion fail_failPredicateTrue testSpec badState = (assertFailure . T.unpack . renderStrict . layoutPretty defaultLayoutOptions . vsep) [ "Failure predicate held for an intemediate state" , if failWithInfo testSpec then vsep [ hang 4 (vsep ["Program:", prettyStgi (source testSpec)]) , hang 4 (vsep ["Bad state:", prettyStgi badState]) ] else failWithInfoInfoText ]
523
fail_failPredicateTrue :: MachineStateTestSpec -> StgState -> Assertion fail_failPredicateTrue testSpec badState = (assertFailure . T.unpack . renderStrict . layoutPretty defaultLayoutOptions . vsep) [ "Failure predicate held for an intemediate state" , if failWithInfo testSpec then vsep [ hang 4 (vsep ["Program:", prettyStgi (source testSpec)]) , hang 4 (vsep ["Bad state:", prettyStgi badState]) ] else failWithInfoInfoText ]
523
fail_failPredicateTrue testSpec badState = (assertFailure . T.unpack . renderStrict . layoutPretty defaultLayoutOptions . vsep) [ "Failure predicate held for an intemediate state" , if failWithInfo testSpec then vsep [ hang 4 (vsep ["Program:", prettyStgi (source testSpec)]) , hang 4 (vsep ["Bad state:", prettyStgi badState]) ] else failWithInfoInfoText ]
439
false
true
0
16
148
128
64
64
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
action_195 (50#) = happyGoto action_193
39
action_195 (50#) = happyGoto action_193
39
action_195 (50#) = happyGoto action_193
39
false
false
0
6
4
15
7
8
null
null
thalerjonathan/phd
thesis/code/concurrent/sugarscape/SugarScapeSTMTArray/src/Discrete.hs
gpl-3.0
neighbourhoodScale :: Discrete2dNeighbourhood -> Int -> Discrete2dNeighbourhood neighbourhoodScale ns s = map (\(x,y) -> (x * s, y * s)) ns
139
neighbourhoodScale :: Discrete2dNeighbourhood -> Int -> Discrete2dNeighbourhood neighbourhoodScale ns s = map (\(x,y) -> (x * s, y * s)) ns
139
neighbourhoodScale ns s = map (\(x,y) -> (x * s, y * s)) ns
59
false
true
0
9
20
57
31
26
null
null
sdiehl/ghc
compiler/utils/Dominators.hs
bsd-3-clause
reachable :: (Node -> NodeSet) -> (Node -> NodeSet) reachable f a = go (IS.singleton a) a where go seen a = let s = f a as = IS.toList (s `IS.difference` seen) in foldl' go (s `IS.union` seen) as
245
reachable :: (Node -> NodeSet) -> (Node -> NodeSet) reachable f a = go (IS.singleton a) a where go seen a = let s = f a as = IS.toList (s `IS.difference` seen) in foldl' go (s `IS.union` seen) as
244
reachable f a = go (IS.singleton a) a where go seen a = let s = f a as = IS.toList (s `IS.difference` seen) in foldl' go (s `IS.union` seen) as
192
false
true
1
11
89
123
59
64
null
null
timtylin/scholdoc-citeproc
src/Text/CSL/Util.hs
bsd-3-clause
toRead :: String -> String toRead [] = []
45
toRead :: String -> String toRead [] = []
45
toRead [] = []
18
false
true
0
6
12
26
12
14
null
null
TOSPIO/yi
src/library/Yi/Keymap/Vim/Operator.hs
gpl-2.0
opFormat :: VimOperator opFormat = VimOperator { operatorName = "gq" , operatorApplyToRegionE = \_count (StyledRegion style reg) -> do withCurrentBuffer $ formatRegionB style reg switchModeE Normal return Finish }
237
opFormat :: VimOperator opFormat = VimOperator { operatorName = "gq" , operatorApplyToRegionE = \_count (StyledRegion style reg) -> do withCurrentBuffer $ formatRegionB style reg switchModeE Normal return Finish }
237
opFormat = VimOperator { operatorName = "gq" , operatorApplyToRegionE = \_count (StyledRegion style reg) -> do withCurrentBuffer $ formatRegionB style reg switchModeE Normal return Finish }
213
false
true
0
11
52
64
32
32
null
null
guillep19/uulib
src/UU/PPrint.hs
bsd-3-clause
fillCat = fold (<//>)
29
fillCat = fold (<//>)
29
fillCat = fold (<//>)
29
false
false
1
5
11
14
6
8
null
null
jhegedus42/svg-tree
src/Graphics/Svg.hs
bsd-3-clause
{-import Graphics.Svg.CssParser-} -- | Try to load an svg file on disc and parse it as -- a SVG Document. loadSvgFile :: FilePath -> IO (Maybe Document) loadSvgFile filename = parseSvgFile filename <$> B.readFile filename
224
loadSvgFile :: FilePath -> IO (Maybe Document) loadSvgFile filename = parseSvgFile filename <$> B.readFile filename
117
loadSvgFile filename = parseSvgFile filename <$> B.readFile filename
70
true
true
0
8
37
42
21
21
null
null
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/GamePhysics/IMods.hs
bsd-2-clause
{-- Rotational Motion --} rotMot :: InstanceModel rotMot = imNoDerivNoRefs rotMotRC [qw angularVelocity, qw time, qw torqueI, qw momentOfInertia] [sy angularVelocity $> 0, sy time $> 0, sy torqueI $> 0, sy momentOfInertia $> 0] (qw angularAccel) [sy angularAccel $> 0] "rotMot" [rotMotDesc, rigidTwoDAssump, rightHandAssump]
334
rotMot :: InstanceModel rotMot = imNoDerivNoRefs rotMotRC [qw angularVelocity, qw time, qw torqueI, qw momentOfInertia] [sy angularVelocity $> 0, sy time $> 0, sy torqueI $> 0, sy momentOfInertia $> 0] (qw angularAccel) [sy angularAccel $> 0] "rotMot" [rotMotDesc, rigidTwoDAssump, rightHandAssump]
307
rotMot = imNoDerivNoRefs rotMotRC [qw angularVelocity, qw time, qw torqueI, qw momentOfInertia] [sy angularVelocity $> 0, sy time $> 0, sy torqueI $> 0, sy momentOfInertia $> 0] (qw angularAccel) [sy angularAccel $> 0] "rotMot" [rotMotDesc, rigidTwoDAssump, rightHandAssump]
283
true
true
0
8
54
128
61
67
null
null
JohnLato/iteratee
bench/BenchBase.hs
bsd-3-clause
takeUpToBenches = [takeUpTo1, takeUpTo2, takeUpTo3, takeUpTo4, takeUpTo5, takeUpTo6]
84
takeUpToBenches = [takeUpTo1, takeUpTo2, takeUpTo3, takeUpTo4, takeUpTo5, takeUpTo6]
84
takeUpToBenches = [takeUpTo1, takeUpTo2, takeUpTo3, takeUpTo4, takeUpTo5, takeUpTo6]
84
false
false
1
5
7
27
15
12
null
null
fpinsight/hadron
examples/WordCountAuto.hs
bsd-3-clause
mr1 :: MapReduce B.ByteString (Row B.ByteString) mr1 = MapReduce def pSerialize mapper' Nothing (Left reducer')
111
mr1 :: MapReduce B.ByteString (Row B.ByteString) mr1 = MapReduce def pSerialize mapper' Nothing (Left reducer')
111
mr1 = MapReduce def pSerialize mapper' Nothing (Left reducer')
62
false
true
1
8
14
46
21
25
null
null
vikraman/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprExp :: Precedence -> Exp -> Doc pprExp _ (VarE v) = pprName' Applied v
77
pprExp :: Precedence -> Exp -> Doc pprExp _ (VarE v) = pprName' Applied v
77
pprExp _ (VarE v) = pprName' Applied v
42
false
true
0
7
18
35
17
18
null
null
tjakway/ghcjvm
compiler/prelude/PrelNames.hs
bsd-3-clause
d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
58
d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
58
d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey
58
false
false
0
7
7
19
9
10
null
null
solidsnack/shell-escape
test/Echo.hs
bsd-3-clause
displayLength = Char8.pack . (\w -> Text.Printf.printf "%4d\n" w) . Data.ByteString.length
167
displayLength = Char8.pack . (\w -> Text.Printf.printf "%4d\n" w) . Data.ByteString.length
167
displayLength = Char8.pack . (\w -> Text.Printf.printf "%4d\n" w) . Data.ByteString.length
167
false
false
0
10
87
35
19
16
null
null
kylcarte/wangtiles
src/Tile/Legend.hs
bsd-3-clause
parseRoom :: (CoordType c) => [Text] -> RoomBuilder c parseRoom = second mkParseTileSet . foldr fn empties . zip [0..] where empties = (emptyTileMap,emptyRBuilder) fn (r,l) rp = parseRoomLine r rp l
204
parseRoom :: (CoordType c) => [Text] -> RoomBuilder c parseRoom = second mkParseTileSet . foldr fn empties . zip [0..] where empties = (emptyTileMap,emptyRBuilder) fn (r,l) rp = parseRoomLine r rp l
204
parseRoom = second mkParseTileSet . foldr fn empties . zip [0..] where empties = (emptyTileMap,emptyRBuilder) fn (r,l) rp = parseRoomLine r rp l
150
false
true
0
7
37
89
46
43
null
null
olsner/ghc
compiler/coreSyn/CoreUnfold.hs
bsd-3-clause
sizeN n = SizeIs n emptyBag 0
30
sizeN n = SizeIs n emptyBag 0
30
sizeN n = SizeIs n emptyBag 0
30
false
false
0
5
7
16
7
9
null
null
ezyang/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
mkCCSLabel :: CostCentreStack -> CLabel mkCCLabel cc = CC_Label cc
85
mkCCSLabel :: CostCentreStack -> CLabel mkCCLabel cc = CC_Label cc
85
mkCCLabel cc = CC_Label cc
45
false
true
0
7
28
26
11
15
null
null
athanclark/bnfm
bnfc-constructions/BNF/PrintBNF.hs
mit
prPrec :: Int -> Int -> Doc -> Doc prPrec i j = if j<i then parenth else id
75
prPrec :: Int -> Int -> Doc -> Doc prPrec i j = if j<i then parenth else id
75
prPrec i j = if j<i then parenth else id
40
false
true
0
9
18
46
22
24
null
null
MerelyAPseudonym/cmdtheline
src/System/Console/CmdTheLine/Help.hs
mit
print :: HelpFormat -> Handle -> EvalInfo -> IO () print fmt h ei = Man.print (eiSubst ei) fmt h (page ei)
106
print :: HelpFormat -> Handle -> EvalInfo -> IO () print fmt h ei = Man.print (eiSubst ei) fmt h (page ei)
106
print fmt h ei = Man.print (eiSubst ei) fmt h (page ei)
55
false
true
0
9
21
62
29
33
null
null
tjakway/ghcjvm
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_expr (ExprWithTySigOut expr sig) = hang (nest 2 (ppr_lexpr expr) <+> dcolon) 4 (ppr sig)
103
ppr_expr (ExprWithTySigOut expr sig) = hang (nest 2 (ppr_lexpr expr) <+> dcolon) 4 (ppr sig)
103
ppr_expr (ExprWithTySigOut expr sig) = hang (nest 2 (ppr_lexpr expr) <+> dcolon) 4 (ppr sig)
103
false
false
0
9
25
51
23
28
null
null
narrative/stack
src/Stack/SDist.hs
bsd-3-clause
getCabalLbs :: M env m => PvpBounds -> FilePath -> m L.ByteString getCabalLbs pvpBounds fp = do bs <- liftIO $ S.readFile fp (_warnings, gpd) <- readPackageUnresolvedBS Nothing bs (_, _, _, _, sourceMap) <- loadSourceMap AllowNoTargets defaultBuildOptsCLI menv <- getMinimalEnvOverride (installedMap, _, _, _) <- getInstalled menv GetInstalledOpts { getInstalledProfiling = False , getInstalledHaddock = False } sourceMap let gpd' = gtraverseT (addBounds sourceMap installedMap) gpd return $ TLE.encodeUtf8 $ TL.pack $ showGenericPackageDescription gpd' where addBounds :: SourceMap -> InstalledMap -> Dependency -> Dependency addBounds sourceMap installedMap dep@(Dependency cname range) = case lookupVersion (fromCabalPackageName cname) of Nothing -> dep Just version -> Dependency cname $ simplifyVersionRange $ (if toAddUpper && not (hasUpper range) then addUpper version else id) $ (if toAddLower && not (hasLower range) then addLower version else id) range where lookupVersion name = case Map.lookup name sourceMap of Just (PSLocal lp) -> Just $ packageVersion $ lpPackage lp Just (PSUpstream version _ _) -> Just version Nothing -> case Map.lookup name installedMap of Just (_, installed) -> Just (installedVersion installed) Nothing -> Nothing addUpper version = intersectVersionRanges (earlierVersion $ toCabalVersion $ nextMajorVersion version) addLower version = intersectVersionRanges (orLaterVersion (toCabalVersion version)) (toAddLower, toAddUpper) = case pvpBounds of PvpBoundsNone -> (False, False) PvpBoundsUpper -> (False, True) PvpBoundsLower -> (True, False) PvpBoundsBoth -> (True, True) -- | Traverse a data type.
2,057
getCabalLbs :: M env m => PvpBounds -> FilePath -> m L.ByteString getCabalLbs pvpBounds fp = do bs <- liftIO $ S.readFile fp (_warnings, gpd) <- readPackageUnresolvedBS Nothing bs (_, _, _, _, sourceMap) <- loadSourceMap AllowNoTargets defaultBuildOptsCLI menv <- getMinimalEnvOverride (installedMap, _, _, _) <- getInstalled menv GetInstalledOpts { getInstalledProfiling = False , getInstalledHaddock = False } sourceMap let gpd' = gtraverseT (addBounds sourceMap installedMap) gpd return $ TLE.encodeUtf8 $ TL.pack $ showGenericPackageDescription gpd' where addBounds :: SourceMap -> InstalledMap -> Dependency -> Dependency addBounds sourceMap installedMap dep@(Dependency cname range) = case lookupVersion (fromCabalPackageName cname) of Nothing -> dep Just version -> Dependency cname $ simplifyVersionRange $ (if toAddUpper && not (hasUpper range) then addUpper version else id) $ (if toAddLower && not (hasLower range) then addLower version else id) range where lookupVersion name = case Map.lookup name sourceMap of Just (PSLocal lp) -> Just $ packageVersion $ lpPackage lp Just (PSUpstream version _ _) -> Just version Nothing -> case Map.lookup name installedMap of Just (_, installed) -> Just (installedVersion installed) Nothing -> Nothing addUpper version = intersectVersionRanges (earlierVersion $ toCabalVersion $ nextMajorVersion version) addLower version = intersectVersionRanges (orLaterVersion (toCabalVersion version)) (toAddLower, toAddUpper) = case pvpBounds of PvpBoundsNone -> (False, False) PvpBoundsUpper -> (False, True) PvpBoundsLower -> (True, False) PvpBoundsBoth -> (True, True) -- | Traverse a data type.
2,057
getCabalLbs pvpBounds fp = do bs <- liftIO $ S.readFile fp (_warnings, gpd) <- readPackageUnresolvedBS Nothing bs (_, _, _, _, sourceMap) <- loadSourceMap AllowNoTargets defaultBuildOptsCLI menv <- getMinimalEnvOverride (installedMap, _, _, _) <- getInstalled menv GetInstalledOpts { getInstalledProfiling = False , getInstalledHaddock = False } sourceMap let gpd' = gtraverseT (addBounds sourceMap installedMap) gpd return $ TLE.encodeUtf8 $ TL.pack $ showGenericPackageDescription gpd' where addBounds :: SourceMap -> InstalledMap -> Dependency -> Dependency addBounds sourceMap installedMap dep@(Dependency cname range) = case lookupVersion (fromCabalPackageName cname) of Nothing -> dep Just version -> Dependency cname $ simplifyVersionRange $ (if toAddUpper && not (hasUpper range) then addUpper version else id) $ (if toAddLower && not (hasLower range) then addLower version else id) range where lookupVersion name = case Map.lookup name sourceMap of Just (PSLocal lp) -> Just $ packageVersion $ lpPackage lp Just (PSUpstream version _ _) -> Just version Nothing -> case Map.lookup name installedMap of Just (_, installed) -> Just (installedVersion installed) Nothing -> Nothing addUpper version = intersectVersionRanges (earlierVersion $ toCabalVersion $ nextMajorVersion version) addLower version = intersectVersionRanges (orLaterVersion (toCabalVersion version)) (toAddLower, toAddUpper) = case pvpBounds of PvpBoundsNone -> (False, False) PvpBoundsUpper -> (False, True) PvpBoundsLower -> (True, False) PvpBoundsBoth -> (True, True) -- | Traverse a data type.
1,991
false
true
0
15
641
562
282
280
null
null
peterthiemann/cftools
src/GRegexp.hs
bsd-3-clause
intersect xss@(xs:xss') yss@(ys:yss') | xs == ys = xs : intersect xss' yss' | lleq xs ys = intersect xss' yss | otherwise = intersect xss yss'
151
intersect xss@(xs:xss') yss@(ys:yss') | xs == ys = xs : intersect xss' yss' | lleq xs ys = intersect xss' yss | otherwise = intersect xss yss'
151
intersect xss@(xs:xss') yss@(ys:yss') | xs == ys = xs : intersect xss' yss' | lleq xs ys = intersect xss' yss | otherwise = intersect xss yss'
151
false
false
2
8
35
79
39
40
null
null
isomorphism/labelled-hexdump-parser
Parser.hs
bsd-3-clause
atOffset :: (Monad m) => Offset -> StructParser m a -> StructParser m a atOffset o p = local (parserInData .~ o) p
114
atOffset :: (Monad m) => Offset -> StructParser m a -> StructParser m a atOffset o p = local (parserInData .~ o) p
114
atOffset o p = local (parserInData .~ o) p
42
false
true
0
9
22
59
28
31
null
null
j-rock/rayt
src/Ray/Affine.hs
mit
transposeTrans (TranslateTranspose v) = Translate v
51
transposeTrans (TranslateTranspose v) = Translate v
51
transposeTrans (TranslateTranspose v) = Translate v
51
false
false
0
7
5
18
8
10
null
null
nominolo/scion
src/Scion/Worker/Main.hs
bsd-3-clause
getModificationTime :: FilePath -> IO TimeStamp getModificationTime file = convert . modificationTime <$> getFileStatus file
126
getModificationTime :: FilePath -> IO TimeStamp getModificationTime file = convert . modificationTime <$> getFileStatus file
126
getModificationTime file = convert . modificationTime <$> getFileStatus file
78
false
true
3
7
16
38
16
22
null
null
brownsys/nettle-openflow
src/Nettle/OpenFlow/MessagesBinary.hs
bsd-3-clause
queryToPortNumber :: PortQuery -> Word16 queryToPortNumber AllPorts = ofppNone
84
queryToPortNumber :: PortQuery -> Word16 queryToPortNumber AllPorts = ofppNone
84
queryToPortNumber AllPorts = ofppNone
43
false
true
0
5
14
18
9
9
null
null
tjakway/ghcjvm
compiler/nativeGen/RegAlloc/Liveness.hs
bsd-3-clause
eraseDeltasLive :: Instruction instr => LiveCmmDecl statics instr -> LiveCmmDecl statics instr eraseDeltasLive cmm = mapBlockTop eraseBlock cmm where eraseBlock (BasicBlock id lis) = BasicBlock id $ filter (\(LiveInstr i _) -> not $ isJust $ takeDeltaInstr i) $ lis -- | Patch the registers in this code according to this register mapping. -- also erase reg -> reg moves when the reg is the same. -- also erase reg -> reg moves when the destination dies in this instr.
564
eraseDeltasLive :: Instruction instr => LiveCmmDecl statics instr -> LiveCmmDecl statics instr eraseDeltasLive cmm = mapBlockTop eraseBlock cmm where eraseBlock (BasicBlock id lis) = BasicBlock id $ filter (\(LiveInstr i _) -> not $ isJust $ takeDeltaInstr i) $ lis -- | Patch the registers in this code according to this register mapping. -- also erase reg -> reg moves when the reg is the same. -- also erase reg -> reg moves when the destination dies in this instr.
563
eraseDeltasLive cmm = mapBlockTop eraseBlock cmm where eraseBlock (BasicBlock id lis) = BasicBlock id $ filter (\(LiveInstr i _) -> not $ isJust $ takeDeltaInstr i) $ lis -- | Patch the registers in this code according to this register mapping. -- also erase reg -> reg moves when the reg is the same. -- also erase reg -> reg moves when the destination dies in this instr.
444
false
true
4
8
175
112
51
61
null
null
bhamrick/hsmath
Math/Polynomial/Types.hs
bsd-3-clause
derivative (P (_:as)) = P (zipWith (*) (iterate (+1) 1) as)
59
derivative (P (_:as)) = P (zipWith (*) (iterate (+1) 1) as)
59
derivative (P (_:as)) = P (zipWith (*) (iterate (+1) 1) as)
59
false
false
0
10
10
49
26
23
null
null
mikehat/blaze-css
src/Text/Blaze/Css21/Value.hs
bsd-3-clause
to_string TableFooterGroup = "table-footer-group"
55
to_string TableFooterGroup = "table-footer-group"
55
to_string TableFooterGroup = "table-footer-group"
55
false
false
0
5
9
9
4
5
null
null
ejlilley/AbstractMusic
Music.hs
gpl-3.0
intervalPowerPositive 0 i = zeroV
33
intervalPowerPositive 0 i = zeroV
33
intervalPowerPositive 0 i = zeroV
33
false
false
1
5
4
16
5
11
null
null
copumpkin/charm
src/Architecture/ARM/Decoder/Common.hs
bsd-3-clause
nybble :: Bits a => Int -> a -> Nybble nybble n = choose n High Low
67
nybble :: Bits a => Int -> a -> Nybble nybble n = choose n High Low
67
nybble n = choose n High Low
28
false
true
0
9
16
43
18
25
null
null
RyanGlScott/hermit-bluetooth
Setup.hs
bsd-3-clause
dllSourcePath :: IO FilePath dllSourcePath = do sourceDir <- dllSourceDir return $ sourceDir </> dllFileName
116
dllSourcePath :: IO FilePath dllSourcePath = do sourceDir <- dllSourceDir return $ sourceDir </> dllFileName
116
dllSourcePath = do sourceDir <- dllSourceDir return $ sourceDir </> dllFileName
87
false
true
0
8
22
32
15
17
null
null
sopvop/snap-server
test/Snap/Internal/Http/Server/Session/Tests.hs
bsd-3-clause
------------------------------------------------------------------------------ testNoHost1_0 :: Test testNoHost1_0 = testCase "session/noHost1_0" $ do out <- getSessionOutput ["GET / HTTP/1.0\r\n\r\n"] snap1 assertBool "no host 1.0" $ S.isSuffixOf "\r\nbackup-localhost" out out2 <- getSessionOutput ["GET / HTTP/1.0\r\n\r\n"] snap2 assertBool "no host 1.0-2" $ S.isSuffixOf "\r\nbackup-localhost" out2 where snap1 = getRequest >>= writeBS . rqHostName snap2 = getRequest >>= writeBS . rqLocalHostname ------------------------------------------------------------------------------
608
testNoHost1_0 :: Test testNoHost1_0 = testCase "session/noHost1_0" $ do out <- getSessionOutput ["GET / HTTP/1.0\r\n\r\n"] snap1 assertBool "no host 1.0" $ S.isSuffixOf "\r\nbackup-localhost" out out2 <- getSessionOutput ["GET / HTTP/1.0\r\n\r\n"] snap2 assertBool "no host 1.0-2" $ S.isSuffixOf "\r\nbackup-localhost" out2 where snap1 = getRequest >>= writeBS . rqHostName snap2 = getRequest >>= writeBS . rqLocalHostname ------------------------------------------------------------------------------
529
testNoHost1_0 = testCase "session/noHost1_0" $ do out <- getSessionOutput ["GET / HTTP/1.0\r\n\r\n"] snap1 assertBool "no host 1.0" $ S.isSuffixOf "\r\nbackup-localhost" out out2 <- getSessionOutput ["GET / HTTP/1.0\r\n\r\n"] snap2 assertBool "no host 1.0-2" $ S.isSuffixOf "\r\nbackup-localhost" out2 where snap1 = getRequest >>= writeBS . rqHostName snap2 = getRequest >>= writeBS . rqLocalHostname ------------------------------------------------------------------------------
507
true
true
0
10
83
113
54
59
null
null
sjpet/quark
src/Quark/Layout.hs
mit
primary :: Layout -> Window primary (MinimalLayout _ _ p _) = p
64
primary :: Layout -> Window primary (MinimalLayout _ _ p _) = p
64
primary (MinimalLayout _ _ p _) = p
36
false
true
0
9
13
36
16
20
null
null
phile314/tasty-silver
Test/Tasty/Silver/Interactive.hs
mit
output :: (?colors :: Bool) => ConsoleIntensity -> ColorIntensity -> Color -> String -> IO () output bold intensity color st | ?colors = (do setSGR [ SetColor Foreground intensity color , SetConsoleIntensity bold ] putStr st ) `finally` setSGR [] | otherwise = putStr st
330
output :: (?colors :: Bool) => ConsoleIntensity -> ColorIntensity -> Color -> String -> IO () output bold intensity color st | ?colors = (do setSGR [ SetColor Foreground intensity color , SetConsoleIntensity bold ] putStr st ) `finally` setSGR [] | otherwise = putStr st
330
output bold intensity color st | ?colors = (do setSGR [ SetColor Foreground intensity color , SetConsoleIntensity bold ] putStr st ) `finally` setSGR [] | otherwise = putStr st
224
false
true
0
12
105
120
56
64
null
null
shingoOKAWA/hsarg-haskell
src/DSL/Structured/Core.hs
bsd-3-clause
show' (_ , c) = '-' : c
25
show' (_ , c) = '-' : c
25
show' (_ , c) = '-' : c
25
false
false
0
6
9
19
10
9
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcRnTypes.hs
bsd-3-clause
-- NB: see Note [Template Haskell levels] in TcSplice -- Incremented when going inside a bracket, -- decremented when going inside a splice -- NB: ThLevel is one greater than the 'n' in Fig 2 of the -- original "Template meta-programming for Haskell" paper impLevel, outerLevel :: ThLevel impLevel = 0
322
impLevel, outerLevel :: ThLevel impLevel = 0
44
impLevel = 0
12
true
true
0
4
71
18
13
5
null
null
futtetennista/IntroductionToFunctionalProgramming
itfp/src/Chapter9.hs
mit
strategy :: Strategy strategy pos = newPos where GNode newPos _ = optimal 2 dynamicTTT (gametree pos)
115
strategy :: Strategy strategy pos = newPos where GNode newPos _ = optimal 2 dynamicTTT (gametree pos)
115
strategy pos = newPos where GNode newPos _ = optimal 2 dynamicTTT (gametree pos)
94
false
true
0
7
30
41
19
22
null
null
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/red-black-delete.hs
bsd-3-clause
dbalanceL B (DT R a x (T R b y c)) z d = DT R (T B a x b) y (T B c z d)
71
dbalanceL B (DT R a x (T R b y c)) z d = DT R (T B a x b) y (T B c z d)
71
dbalanceL B (DT R a x (T R b y c)) z d = DT R (T B a x b) y (T B c z d)
71
false
false
1
9
26
75
35
40
null
null
abakst/liquidhaskell
benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy.hs
bsd-3-clause
-- | 'zipWith' generalises 'zip' by zipping with the function given as -- the first argument, instead of a tupling function. For example, -- @'zipWith' (+)@ is applied to two ByteStrings to produce the list of -- corresponding sums. {-@ zipWith :: (Word8 -> Word8 -> a) -> x:ByteString -> y:ByteString -> {v:[a] | (LZipLen v x y)} @-} --LIQUID see LazyZip.hs zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a] zipWith = undefined
447
zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a] zipWith = undefined
87
zipWith = undefined
19
true
true
0
8
78
43
26
17
null
null
tpajenka/shift
src/LensNaming.hs
bsd-3-clause
-- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \_ _ name -> case nameBase name of (n:ns) -> [TopName (mkName $ "lens" ++ toUpper n : ns)] _ -> [] #elif MIN_VERSION_lens(4,4,0) -- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \_ name -> case nameBase name of (n:ns) -> [TopName (mkName $ "lens" ++ toUpper n : ns)] _ -> [] #else -- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \name -> case name of (n:ns) -> Just ("lens" ++ toUpper n : ns)) _ -> Nothing
1,055
makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \_ _ name -> case nameBase name of (n:ns) -> [TopName (mkName $ "lens" ++ toUpper n : ns)] _ -> [] #elif MIN_VERSION_lens(4,4,0) -- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \_ name -> case nameBase name of (n:ns) -> [TopName (mkName $ "lens" ++ toUpper n : ns)] _ -> [] #else -- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \name -> case name of (n:ns) -> Just ("lens" ++ toUpper n : ns)) _ -> Nothing
985
makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \_ _ name -> case nameBase name of (n:ns) -> [TopName (mkName $ "lens" ++ toUpper n : ns)] _ -> [] #elif MIN_VERSION_lens(4,4,0) -- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \_ name -> case nameBase name of (n:ns) -> [TopName (mkName $ "lens" ++ toUpper n : ns)] _ -> [] #else -- | Creates lenses by prepending @"lens"@ to the upper-cased fields. makeLensPrefixLenses :: Name -> DecsQ makeLensPrefixLenses = makeLensesWith $ lensRules & lensField .~ \name -> case name of (n:ns) -> Just ("lens" ++ toUpper n : ns)) _ -> Nothing
947
true
true
2
15
361
90
46
44
null
null
diminishedprime/.org
reading-list/learn_you_a_haskell/syntax_in_functions.hs
mit
length' :: (Num b) => [a] -> b length' [] = 0
45
length' :: (Num b) => [a] -> b length' [] = 0
45
length' [] = 0
14
false
true
0
9
11
38
18
20
null
null
ardumont/haskell-platform
hptool/src/PlatformDB.hs
bsd-3-clause
-- | Modify an include for being part of the platform only on windows -- distributions. onlyWindows :: Include -> Include onlyWindows (it, pkg) = (IncIfWindows it, pkg)
168
onlyWindows :: Include -> Include onlyWindows (it, pkg) = (IncIfWindows it, pkg)
80
onlyWindows (it, pkg) = (IncIfWindows it, pkg)
46
true
true
0
8
27
41
21
20
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Protocol.hs
bsd-3-clause
parseQueryResult (IterateW32UnitE _ _ _) (IterateUnitReply) = Just $ LitUnit
76
parseQueryResult (IterateW32UnitE _ _ _) (IterateUnitReply) = Just $ LitUnit
76
parseQueryResult (IterateW32UnitE _ _ _) (IterateUnitReply) = Just $ LitUnit
76
false
false
0
7
9
28
14
14
null
null
hvr/vector
Data/Vector.hs
bsd-3-clause
null = G.null
13
null = G.null
13
null = G.null
13
false
false
1
6
2
12
4
8
null
null
unisonweb/platform
parser-typechecker/src/Unison/Typechecker/Context.hs
mit
subtype tx ty = scope (InSubtype tx ty) $ do ctx <- getContext go (ctx :: Context v loc) (Type.stripIntroOuters tx) (Type.stripIntroOuters ty) where -- Rules from figure 9 go :: Context v loc -> Type v loc -> Type v loc -> M v loc () go _ (Type.Ref' r) (Type.Ref' r2) | r == r2 = pure () -- `Unit` go ctx t1@(Type.Var' (TypeVar.Universal v1)) t2@(Type.Var' (TypeVar.Universal v2)) -- `Var` | v1 == v2 && wellformedType ctx t1 && wellformedType ctx t2 = pure () go ctx t1@(Type.Var' (TypeVar.Existential _ v1)) t2@(Type.Var' (TypeVar.Existential _ v2)) -- `Exvar` | v1 == v2 && wellformedType ctx t1 && wellformedType ctx t2 = pure () go _ (Type.Arrow' i1 o1) (Type.Arrow' i2 o2) = do -- `-->` subtype i2 i1; ctx' <- getContext subtype (apply ctx' o1) (apply ctx' o2) go _ (Type.App' x1 y1) (Type.App' x2 y2) = do -- analogue of `-->` subtype x1 x2 -- We don't know the variance of the type argument, so we assume -- (conservatively) that it's invariant, see -- discussion https://github.com/unisonweb/unison/issues/512 y1 <- applyM y1; y2 <- applyM y2 equate y1 y2 go _ t (Type.Forall' t2) = do v <- ABT.freshen t2 freshenTypeVar markThenRetract0 v $ do v' <- extendUniversal v t2 <- pure $ ABT.bindInheritAnnotation t2 (universal' () v') subtype t t2 go _ (Type.Forall' t) t2 = do v0 <- ABT.freshen t freshenTypeVar markThenRetract0 v0 $ do v <- extendExistential v0 t <- pure $ ABT.bindInheritAnnotation t (existential' () B.Blank v) t1 <- applyM t subtype t1 t2 go _ (Type.Effect1' e1 a1) (Type.Effect1' e2 a2) = do subtype e1 e2 ctx <- getContext subtype (apply ctx a1) (apply ctx a2) go _ a (Type.Effect1' _e2 a2) = subtype a a2 go _ (Type.Effect1' es a) a2 = do subtype es (Type.effects (loc es) []) subtype a a2 go ctx (Type.Var' (TypeVar.Existential b v)) t -- `InstantiateL` | Set.member v (existentials ctx) && notMember v (Type.freeVars t) = do e <- extendExistential Var.inferAbility instantiateL b v (relax' False e t) go ctx t (Type.Var' (TypeVar.Existential b v)) -- `InstantiateR` | Set.member v (existentials ctx) && notMember v (Type.freeVars t) = do e <- extendExistential Var.inferAbility instantiateR (relax' False e t) b v go _ (Type.Effects' es1) (Type.Effects' es2) = subAbilities ((,) Nothing <$> es1) es2 go _ t t2@(Type.Effects' _) | expand t = subtype (Type.effects (loc t) [t]) t2 go _ t@(Type.Effects' _) t2 | expand t2 = subtype t (Type.effects (loc t2) [t2]) go ctx _ _ = failWith $ TypeMismatch ctx expand :: Type v loc -> Bool expand t = case t of Type.Var' _ -> True Type.App' _ _ -> True Type.Ref' _ -> True _ -> False
2,778
subtype tx ty = scope (InSubtype tx ty) $ do ctx <- getContext go (ctx :: Context v loc) (Type.stripIntroOuters tx) (Type.stripIntroOuters ty) where -- Rules from figure 9 go :: Context v loc -> Type v loc -> Type v loc -> M v loc () go _ (Type.Ref' r) (Type.Ref' r2) | r == r2 = pure () -- `Unit` go ctx t1@(Type.Var' (TypeVar.Universal v1)) t2@(Type.Var' (TypeVar.Universal v2)) -- `Var` | v1 == v2 && wellformedType ctx t1 && wellformedType ctx t2 = pure () go ctx t1@(Type.Var' (TypeVar.Existential _ v1)) t2@(Type.Var' (TypeVar.Existential _ v2)) -- `Exvar` | v1 == v2 && wellformedType ctx t1 && wellformedType ctx t2 = pure () go _ (Type.Arrow' i1 o1) (Type.Arrow' i2 o2) = do -- `-->` subtype i2 i1; ctx' <- getContext subtype (apply ctx' o1) (apply ctx' o2) go _ (Type.App' x1 y1) (Type.App' x2 y2) = do -- analogue of `-->` subtype x1 x2 -- We don't know the variance of the type argument, so we assume -- (conservatively) that it's invariant, see -- discussion https://github.com/unisonweb/unison/issues/512 y1 <- applyM y1; y2 <- applyM y2 equate y1 y2 go _ t (Type.Forall' t2) = do v <- ABT.freshen t2 freshenTypeVar markThenRetract0 v $ do v' <- extendUniversal v t2 <- pure $ ABT.bindInheritAnnotation t2 (universal' () v') subtype t t2 go _ (Type.Forall' t) t2 = do v0 <- ABT.freshen t freshenTypeVar markThenRetract0 v0 $ do v <- extendExistential v0 t <- pure $ ABT.bindInheritAnnotation t (existential' () B.Blank v) t1 <- applyM t subtype t1 t2 go _ (Type.Effect1' e1 a1) (Type.Effect1' e2 a2) = do subtype e1 e2 ctx <- getContext subtype (apply ctx a1) (apply ctx a2) go _ a (Type.Effect1' _e2 a2) = subtype a a2 go _ (Type.Effect1' es a) a2 = do subtype es (Type.effects (loc es) []) subtype a a2 go ctx (Type.Var' (TypeVar.Existential b v)) t -- `InstantiateL` | Set.member v (existentials ctx) && notMember v (Type.freeVars t) = do e <- extendExistential Var.inferAbility instantiateL b v (relax' False e t) go ctx t (Type.Var' (TypeVar.Existential b v)) -- `InstantiateR` | Set.member v (existentials ctx) && notMember v (Type.freeVars t) = do e <- extendExistential Var.inferAbility instantiateR (relax' False e t) b v go _ (Type.Effects' es1) (Type.Effects' es2) = subAbilities ((,) Nothing <$> es1) es2 go _ t t2@(Type.Effects' _) | expand t = subtype (Type.effects (loc t) [t]) t2 go _ t@(Type.Effects' _) t2 | expand t2 = subtype t (Type.effects (loc t2) [t2]) go ctx _ _ = failWith $ TypeMismatch ctx expand :: Type v loc -> Bool expand t = case t of Type.Var' _ -> True Type.App' _ _ -> True Type.Ref' _ -> True _ -> False
2,778
subtype tx ty = scope (InSubtype tx ty) $ do ctx <- getContext go (ctx :: Context v loc) (Type.stripIntroOuters tx) (Type.stripIntroOuters ty) where -- Rules from figure 9 go :: Context v loc -> Type v loc -> Type v loc -> M v loc () go _ (Type.Ref' r) (Type.Ref' r2) | r == r2 = pure () -- `Unit` go ctx t1@(Type.Var' (TypeVar.Universal v1)) t2@(Type.Var' (TypeVar.Universal v2)) -- `Var` | v1 == v2 && wellformedType ctx t1 && wellformedType ctx t2 = pure () go ctx t1@(Type.Var' (TypeVar.Existential _ v1)) t2@(Type.Var' (TypeVar.Existential _ v2)) -- `Exvar` | v1 == v2 && wellformedType ctx t1 && wellformedType ctx t2 = pure () go _ (Type.Arrow' i1 o1) (Type.Arrow' i2 o2) = do -- `-->` subtype i2 i1; ctx' <- getContext subtype (apply ctx' o1) (apply ctx' o2) go _ (Type.App' x1 y1) (Type.App' x2 y2) = do -- analogue of `-->` subtype x1 x2 -- We don't know the variance of the type argument, so we assume -- (conservatively) that it's invariant, see -- discussion https://github.com/unisonweb/unison/issues/512 y1 <- applyM y1; y2 <- applyM y2 equate y1 y2 go _ t (Type.Forall' t2) = do v <- ABT.freshen t2 freshenTypeVar markThenRetract0 v $ do v' <- extendUniversal v t2 <- pure $ ABT.bindInheritAnnotation t2 (universal' () v') subtype t t2 go _ (Type.Forall' t) t2 = do v0 <- ABT.freshen t freshenTypeVar markThenRetract0 v0 $ do v <- extendExistential v0 t <- pure $ ABT.bindInheritAnnotation t (existential' () B.Blank v) t1 <- applyM t subtype t1 t2 go _ (Type.Effect1' e1 a1) (Type.Effect1' e2 a2) = do subtype e1 e2 ctx <- getContext subtype (apply ctx a1) (apply ctx a2) go _ a (Type.Effect1' _e2 a2) = subtype a a2 go _ (Type.Effect1' es a) a2 = do subtype es (Type.effects (loc es) []) subtype a a2 go ctx (Type.Var' (TypeVar.Existential b v)) t -- `InstantiateL` | Set.member v (existentials ctx) && notMember v (Type.freeVars t) = do e <- extendExistential Var.inferAbility instantiateL b v (relax' False e t) go ctx t (Type.Var' (TypeVar.Existential b v)) -- `InstantiateR` | Set.member v (existentials ctx) && notMember v (Type.freeVars t) = do e <- extendExistential Var.inferAbility instantiateR (relax' False e t) b v go _ (Type.Effects' es1) (Type.Effects' es2) = subAbilities ((,) Nothing <$> es1) es2 go _ t t2@(Type.Effects' _) | expand t = subtype (Type.effects (loc t) [t]) t2 go _ t@(Type.Effects' _) t2 | expand t2 = subtype t (Type.effects (loc t2) [t2]) go ctx _ _ = failWith $ TypeMismatch ctx expand :: Type v loc -> Bool expand t = case t of Type.Var' _ -> True Type.App' _ _ -> True Type.Ref' _ -> True _ -> False
2,778
false
false
0
15
676
1,267
597
670
null
null
pgavin/secdh
lib/SECDH/Eval.hs
bsd-3-clause
secdhInit :: Env -> Heap -> Term -> SECDH secdhInit e h t = SECDH { secdhStack = [] , secdhEnv = e , secdhControl = [TermI t] , secdhDump = [] , secdhHeap = h }
186
secdhInit :: Env -> Heap -> Term -> SECDH secdhInit e h t = SECDH { secdhStack = [] , secdhEnv = e , secdhControl = [TermI t] , secdhDump = [] , secdhHeap = h }
186
secdhInit e h t = SECDH { secdhStack = [] , secdhEnv = e , secdhControl = [TermI t] , secdhDump = [] , secdhHeap = h }
144
false
true
0
9
62
81
43
38
null
null
jmgimeno/haskell-playground
src/FourFours/texify.hs
unlicense
main :: IO () main = do args <- getArgs file <- readFile $ head args mapM_ (putStrLn . display) $ map read $ lines file
125
main :: IO () main = do args <- getArgs file <- readFile $ head args mapM_ (putStrLn . display) $ map read $ lines file
125
main = do args <- getArgs file <- readFile $ head args mapM_ (putStrLn . display) $ map read $ lines file
111
false
true
0
12
31
70
30
40
null
null
Melvar/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
showCG (NS n s) = showSep "." (map T.unpack (reverse s)) ++ "." ++ showCG n
75
showCG (NS n s) = showSep "." (map T.unpack (reverse s)) ++ "." ++ showCG n
75
showCG (NS n s) = showSep "." (map T.unpack (reverse s)) ++ "." ++ showCG n
75
false
false
0
10
15
51
23
28
null
null
dsj36/dropray
src/BabyRays/Light.hs
gpl-3.0
localLight :: [Shape] -> Intersection -> Light -> Color localLight _ (normal,_,_,shape,(materialcol,_,kd)) (Directional dir lightcol) = diffuse where mixed_color = combine_col materialcol lightcol diffuse = scale_col mixed_color ((diffuse_coeff dir (vecOfNormal normal)) * kd) -- Spotlight - shadowable
315
localLight :: [Shape] -> Intersection -> Light -> Color localLight _ (normal,_,_,shape,(materialcol,_,kd)) (Directional dir lightcol) = diffuse where mixed_color = combine_col materialcol lightcol diffuse = scale_col mixed_color ((diffuse_coeff dir (vecOfNormal normal)) * kd) -- Spotlight - shadowable
315
localLight _ (normal,_,_,shape,(materialcol,_,kd)) (Directional dir lightcol) = diffuse where mixed_color = combine_col materialcol lightcol diffuse = scale_col mixed_color ((diffuse_coeff dir (vecOfNormal normal)) * kd) -- Spotlight - shadowable
259
false
true
1
11
49
110
60
50
null
null
andyarvanitis/Idris-dev
src/IRTS/Bytecode.hs
bsd-3-clause
bc :: Reg -> SExp -> Bool -> -- returning [BC] bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
104
bc :: Reg -> SExp -> Bool -> -- returning [BC] bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
104
bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
51
false
true
0
9
30
65
33
32
null
null
treeowl/cassava
tests/UnitTests.hs
bsd-3-clause
customOptionsTests :: [TF.Test] customOptionsTests = [ testProperty "customDelim" customDelim ]
103
customOptionsTests :: [TF.Test] customOptionsTests = [ testProperty "customDelim" customDelim ]
103
customOptionsTests = [ testProperty "customDelim" customDelim ]
71
false
true
0
6
17
24
13
11
null
null
chrisdone/ace
src/ACE/Parsers.hs
bsd-3-clause
-- | A phrasal verb particle, e.g. in, up, out (get in, get up, get -- out). This is customized via 'acePhrasalParticle'. phrasalParticle = PhrasalParticle <$> join (fmap acePhrasalParticle getState)
201
phrasalParticle = PhrasalParticle <$> join (fmap acePhrasalParticle getState)
79
phrasalParticle = PhrasalParticle <$> join (fmap acePhrasalParticle getState)
79
true
false
3
7
31
28
12
16
null
null
Nathan-Fenner/Ni
src/Parse.hs
mit
expectOperator :: String -> String -> Parse Token expectOperator name msg = expectToken (\t -> kind t == Operator && token t == name) msg
137
expectOperator :: String -> String -> Parse Token expectOperator name msg = expectToken (\t -> kind t == Operator && token t == name) msg
137
expectOperator name msg = expectToken (\t -> kind t == Operator && token t == name) msg
87
false
true
0
11
24
62
29
33
null
null
laurencer/confluence-sync
vendor/http-streams/lib/Network/Http/Inconvenience.hs
bsd-3-clause
-- -- | Send content to a server via an HTTP POST request. Use this -- function if you have an 'OutputStream' with the body content. -- post :: URL -- ^ Resource to POST to. -> ContentType -- ^ MIME type of the request body being sent. -> (OutputStream Builder -> IO α) -- ^ Handler function to write content to server. -> (Response -> InputStream ByteString -> IO β) -- ^ Handler function to receive the response from the server. -> IO β post r' t body handler = do bracket (establish u) (teardown) (process) where teardown = closeConnection u = parseURL r' q = buildRequest1 $ do http POST (path u) setAccept "*/*" setContentType t process c = do _ <- sendRequest c q body x <- receiveResponse c handler return x -- -- | Send form data to a server via an HTTP POST request. This is the -- usual use case; most services expect the body to be MIME type -- @application/x-www-form-urlencoded@ as this is what conventional -- web browsers send on form submission. If you want to POST to a URL -- with an arbitrary Content-Type, use 'post'. --
1,184
post :: URL -- ^ Resource to POST to. -> ContentType -- ^ MIME type of the request body being sent. -> (OutputStream Builder -> IO α) -- ^ Handler function to write content to server. -> (Response -> InputStream ByteString -> IO β) -- ^ Handler function to receive the response from the server. -> IO β post r' t body handler = do bracket (establish u) (teardown) (process) where teardown = closeConnection u = parseURL r' q = buildRequest1 $ do http POST (path u) setAccept "*/*" setContentType t process c = do _ <- sendRequest c q body x <- receiveResponse c handler return x -- -- | Send form data to a server via an HTTP POST request. This is the -- usual use case; most services expect the body to be MIME type -- @application/x-www-form-urlencoded@ as this is what conventional -- web browsers send on form submission. If you want to POST to a URL -- with an arbitrary Content-Type, use 'post'. --
1,048
post r' t body handler = do bracket (establish u) (teardown) (process) where teardown = closeConnection u = parseURL r' q = buildRequest1 $ do http POST (path u) setAccept "*/*" setContentType t process c = do _ <- sendRequest c q body x <- receiveResponse c handler return x -- -- | Send form data to a server via an HTTP POST request. This is the -- usual use case; most services expect the body to be MIME type -- @application/x-www-form-urlencoded@ as this is what conventional -- web browsers send on form submission. If you want to POST to a URL -- with an arbitrary Content-Type, use 'post'. --
713
true
true
0
13
338
198
99
99
null
null
mgold/Elm
src/Nitpick/PatternMatches.hs
bsd-3-clause
complementData :: TagDict -> Var.Canonical -> [Pattern] -> [Pattern] complementData tagDict tag patterns = let otherTags = lookupOtherTags tag tagDict tagComplements = Maybe.mapMaybe (tagToPattern tag) otherTags arity = length patterns argComplements = concat (zipWith (makeArgComplements tagDict tag arity) [0..] patterns) in tagComplements ++ argComplements
418
complementData :: TagDict -> Var.Canonical -> [Pattern] -> [Pattern] complementData tagDict tag patterns = let otherTags = lookupOtherTags tag tagDict tagComplements = Maybe.mapMaybe (tagToPattern tag) otherTags arity = length patterns argComplements = concat (zipWith (makeArgComplements tagDict tag arity) [0..] patterns) in tagComplements ++ argComplements
418
complementData tagDict tag patterns = let otherTags = lookupOtherTags tag tagDict tagComplements = Maybe.mapMaybe (tagToPattern tag) otherTags arity = length patterns argComplements = concat (zipWith (makeArgComplements tagDict tag arity) [0..] patterns) in tagComplements ++ argComplements
349
false
true
2
13
102
122
59
63
null
null
themattchan/tandoori
library/Tandoori/Typing.hs
bsd-3-clause
-- builtinTyNames = [intTyConName, charTyConName, listTyConName] isTyCon :: GHC.HsType GHC.Name -> Bool isTyCon (GHC.HsTyVar name) = (GHC.isTyConName name) || (elem name builtinTyNames)
186
isTyCon :: GHC.HsType GHC.Name -> Bool isTyCon (GHC.HsTyVar name) = (GHC.isTyConName name) || (elem name builtinTyNames)
120
isTyCon (GHC.HsTyVar name) = (GHC.isTyConName name) || (elem name builtinTyNames)
81
true
true
0
8
22
54
27
27
null
null
hvr/jhc
src/Name/Name.hs
mit
isTypeNamespace _ = False
25
isTypeNamespace _ = False
25
isTypeNamespace _ = False
25
false
false
0
5
3
9
4
5
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 13182 = 2137
32
getValueFromProduct 13182 = 2137
32
getValueFromProduct 13182 = 2137
32
false
false
0
5
3
9
4
5
null
null
dysinger/amazonka
amazonka-emr/gen/Network/AWS/EMR/RemoveTags.hs
mpl-2.0
-- | 'RemoveTagsResponse' constructor. removeTagsResponse :: RemoveTagsResponse removeTagsResponse = RemoveTagsResponse
119
removeTagsResponse :: RemoveTagsResponse removeTagsResponse = RemoveTagsResponse
80
removeTagsResponse = RemoveTagsResponse
39
true
true
0
4
9
12
7
5
null
null
forsyde/forsyde-atom
src/ForSyDe/Atom/MoC/SDF/SDF.hs
bsd-3-clause
reconfig33 (c,p) sf = MoC.reconfig33 (wrap scen33 c p sf)
57
reconfig33 (c,p) sf = MoC.reconfig33 (wrap scen33 c p sf)
57
reconfig33 (c,p) sf = MoC.reconfig33 (wrap scen33 c p sf)
57
false
false
1
7
9
38
17
21
null
null
mattias-lundell/timber-llvm
src/Reduce.hs
bsd-3-clause
redf2 s gs env a b ps = do (s',q,es,e,es') <- redf (subst s gs) (subst s env) (subst s a) (subst s b) (subst s ps) return (s'@@s,q,es,e,es') -- Predicate reduction ----------------------------------------------------------------------
368
redf2 s gs env a b ps = do (s',q,es,e,es') <- redf (subst s gs) (subst s env) (subst s a) (subst s b) (subst s ps) return (s'@@s,q,es,e,es') -- Predicate reduction ----------------------------------------------------------------------
368
redf2 s gs env a b ps = do (s',q,es,e,es') <- redf (subst s gs) (subst s env) (subst s a) (subst s b) (subst s ps) return (s'@@s,q,es,e,es') -- Predicate reduction ----------------------------------------------------------------------
368
false
false
0
10
166
118
62
56
null
null
osa1/Idris-dev
src/Idris/Core/ProofState.hs
bsd-3-clause
doneElaboratingArgPS :: Name -> Name -> ProofState -> ProofState doneElaboratingArgPS f x ps = let while = while_elaborating ps while' = dropUntil (\ (FailContext _ f' x') -> f == f' && x == x') while in ps { while_elaborating = while' }
301
doneElaboratingArgPS :: Name -> Name -> ProofState -> ProofState doneElaboratingArgPS f x ps = let while = while_elaborating ps while' = dropUntil (\ (FailContext _ f' x') -> f == f' && x == x') while in ps { while_elaborating = while' }
301
doneElaboratingArgPS f x ps = let while = while_elaborating ps while' = dropUntil (\ (FailContext _ f' x') -> f == f' && x == x') while in ps { while_elaborating = while' }
236
false
true
0
14
106
98
48
50
null
null
sinelaw/lamdu
test/InferCombinators.hs
gpl-3.0
literalInteger :: Integer -> InferResults t literalInteger x = simple (ExprLens.bodyLiteralInteger # x) pureIntegerType
119
literalInteger :: Integer -> InferResults t literalInteger x = simple (ExprLens.bodyLiteralInteger # x) pureIntegerType
119
literalInteger x = simple (ExprLens.bodyLiteralInteger # x) pureIntegerType
75
false
true
0
8
13
35
17
18
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/Drawable.hs
mit
drawableGetDrawDistance :: (Parent Drawable a, Pointer p a, MonadIO m) => p -- ^ Pointer to Drawable or ascentor -> m Float drawableGetDrawDistance p = liftIO $ do let ptr = parentPointer p realToFrac <$> [C.exp| float { $(Drawable* ptr)->GetDrawDistance() } |] -- | Return shadow draw distance.
304
drawableGetDrawDistance :: (Parent Drawable a, Pointer p a, MonadIO m) => p -- ^ Pointer to Drawable or ascentor -> m Float drawableGetDrawDistance p = liftIO $ do let ptr = parentPointer p realToFrac <$> [C.exp| float { $(Drawable* ptr)->GetDrawDistance() } |] -- | Return shadow draw distance.
304
drawableGetDrawDistance p = liftIO $ do let ptr = parentPointer p realToFrac <$> [C.exp| float { $(Drawable* ptr)->GetDrawDistance() } |] -- | Return shadow draw distance.
176
false
true
0
11
56
78
40
38
null
null
GaloisInc/saw-script
src/SAWScript/AutoMatch/ArgMapping.hs
bsd-3-clause
-- | Make an argMapping from a list of Args makeArgMapping :: [Arg] -> ArgMapping makeArgMapping = ArgMapping <$> foldr (uncurry (\k -> Map.insertWith Set.union k . Set.singleton)) Map.empty . map (\(i, a) -> (argType a, (argName a, i))) . zip [0..] <*> foldr (uncurry Map.insert) Map.empty . map (\(i, a) -> (argName a, (i, argType a))) . zip [0..]
438
makeArgMapping :: [Arg] -> ArgMapping makeArgMapping = ArgMapping <$> foldr (uncurry (\k -> Map.insertWith Set.union k . Set.singleton)) Map.empty . map (\(i, a) -> (argType a, (argName a, i))) . zip [0..] <*> foldr (uncurry Map.insert) Map.empty . map (\(i, a) -> (argName a, (i, argType a))) . zip [0..]
394
makeArgMapping = ArgMapping <$> foldr (uncurry (\k -> Map.insertWith Set.union k . Set.singleton)) Map.empty . map (\(i, a) -> (argType a, (argName a, i))) . zip [0..] <*> foldr (uncurry Map.insert) Map.empty . map (\(i, a) -> (argName a, (i, argType a))) . zip [0..]
356
true
true
0
18
148
176
94
82
null
null
taktoa/ThomasEngine2
thomas/utils/TypeSketch.hs
gpl-3.0
evalFBM :: FallibleBindingMonad a -> Either PrologFailure a evalFBM = runIdentity . evalIntBindingT . runErrorT
111
evalFBM :: FallibleBindingMonad a -> Either PrologFailure a evalFBM = runIdentity . evalIntBindingT . runErrorT
111
evalFBM = runIdentity . evalIntBindingT . runErrorT
51
false
true
0
6
14
31
15
16
null
null
jprider63/LMonad-Yesod
src/Internal.hs
mit
toLFieldDef :: FieldDef -> (String, LFieldDef) toLFieldDef f = let def = LFieldDef { lFieldHaskell = fieldName -- , lFieldDB = Text.unpack $ unDBName $ fieldDB f , lFieldType = typ , lFieldStrict = fieldStrict f , lFieldLabelAnnotations = labels } in ( fieldName, def) where fieldName = Text.unpack $ unHaskellName $ fieldHaskell f labels = let attrs = fieldAttrs f in List.foldl' (\acc attr -> let ( prefix, affix) = Text.splitAt 9 attr in if acc /= Nothing || prefix /= "chevrons=" then acc else let labels@(_,_,createLabels) = parseChevrons affix in -- Check that create does not have id. if createContainsId createLabels then error $ "Field `" ++ (Text.unpack $ unHaskellName $ fieldHaskell f) ++ "` cannot have label `Id` in the create annotation." else Just labels ) Nothing attrs typ = if nullable (fieldAttrs f) then FTApp (FTTypeCon Nothing "Maybe") $ fieldType f else fieldType f nullable s | "Maybe" `elem` s = True | "nullable" `elem` s = True | otherwise = False createContainsId [] = False createContainsId (LAId:_) = True createContainsId (_:t) = createContainsId t -- Parse chevrons -- C = < L , L , L > -- L = K | _ -- K = A || K | A -- A = Id | Const name | Field name
1,614
toLFieldDef :: FieldDef -> (String, LFieldDef) toLFieldDef f = let def = LFieldDef { lFieldHaskell = fieldName -- , lFieldDB = Text.unpack $ unDBName $ fieldDB f , lFieldType = typ , lFieldStrict = fieldStrict f , lFieldLabelAnnotations = labels } in ( fieldName, def) where fieldName = Text.unpack $ unHaskellName $ fieldHaskell f labels = let attrs = fieldAttrs f in List.foldl' (\acc attr -> let ( prefix, affix) = Text.splitAt 9 attr in if acc /= Nothing || prefix /= "chevrons=" then acc else let labels@(_,_,createLabels) = parseChevrons affix in -- Check that create does not have id. if createContainsId createLabels then error $ "Field `" ++ (Text.unpack $ unHaskellName $ fieldHaskell f) ++ "` cannot have label `Id` in the create annotation." else Just labels ) Nothing attrs typ = if nullable (fieldAttrs f) then FTApp (FTTypeCon Nothing "Maybe") $ fieldType f else fieldType f nullable s | "Maybe" `elem` s = True | "nullable" `elem` s = True | otherwise = False createContainsId [] = False createContainsId (LAId:_) = True createContainsId (_:t) = createContainsId t -- Parse chevrons -- C = < L , L , L > -- L = K | _ -- K = A || K | A -- A = Id | Const name | Field name
1,614
toLFieldDef f = let def = LFieldDef { lFieldHaskell = fieldName -- , lFieldDB = Text.unpack $ unDBName $ fieldDB f , lFieldType = typ , lFieldStrict = fieldStrict f , lFieldLabelAnnotations = labels } in ( fieldName, def) where fieldName = Text.unpack $ unHaskellName $ fieldHaskell f labels = let attrs = fieldAttrs f in List.foldl' (\acc attr -> let ( prefix, affix) = Text.splitAt 9 attr in if acc /= Nothing || prefix /= "chevrons=" then acc else let labels@(_,_,createLabels) = parseChevrons affix in -- Check that create does not have id. if createContainsId createLabels then error $ "Field `" ++ (Text.unpack $ unHaskellName $ fieldHaskell f) ++ "` cannot have label `Id` in the create annotation." else Just labels ) Nothing attrs typ = if nullable (fieldAttrs f) then FTApp (FTTypeCon Nothing "Maybe") $ fieldType f else fieldType f nullable s | "Maybe" `elem` s = True | "nullable" `elem` s = True | otherwise = False createContainsId [] = False createContainsId (LAId:_) = True createContainsId (_:t) = createContainsId t -- Parse chevrons -- C = < L , L , L > -- L = K | _ -- K = A || K | A -- A = Id | Const name | Field name
1,567
false
true
0
23
643
379
199
180
null
null
LeifW/rdf4h
src/Text/RDF/RDF4H/TurtleParser.hs
bsd-3-clause
t_objectList :: GenParser ParseState () t_objectList = -- t_object actually adds the triples void ((t_object <?> "object") >> many (try (many t_ws >> char ',' >> many t_ws >> t_object)))
192
t_objectList :: GenParser ParseState () t_objectList = -- t_object actually adds the triples void ((t_object <?> "object") >> many (try (many t_ws >> char ',' >> many t_ws >> t_object)))
192
t_objectList = -- t_object actually adds the triples void ((t_object <?> "object") >> many (try (many t_ws >> char ',' >> many t_ws >> t_object)))
152
false
true
0
14
35
69
34
35
null
null
seL4/capDL-tool
CapDL/PrintIsabelle.hs
bsd-2-clause
getObject :: ObjID -> ObjMap Word -> Maybe (KernelObject Word) getObject = Map.lookup
85
getObject :: ObjID -> ObjMap Word -> Maybe (KernelObject Word) getObject = Map.lookup
85
getObject = Map.lookup
22
false
true
0
9
12
33
16
17
null
null
coursestitch/coursestitch-api
lib/CourseStitch/Models/Queries.hs
apache-2.0
joinMaybe (Just x, Just y) = Just (x, y)
40
joinMaybe (Just x, Just y) = Just (x, y)
40
joinMaybe (Just x, Just y) = Just (x, y)
40
false
false
0
6
8
31
15
16
null
null
blippy/sifi
src/Etb.hs
gpl-3.0
printEtbAcc:: [Nacc] -> [Post] -> [String] printEtbAcc ns ps = textLines where --p1 = head ps p1 = $(headQ 'ps) dr = postDr $ p1 msg = "printEtbAcc couldn't find nacc: '" ++ dr ++ "' in, e.g. " ++ (show p1) theNacc = doOrDie (find (\n -> dr == (ncAcc n)) ns) msg --Nacc _ acc _ desc = theNacc acc = ncAcc theNacc desc = ncDesc theNacc runningTotals = cumPennies $ L.map postPennies ps body = map2 etbLine ps runningTotals textLines = ["Acc: " ++ acc, desc] ++ body ++ [";"]
522
printEtbAcc:: [Nacc] -> [Post] -> [String] printEtbAcc ns ps = textLines where --p1 = head ps p1 = $(headQ 'ps) dr = postDr $ p1 msg = "printEtbAcc couldn't find nacc: '" ++ dr ++ "' in, e.g. " ++ (show p1) theNacc = doOrDie (find (\n -> dr == (ncAcc n)) ns) msg --Nacc _ acc _ desc = theNacc acc = ncAcc theNacc desc = ncDesc theNacc runningTotals = cumPennies $ L.map postPennies ps body = map2 etbLine ps runningTotals textLines = ["Acc: " ++ acc, desc] ++ body ++ [";"]
522
printEtbAcc ns ps = textLines where --p1 = head ps p1 = $(headQ 'ps) dr = postDr $ p1 msg = "printEtbAcc couldn't find nacc: '" ++ dr ++ "' in, e.g. " ++ (show p1) theNacc = doOrDie (find (\n -> dr == (ncAcc n)) ns) msg --Nacc _ acc _ desc = theNacc acc = ncAcc theNacc desc = ncDesc theNacc runningTotals = cumPennies $ L.map postPennies ps body = map2 etbLine ps runningTotals textLines = ["Acc: " ++ acc, desc] ++ body ++ [";"]
479
false
true
0
12
141
189
101
88
null
null
CristhianMotoche/scion
src/Scion/Session.hs
bsd-3-clause
destroySession :: SessionId -> ScionM () destroySession sid = do sess <- getSessionState sid _ <- io $ stopWorker (sessionWorker sess) (Just 3) unregisterSession sid return () -- | Create a temporary session that is destroyed when the -- continuation exits (normally or via an exception).
297
destroySession :: SessionId -> ScionM () destroySession sid = do sess <- getSessionState sid _ <- io $ stopWorker (sessionWorker sess) (Just 3) unregisterSession sid return () -- | Create a temporary session that is destroyed when the -- continuation exits (normally or via an exception).
297
destroySession sid = do sess <- getSessionState sid _ <- io $ stopWorker (sessionWorker sess) (Just 3) unregisterSession sid return () -- | Create a temporary session that is destroyed when the -- continuation exits (normally or via an exception).
256
false
true
0
11
54
77
35
42
null
null
nshimaza/cisco-spark-api
webex-teams-api/src/Network/WebexTeams.hs
mit
-- | Common part of 'Request' against Webex Teams API. webexTeamsBaseRequest :: Request webexTeamsBaseRequest = addRequestHeader "Content-Type" "application/json; charset=utf-8" $ setRequestPort 443 $ setRequestHost "api.ciscospark.com" $ setRequestSecure True $ defaultRequest
297
webexTeamsBaseRequest :: Request webexTeamsBaseRequest = addRequestHeader "Content-Type" "application/json; charset=utf-8" $ setRequestPort 443 $ setRequestHost "api.ciscospark.com" $ setRequestSecure True $ defaultRequest
242
webexTeamsBaseRequest = addRequestHeader "Content-Type" "application/json; charset=utf-8" $ setRequestPort 443 $ setRequestHost "api.ciscospark.com" $ setRequestSecure True $ defaultRequest
209
true
true
8
6
49
50
20
30
null
null
AntonXue/SSTG
src/SSTG/Core/Translation/Haskell.hs
bsd-3-clause
mkAltCon (DEFAULT) _ = SL.Default
33
mkAltCon (DEFAULT) _ = SL.Default
33
mkAltCon (DEFAULT) _ = SL.Default
33
false
false
0
6
4
16
8
8
null
null
wfleming/advent-of-code-2016
2017/D13/src/D13Lib.hs
bsd-3-clause
caught (h:t) p = caught t p
27
caught (h:t) p = caught t p
27
caught (h:t) p = caught t p
27
false
false
0
7
6
23
11
12
null
null
mudphone/HaskellBook
src/TwentyFour.hs
mit
parseSemVer :: Parser SemVer parseSemVer = do major <- integer char '.' minor <- integer char '.' patch <- integer rel <- try relP meta <- try metP return $ SemVer major minor patch rel meta
206
parseSemVer :: Parser SemVer parseSemVer = do major <- integer char '.' minor <- integer char '.' patch <- integer rel <- try relP meta <- try metP return $ SemVer major minor patch rel meta
206
parseSemVer = do major <- integer char '.' minor <- integer char '.' patch <- integer rel <- try relP meta <- try metP return $ SemVer major minor patch rel meta
177
false
true
0
8
51
85
36
49
null
null
kyren/hsgb
lib/Gameboy/Instructions.hs
unlicense
encodeInstruction (LD_R_N ARegister n) = [0x3e, n]
50
encodeInstruction (LD_R_N ARegister n) = [0x3e, n]
50
encodeInstruction (LD_R_N ARegister n) = [0x3e, n]
50
false
false
0
6
6
24
12
12
null
null
np/json-tools
json-lines.hs
bsd-3-clause
jsonUnlines _ = error "Unexpected JSON value, only an array was expected"
82
jsonUnlines _ = error "Unexpected JSON value, only an array was expected"
82
jsonUnlines _ = error "Unexpected JSON value, only an array was expected"
82
false
false
0
5
20
13
5
8
null
null
spechub/Hets
SoftFOL/Print.hs
gpl-2.0
endOfListS :: Doc endOfListS = text "end_of_list."
50
endOfListS :: Doc endOfListS = text "end_of_list."
50
endOfListS = text "end_of_list."
32
false
true
0
5
6
14
7
7
null
null
jbapple/unique
draft/Kickstart.hs
mit
popBackQ :: B (Kids b b) (Kids b s) (Kids (Kids b s) (Kids b s)) a -> (b a -> (a,s a)) -> (a,Either (B (Kids b b) (Kids b s) (Kids (Kids b s) (Kids b s)) a) (B (Kids b s) sas (Kids sas sas) a)) popBackQ (P (Kids bb aa ss)) f = let (x,xs) = f ss in (x,Right $ P (Kids bb aa xs))
332
popBackQ :: B (Kids b b) (Kids b s) (Kids (Kids b s) (Kids b s)) a -> (b a -> (a,s a)) -> (a,Either (B (Kids b b) (Kids b s) (Kids (Kids b s) (Kids b s)) a) (B (Kids b s) sas (Kids sas sas) a)) popBackQ (P (Kids bb aa ss)) f = let (x,xs) = f ss in (x,Right $ P (Kids bb aa xs))
332
popBackQ (P (Kids bb aa ss)) f = let (x,xs) = f ss in (x,Right $ P (Kids bb aa xs))
89
false
true
0
14
124
243
122
121
null
null
stu-smith/rendering-in-haskell
src/experiment03/Main.hs
mit
cornellBox :: Scene cornellBox = mkScene [ plane (Point 1.0 40.8 81.6) (normal 1.0 0.0 0.0) reddish , plane (Point 99.0 40.8 81.6) (normal (-1.0) 0.0 0.0) blueish , plane (Point 50.0 40.8 0.0) (normal 0.0 0.0 1.0) greyish , plane (Point 50.0 0.0 81.6) (normal 0.0 1.0 0.0) greyish , plane (Point 50.0 81.6 81.6) (normal 0.0 (-1.0) 0.0) greyish , plane (Point 50.0 40.8 170.0) (normal 0.0 0.0 (-1.0)) pureBlack , sphere (Point 27.0 16.5 47.0) 16.5 shiny , sphere (Point 73.0 16.5 78.0) 16.5 shiny , sphere (Point 50.0 681.33 81.6) 600.0 emissiveWhite ] [ PointLightSource (Point 50.0 79.33 81.6) (Light 100.0 100.0 100.0) ] where ambient = flatMaterial (Color 0.1 0.1 0.1) emissiveWhite = flatMaterial (Color 1.00 1.00 1.00) shiny = addMaterials [ ambient , diffuseMaterial (Color 0.9 0.9 0.9) 0.5 , specularMaterial 0.5 10.0 ] reddish = addMaterials [ambient, diffuseMaterial (Color 0.75 0.25 0.25) 0.5] blueish = addMaterials [ambient, diffuseMaterial (Color 0.25 0.25 0.75) 0.5] greyish = addMaterials [ambient, diffuseMaterial (Color 0.75 0.75 0.75) 0.5] pureBlack = flatMaterial (Color 0.00 0.00 0.00)
1,454
cornellBox :: Scene cornellBox = mkScene [ plane (Point 1.0 40.8 81.6) (normal 1.0 0.0 0.0) reddish , plane (Point 99.0 40.8 81.6) (normal (-1.0) 0.0 0.0) blueish , plane (Point 50.0 40.8 0.0) (normal 0.0 0.0 1.0) greyish , plane (Point 50.0 0.0 81.6) (normal 0.0 1.0 0.0) greyish , plane (Point 50.0 81.6 81.6) (normal 0.0 (-1.0) 0.0) greyish , plane (Point 50.0 40.8 170.0) (normal 0.0 0.0 (-1.0)) pureBlack , sphere (Point 27.0 16.5 47.0) 16.5 shiny , sphere (Point 73.0 16.5 78.0) 16.5 shiny , sphere (Point 50.0 681.33 81.6) 600.0 emissiveWhite ] [ PointLightSource (Point 50.0 79.33 81.6) (Light 100.0 100.0 100.0) ] where ambient = flatMaterial (Color 0.1 0.1 0.1) emissiveWhite = flatMaterial (Color 1.00 1.00 1.00) shiny = addMaterials [ ambient , diffuseMaterial (Color 0.9 0.9 0.9) 0.5 , specularMaterial 0.5 10.0 ] reddish = addMaterials [ambient, diffuseMaterial (Color 0.75 0.25 0.25) 0.5] blueish = addMaterials [ambient, diffuseMaterial (Color 0.25 0.25 0.75) 0.5] greyish = addMaterials [ambient, diffuseMaterial (Color 0.75 0.75 0.75) 0.5] pureBlack = flatMaterial (Color 0.00 0.00 0.00)
1,454
cornellBox = mkScene [ plane (Point 1.0 40.8 81.6) (normal 1.0 0.0 0.0) reddish , plane (Point 99.0 40.8 81.6) (normal (-1.0) 0.0 0.0) blueish , plane (Point 50.0 40.8 0.0) (normal 0.0 0.0 1.0) greyish , plane (Point 50.0 0.0 81.6) (normal 0.0 1.0 0.0) greyish , plane (Point 50.0 81.6 81.6) (normal 0.0 (-1.0) 0.0) greyish , plane (Point 50.0 40.8 170.0) (normal 0.0 0.0 (-1.0)) pureBlack , sphere (Point 27.0 16.5 47.0) 16.5 shiny , sphere (Point 73.0 16.5 78.0) 16.5 shiny , sphere (Point 50.0 681.33 81.6) 600.0 emissiveWhite ] [ PointLightSource (Point 50.0 79.33 81.6) (Light 100.0 100.0 100.0) ] where ambient = flatMaterial (Color 0.1 0.1 0.1) emissiveWhite = flatMaterial (Color 1.00 1.00 1.00) shiny = addMaterials [ ambient , diffuseMaterial (Color 0.9 0.9 0.9) 0.5 , specularMaterial 0.5 10.0 ] reddish = addMaterials [ambient, diffuseMaterial (Color 0.75 0.25 0.25) 0.5] blueish = addMaterials [ambient, diffuseMaterial (Color 0.25 0.25 0.75) 0.5] greyish = addMaterials [ambient, diffuseMaterial (Color 0.75 0.75 0.75) 0.5] pureBlack = flatMaterial (Color 0.00 0.00 0.00)
1,434
false
true
0
10
525
487
244
243
null
null
ShellShoccar-jpn/Open-usp-Tukubai
COMMANDS.HS/divsen.hs
mit
{-- divsen(Open usp Tukubai) designed by Nobuaki Tounaka written by Ryuichi Ueda The MIT License Copyright (C) 2012 Universal Shell Programming Laboratory Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --} showUsage :: IO () showUsage = do System.IO.hPutStr stderr ("Usage : divsen <f1> <f2> ... <file>\n" ++ "Tue Jul 30 14:54:45 JST 2013\n" ++ "Open usp Tukubai (LINUX+FREEBSD), Haskell ver.\n")
1,413
showUsage :: IO () showUsage = do System.IO.hPutStr stderr ("Usage : divsen <f1> <f2> ... <file>\n" ++ "Tue Jul 30 14:54:45 JST 2013\n" ++ "Open usp Tukubai (LINUX+FREEBSD), Haskell ver.\n")
226
showUsage = do System.IO.hPutStr stderr ("Usage : divsen <f1> <f2> ... <file>\n" ++ "Tue Jul 30 14:54:45 JST 2013\n" ++ "Open usp Tukubai (LINUX+FREEBSD), Haskell ver.\n")
207
true
true
0
10
257
39
20
19
null
null
kojiromike/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
idemodeProcess fn (SetConsoleWidth w) = do process fn (SetConsoleWidth w) iPrintResult ""
132
idemodeProcess fn (SetConsoleWidth w) = do process fn (SetConsoleWidth w) iPrintResult ""
132
idemodeProcess fn (SetConsoleWidth w) = do process fn (SetConsoleWidth w) iPrintResult ""
132
false
false
0
9
54
37
16
21
null
null
jgoerzen/media-index
Config.hs
gpl-2.0
basecp = forceEither $ set emptyCP "DEFAULT" "mknmzargs" "[]"
61
basecp = forceEither $ set emptyCP "DEFAULT" "mknmzargs" "[]"
61
basecp = forceEither $ set emptyCP "DEFAULT" "mknmzargs" "[]"
61
false
false
1
6
8
22
9
13
null
null
j5b/ps-pc
ModelChecker_test.hs
gpl-3.0
test32 = testequality "Failed to show bottom is false" result target $ printModel gammaModel where result = snd $ checkInputModel gammaModel [bottom] [] target = False
178
test32 = testequality "Failed to show bottom is false" result target $ printModel gammaModel where result = snd $ checkInputModel gammaModel [bottom] [] target = False
178
test32 = testequality "Failed to show bottom is false" result target $ printModel gammaModel where result = snd $ checkInputModel gammaModel [bottom] [] target = False
178
false
false
4
6
36
57
24
33
null
null
jsnajder/counts
src/Data/Counts.hs
bsd-3-clause
probs :: (Ord a) => Counts a -> [(a,Double)] probs cs = map (\(x,c) -> (x, realToFrac c / realToFrac (total cs))) (counts cs)
128
probs :: (Ord a) => Counts a -> [(a,Double)] probs cs = map (\(x,c) -> (x, realToFrac c / realToFrac (total cs))) (counts cs)
128
probs cs = map (\(x,c) -> (x, realToFrac c / realToFrac (total cs))) (counts cs)
83
false
true
0
12
26
86
46
40
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/IoTTopicRuleS3Action.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-topicrule-s3action.html#cfn-iot-topicrule-s3action-bucketname ittrs3aBucketName :: Lens' IoTTopicRuleS3Action (Val Text) ittrs3aBucketName = lens _ioTTopicRuleS3ActionBucketName (\s a -> s { _ioTTopicRuleS3ActionBucketName = a })
315
ittrs3aBucketName :: Lens' IoTTopicRuleS3Action (Val Text) ittrs3aBucketName = lens _ioTTopicRuleS3ActionBucketName (\s a -> s { _ioTTopicRuleS3ActionBucketName = a })
167
ittrs3aBucketName = lens _ioTTopicRuleS3ActionBucketName (\s a -> s { _ioTTopicRuleS3ActionBucketName = a })
108
true
true
0
9
21
46
25
21
null
null
kairuku/stack
src/Stack/Constants.hs
bsd-3-clause
cabalPackageName :: PackageName cabalPackageName = $(mkPackageName "Cabal")
79
cabalPackageName :: PackageName cabalPackageName = $(mkPackageName "Cabal")
79
cabalPackageName = $(mkPackageName "Cabal")
47
false
true
0
7
10
18
9
9
null
null
thomasjm/IHaskell
src/IHaskell/Eval/Lint.hs
mit
showIdea :: Idea -> Maybe LintSuggestion showIdea idea = case ideaTo idea of Nothing -> Nothing Just whyNot -> Just Suggest { line = srcSpanStartLine $ ideaSpan idea , found = showSuggestion $ ideaFrom idea , whyNot = showSuggestion whyNot , severity = ideaSeverity idea , suggestion = ideaHint idea }
385
showIdea :: Idea -> Maybe LintSuggestion showIdea idea = case ideaTo idea of Nothing -> Nothing Just whyNot -> Just Suggest { line = srcSpanStartLine $ ideaSpan idea , found = showSuggestion $ ideaFrom idea , whyNot = showSuggestion whyNot , severity = ideaSeverity idea , suggestion = ideaHint idea }
385
showIdea idea = case ideaTo idea of Nothing -> Nothing Just whyNot -> Just Suggest { line = srcSpanStartLine $ ideaSpan idea , found = showSuggestion $ ideaFrom idea , whyNot = showSuggestion whyNot , severity = ideaSeverity idea , suggestion = ideaHint idea }
344
false
true
0
12
134
105
52
53
null
null
isaiah/cis194
src/StackVM.hs
mit
errType :: String -> Either String a errType op = Left $ "Encountered '" ++ op ++ "' opcode with ill-typed stack."
114
errType :: String -> Either String a errType op = Left $ "Encountered '" ++ op ++ "' opcode with ill-typed stack."
114
errType op = Left $ "Encountered '" ++ op ++ "' opcode with ill-typed stack."
77
false
true
2
7
21
41
18
23
null
null