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
kylcarte/finally-logical
src/Data/Logic/CNF.hs
bsd-3-clause
p1 :: StrProp r => r p1 = atom "C" .|. (atom "A" .&. atom "B")
62
p1 :: StrProp r => r p1 = atom "C" .|. (atom "A" .&. atom "B")
62
p1 = atom "C" .|. (atom "A" .&. atom "B")
41
false
true
1
8
15
47
20
27
null
null
Southern-Exposure-Seed-Exchange/southernexposure.com
server/scripts/ExportOddWeights.hs
gpl-3.0
-- | Get Active Products join with any Active Variants. getMassVariants :: SqlWriteT IO [ProductAndVariants] getMassVariants = do products <- selectList [] [Asc ProductBaseSku] fmap catMaybes . forM products $ \e@(Entity pId _) -> do vs <- filter (isMass . productVariantLotSize . entityVal) <$> selectList [ ProductVariantProductId ==. pId , ProductVariantIsActive ==. True ] [ Asc ProductVariantSkuSuffix ] return $ nullToNothing e vs where isMass :: Maybe LotSize -> Bool isMass = \case Just (Mass _) -> True _ -> False -- | Return only Variants that have a Lot Size of 0mg.
713
getMassVariants :: SqlWriteT IO [ProductAndVariants] getMassVariants = do products <- selectList [] [Asc ProductBaseSku] fmap catMaybes . forM products $ \e@(Entity pId _) -> do vs <- filter (isMass . productVariantLotSize . entityVal) <$> selectList [ ProductVariantProductId ==. pId , ProductVariantIsActive ==. True ] [ Asc ProductVariantSkuSuffix ] return $ nullToNothing e vs where isMass :: Maybe LotSize -> Bool isMass = \case Just (Mass _) -> True _ -> False -- | Return only Variants that have a Lot Size of 0mg.
657
getMassVariants = do products <- selectList [] [Asc ProductBaseSku] fmap catMaybes . forM products $ \e@(Entity pId _) -> do vs <- filter (isMass . productVariantLotSize . entityVal) <$> selectList [ ProductVariantProductId ==. pId , ProductVariantIsActive ==. True ] [ Asc ProductVariantSkuSuffix ] return $ nullToNothing e vs where isMass :: Maybe LotSize -> Bool isMass = \case Just (Mass _) -> True _ -> False -- | Return only Variants that have a Lot Size of 0mg.
604
true
true
0
16
228
179
88
91
null
null
postgres-haskell/postgres-wire
src/Database/PostgreSQL/Protocol/Codecs/Encoders.hs
mit
uuid :: UUID -> Encode uuid v = let (a, b, c, d) = toWords v in putWord32BE a <> putWord32BE b <> putWord32BE c <> putWord32BE d
138
uuid :: UUID -> Encode uuid v = let (a, b, c, d) = toWords v in putWord32BE a <> putWord32BE b <> putWord32BE c <> putWord32BE d
138
uuid v = let (a, b, c, d) = toWords v in putWord32BE a <> putWord32BE b <> putWord32BE c <> putWord32BE d
115
false
true
0
10
37
72
34
38
null
null
shouya/projz
emulator/Processor.hs
bsd-2-clause
mem_inst :: (Word8 -> State -> State) -> State -> State mem_inst f st = f (st ^. regMem HL) st
94
mem_inst :: (Word8 -> State -> State) -> State -> State mem_inst f st = f (st ^. regMem HL) st
94
mem_inst f st = f (st ^. regMem HL) st
38
false
true
0
9
20
56
26
30
null
null
ddssff/rdf4h
src/Data/RDF/MGraph.hs
bsd-3-clause
sel1 :: NodeSelector -> NodeSelector -> NodeSelector -> TMap -> HashSet (Node, Node, Node) sel1 (Just subjFn) p o spoMap = Set.unions $ map (sel2 p o) $ filter (\(x,_) -> subjFn x) $ HashMap.toList spoMap
206
sel1 :: NodeSelector -> NodeSelector -> NodeSelector -> TMap -> HashSet (Node, Node, Node) sel1 (Just subjFn) p o spoMap = Set.unions $ map (sel2 p o) $ filter (\(x,_) -> subjFn x) $ HashMap.toList spoMap
206
sel1 (Just subjFn) p o spoMap = Set.unions $ map (sel2 p o) $ filter (\(x,_) -> subjFn x) $ HashMap.toList spoMap
115
false
true
0
10
37
104
53
51
null
null
beni55/text
Data/Text/Lazy.hs
bsd-2-clause
equal _ Empty = False
25
equal _ Empty = False
25
equal _ Empty = False
25
false
false
1
5
8
13
5
8
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Site-wide settings. sitiSiteSettings :: Lens' Site (Maybe SiteSettings) sitiSiteSettings = lens _sitiSiteSettings (\ s a -> s{_sitiSiteSettings = a})
162
sitiSiteSettings :: Lens' Site (Maybe SiteSettings) sitiSiteSettings = lens _sitiSiteSettings (\ s a -> s{_sitiSiteSettings = a})
137
sitiSiteSettings = lens _sitiSiteSettings (\ s a -> s{_sitiSiteSettings = a})
85
true
true
1
9
28
51
25
26
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'BC.hPut' bc_hPut = BC.hPut
31
bc_hPut = BC.hPut
17
bc_hPut = BC.hPut
17
true
false
0
5
4
9
5
4
null
null
dalaing/sdl2
examples/lazyfoo/Lesson20.hs
bsd-3-clause
loadTexture :: SDL.Renderer -> FilePath -> IO Texture loadTexture r filePath = do surface <- getDataFileName filePath >>= SDL.loadBMP size <- SDL.surfaceDimensions surface format <- SDL.surfaceFormat surface key <- SDL.mapRGB format (V3 0 maxBound maxBound) SDL.colorKey surface $= Just key t <- SDL.createTextureFromSurface r surface SDL.freeSurface surface return (Texture t size)
398
loadTexture :: SDL.Renderer -> FilePath -> IO Texture loadTexture r filePath = do surface <- getDataFileName filePath >>= SDL.loadBMP size <- SDL.surfaceDimensions surface format <- SDL.surfaceFormat surface key <- SDL.mapRGB format (V3 0 maxBound maxBound) SDL.colorKey surface $= Just key t <- SDL.createTextureFromSurface r surface SDL.freeSurface surface return (Texture t size)
398
loadTexture r filePath = do surface <- getDataFileName filePath >>= SDL.loadBMP size <- SDL.surfaceDimensions surface format <- SDL.surfaceFormat surface key <- SDL.mapRGB format (V3 0 maxBound maxBound) SDL.colorKey surface $= Just key t <- SDL.createTextureFromSurface r surface SDL.freeSurface surface return (Texture t size)
344
false
true
0
10
66
144
63
81
null
null
pascalpoizat/vecahaskell
src/Veca/Operations.hs
apache-2.0
{-| Index an operation by a name. -} indexBy :: VName -> Operation -> Operation indexBy i (Operation n) = Operation (i <> n)
124
indexBy :: VName -> Operation -> Operation indexBy i (Operation n) = Operation (i <> n)
87
indexBy i (Operation n) = Operation (i <> n)
44
true
true
0
10
23
46
22
24
null
null
mhwombat/creatur-audio-wains
src/ALife/Creatur/Wain/Audio/Object.hs
bsd-3-clause
objectId :: Object a rt -> String objectId (PObject _ s) = "Audio " ++ s
72
objectId :: Object a rt -> String objectId (PObject _ s) = "Audio " ++ s
72
objectId (PObject _ s) = "Audio " ++ s
38
false
true
0
9
15
41
18
23
null
null
micknelso/language-c
src/Language/CFamily/Data/Position.hs
bsd-3-clause
retPos p = p
38
retPos p = p
38
retPos p = p
38
false
false
0
5
29
9
4
5
null
null
d0kt0r0/Tidal
src/Sound/Tidal/old/Params.hs
gpl-3.0
-- | a pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter. (bandf, bandf_p) = pF "bandf" (Just 0)
144
(bandf, bandf_p) = pF "bandf" (Just 0)
54
(bandf, bandf_p) = pF "bandf" (Just 0)
54
true
false
0
7
40
25
13
12
null
null
phischu/fragnix
tests/packages/scotty/Text.PrettyPrint.HughesPJ.hs
bsd-3-clause
-- | Default TextDetails printer. txtPrinter :: TextDetails -> String -> String txtPrinter (Chr c) s = c:s
109
txtPrinter :: TextDetails -> String -> String txtPrinter (Chr c) s = c:s
75
txtPrinter (Chr c) s = c:s
29
true
true
0
7
20
35
18
17
null
null
mreid/papersite
src/lib/Paper.hs
mit
getT :: Entry -> BibTex.T getT (Entry t) = t
44
getT :: Entry -> BibTex.T getT (Entry t) = t
44
getT (Entry t) = t
18
false
true
0
9
9
32
14
18
null
null
sarahn/ganeti
src/Ganeti/OpCodes.hs
gpl-2.0
opSummaryVal OpInstanceMigrate { opInstanceName = s } = Just s
62
opSummaryVal OpInstanceMigrate { opInstanceName = s } = Just s
62
opSummaryVal OpInstanceMigrate { opInstanceName = s } = Just s
62
false
false
1
7
9
25
11
14
null
null
lpeterse/koka
src/Interpreter/Command.hs
apache-2.0
-- | Parse a command without the preceeding colon. cmdeval :: Parser Command cmdeval = do{ symbol "l" <|> symbol "load"; fpaths <- filenames; return (Load fpaths) } <|> do{ symbol "r" <|> symbol "reload"; return Reload } <|> do{ symbol "q" <|> symbol "quit"; return Quit } -- external <|> do{ symbol "e" <|> symbol "edit"; fpath <- option "" filename; return (Edit fpath) } <|> do{ symbol "cd"; fpath <- option "" filename; return (ChangeDir fpath) } <|> do{ special "!"; cmd <- shellCommand; return (Shell cmd) } -- help <|> do{ special "?" <|> symbol "h" <|> symbol "help"; return (Show ShowHelp) } -- complex <|> do{ symbol "t" <|> symbol "type" <|> symbol "b" <|> symbol "browse"; (do p <- getPosition; x <- expr; return (TypeOf (replicate (sourceColumn p-1) ' ' ++ x)) <|> return (Show ShowTypeSigs))} <|> do{ symbol "set"; opts <- commandLine; return (Options opts) } <|> do{ symbol "s" <|> symbol "source" ; return (Show (ShowSource))} <|> do{ symbol "k" <|> symbol "kind"; (do p <- getPosition; x <- expr; return (KindOf (replicate (sourceColumn p-1) ' ' ++ x)) <|> return (Show ShowKindSigs))} <|> do{ symbol "d" <|> symbol "defines" ; return (Show ShowDefines) } <|> do{ symbol "alias"; return (Show ShowSynonyms) } <|> do{ symbol "w" <|> symbol "warranty" <|> symbol "version"; return (Show ShowVersion) } <?> "command"
1,446
cmdeval :: Parser Command cmdeval = do{ symbol "l" <|> symbol "load"; fpaths <- filenames; return (Load fpaths) } <|> do{ symbol "r" <|> symbol "reload"; return Reload } <|> do{ symbol "q" <|> symbol "quit"; return Quit } -- external <|> do{ symbol "e" <|> symbol "edit"; fpath <- option "" filename; return (Edit fpath) } <|> do{ symbol "cd"; fpath <- option "" filename; return (ChangeDir fpath) } <|> do{ special "!"; cmd <- shellCommand; return (Shell cmd) } -- help <|> do{ special "?" <|> symbol "h" <|> symbol "help"; return (Show ShowHelp) } -- complex <|> do{ symbol "t" <|> symbol "type" <|> symbol "b" <|> symbol "browse"; (do p <- getPosition; x <- expr; return (TypeOf (replicate (sourceColumn p-1) ' ' ++ x)) <|> return (Show ShowTypeSigs))} <|> do{ symbol "set"; opts <- commandLine; return (Options opts) } <|> do{ symbol "s" <|> symbol "source" ; return (Show (ShowSource))} <|> do{ symbol "k" <|> symbol "kind"; (do p <- getPosition; x <- expr; return (KindOf (replicate (sourceColumn p-1) ' ' ++ x)) <|> return (Show ShowKindSigs))} <|> do{ symbol "d" <|> symbol "defines" ; return (Show ShowDefines) } <|> do{ symbol "alias"; return (Show ShowSynonyms) } <|> do{ symbol "w" <|> symbol "warranty" <|> symbol "version"; return (Show ShowVersion) } <?> "command"
1,395
cmdeval = do{ symbol "l" <|> symbol "load"; fpaths <- filenames; return (Load fpaths) } <|> do{ symbol "r" <|> symbol "reload"; return Reload } <|> do{ symbol "q" <|> symbol "quit"; return Quit } -- external <|> do{ symbol "e" <|> symbol "edit"; fpath <- option "" filename; return (Edit fpath) } <|> do{ symbol "cd"; fpath <- option "" filename; return (ChangeDir fpath) } <|> do{ special "!"; cmd <- shellCommand; return (Shell cmd) } -- help <|> do{ special "?" <|> symbol "h" <|> symbol "help"; return (Show ShowHelp) } -- complex <|> do{ symbol "t" <|> symbol "type" <|> symbol "b" <|> symbol "browse"; (do p <- getPosition; x <- expr; return (TypeOf (replicate (sourceColumn p-1) ' ' ++ x)) <|> return (Show ShowTypeSigs))} <|> do{ symbol "set"; opts <- commandLine; return (Options opts) } <|> do{ symbol "s" <|> symbol "source" ; return (Show (ShowSource))} <|> do{ symbol "k" <|> symbol "kind"; (do p <- getPosition; x <- expr; return (KindOf (replicate (sourceColumn p-1) ' ' ++ x)) <|> return (Show ShowKindSigs))} <|> do{ symbol "d" <|> symbol "defines" ; return (Show ShowDefines) } <|> do{ symbol "alias"; return (Show ShowSynonyms) } <|> do{ symbol "w" <|> symbol "warranty" <|> symbol "version"; return (Show ShowVersion) } <?> "command"
1,369
true
true
41
19
341
667
324
343
null
null
smobs/Ratscrew
tests/Ratscrew/Game/Internal/Snapping/Tests.hs
mit
darkQueen :: Int -> [Card] -> Bool darkQueen i cs = fut i $ Card Queen Spades : cs
82
darkQueen :: Int -> [Card] -> Bool darkQueen i cs = fut i $ Card Queen Spades : cs
82
darkQueen i cs = fut i $ Card Queen Spades : cs
47
false
true
0
7
18
43
21
22
null
null
mcschroeder/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
isCFunEqCan :: Ct -> Bool isCFunEqCan (CFunEqCan {}) = True
59
isCFunEqCan :: Ct -> Bool isCFunEqCan (CFunEqCan {}) = True
59
isCFunEqCan (CFunEqCan {}) = True
33
false
true
0
7
9
25
13
12
null
null
Pnom/haskell-ast-pretty
Test/examples/Attributes.hs
mit
usedByEdges Comment{} = True
35
usedByEdges Comment{} = True
35
usedByEdges Comment{} = True
35
false
false
0
6
10
13
6
7
null
null
Rathcke/uni
ap/advanced programming/assignment2/ParserTest.hs
gpl-3.0
--test = TestCase (assertEqual "description" "expected" actual) testSucc1 :: Test testSucc1 = TestCase (do parsedFile <- parseFile "tests/simple" assertEqual "simple test file" simpleAST $ show parsedFile)
270
testSucc1 :: Test testSucc1 = TestCase (do parsedFile <- parseFile "tests/simple" assertEqual "simple test file" simpleAST $ show parsedFile)
205
testSucc1 = TestCase (do parsedFile <- parseFile "tests/simple" assertEqual "simple test file" simpleAST $ show parsedFile)
187
true
true
0
10
90
43
20
23
null
null
dylanaraps/pywal
pywal/templates/colors.hs
mit
-- Shell variables -- Generated by 'wal' wallpaper="{wallpaper}"
64
wallpaper="{wallpaper}"
23
wallpaper="{wallpaper}"
23
true
false
1
5
7
13
5
8
null
null
elliottt/llvm-pretty-lint
src/Text/LLVM/Lint.hs
bsd-3-clause
withRetType :: Type -> Lint a -> Lint a withRetType ty body = Lint $ do ro <- ask local (ro { roRetType = Just ty }) (unLint body)
134
withRetType :: Type -> Lint a -> Lint a withRetType ty body = Lint $ do ro <- ask local (ro { roRetType = Just ty }) (unLint body)
134
withRetType ty body = Lint $ do ro <- ask local (ro { roRetType = Just ty }) (unLint body)
94
false
true
0
12
32
69
33
36
null
null
mattias-lundell/timber-llvm
src/Common.hs
bsd-3-clause
newEnv x ts = do vs <- mapM (const (newName x)) ts return (vs `zip` ts)
128
newEnv x ts = do vs <- mapM (const (newName x)) ts return (vs `zip` ts)
128
newEnv x ts = do vs <- mapM (const (newName x)) ts return (vs `zip` ts)
128
false
false
0
12
72
50
24
26
null
null
kawu/french-tag
src/NLP/Partage4Xmg/Grammar.hs
bsd-2-clause
symQ :: Q Sym symQ = joinR (named "f" *> hasAttrVal "name" "cat") $ first $ node (named "sym" *> (L.toStrict <$> attr "value"))
131
symQ :: Q Sym symQ = joinR (named "f" *> hasAttrVal "name" "cat") $ first $ node (named "sym" *> (L.toStrict <$> attr "value"))
131
symQ = joinR (named "f" *> hasAttrVal "name" "cat") $ first $ node (named "sym" *> (L.toStrict <$> attr "value"))
117
false
true
0
11
27
65
31
34
null
null
christinem/courseography
app/DynamicGraphs/GraphGenerator.hs
gpl-3.0
reqToStmtsHelper :: (StmtsWithCounter, [Text]) -> Req -> (StmtsWithCounter, [Text]) -- TODO: update function reqToStmtsHelper ((stmtslst, counter), roots) (J string1 _) = (([makeNode (pack string1) counter 0] ++ stmtslst, counter + 1), [mappendTextWithCounter (pack string1) counter] ++ roots)
414
reqToStmtsHelper :: (StmtsWithCounter, [Text]) -> Req -> (StmtsWithCounter, [Text]) reqToStmtsHelper ((stmtslst, counter), roots) (J string1 _) = (([makeNode (pack string1) counter 0] ++ stmtslst, counter + 1), [mappendTextWithCounter (pack string1) counter] ++ roots)
388
reqToStmtsHelper ((stmtslst, counter), roots) (J string1 _) = (([makeNode (pack string1) counter 0] ++ stmtslst, counter + 1), [mappendTextWithCounter (pack string1) counter] ++ roots)
304
true
true
0
11
157
117
66
51
null
null
haskell-infra/git-haskell-org-hooks
src/Common.hs
gpl-3.0
gitCatBlob :: FilePath -> GitRef -> Sh Text gitCatBlob d ref = do tmpl <- liftM tread $ runGit d "cat-file" ["-s", ref] -- workaround shelly adding EOLs tmp <- runGit d "cat-file" ["blob", ref] return (T.take tmpl tmp) where tread = read . T.unpack -- | Wrapper around @git rev-parse --verify@ -- -- Normalise git ref to commit sha1
351
gitCatBlob :: FilePath -> GitRef -> Sh Text gitCatBlob d ref = do tmpl <- liftM tread $ runGit d "cat-file" ["-s", ref] -- workaround shelly adding EOLs tmp <- runGit d "cat-file" ["blob", ref] return (T.take tmpl tmp) where tread = read . T.unpack -- | Wrapper around @git rev-parse --verify@ -- -- Normalise git ref to commit sha1
351
gitCatBlob d ref = do tmpl <- liftM tread $ runGit d "cat-file" ["-s", ref] -- workaround shelly adding EOLs tmp <- runGit d "cat-file" ["blob", ref] return (T.take tmpl tmp) where tread = read . T.unpack -- | Wrapper around @git rev-parse --verify@ -- -- Normalise git ref to commit sha1
307
false
true
2
10
78
117
55
62
null
null
damianfral/clay
src/Clay/Elements.hs
bsd-3-clause
li = "li"
9
li = "li"
9
li = "li"
9
false
false
1
5
2
10
3
7
null
null
CulpaBS/wbBach
src/Futhark/CodeGen/Backends/GenericC.hs
bsd-3-clause
compileCode (Allocate name (Count e) space) = do size <- compileExp e allocMem name size space
98
compileCode (Allocate name (Count e) space) = do size <- compileExp e allocMem name size space
98
compileCode (Allocate name (Count e) space) = do size <- compileExp e allocMem name size space
98
false
false
0
9
19
45
20
25
null
null
kadena-io/pact
src/Pact/Types/Util.hs
bsd-3-clause
-- | Re-wrapping lens. rewrapping :: (Profunctor p, Functor f, Wrapped b, Wrapped a, Unwrapped a ~ Unwrapped b) => p a (f a) -> p b (f b) rewrapping = _Wrapped' . _Unwrapped'
203
rewrapping :: (Profunctor p, Functor f, Wrapped b, Wrapped a, Unwrapped a ~ Unwrapped b) => p a (f a) -> p b (f b) rewrapping = _Wrapped' . _Unwrapped'
180
rewrapping = _Wrapped' . _Unwrapped'
36
true
true
0
9
62
83
41
42
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs
bsd-3-clause
gl_RED :: GLenum gl_RED = 0x1903
32
gl_RED :: GLenum gl_RED = 0x1903
32
gl_RED = 0x1903
15
false
true
0
4
5
11
6
5
null
null
rueshyna/gogol
gogol-games/gen/Network/Google/Games/Types/Product.hs
mpl-2.0
-- | Uniquely identifies the type of this resource. Value is always the fixed -- string games#roomClientAddress. rcaKind :: Lens' RoomClientAddress Text rcaKind = lens _rcaKind (\ s a -> s{_rcaKind = a})
203
rcaKind :: Lens' RoomClientAddress Text rcaKind = lens _rcaKind (\ s a -> s{_rcaKind = a})
90
rcaKind = lens _rcaKind (\ s a -> s{_rcaKind = a})
50
true
true
0
9
32
41
23
18
null
null
stefan-j/ProjectEuler
q17.hs
mit
wordnames 13 = "thirteen"
25
wordnames 13 = "thirteen"
25
wordnames 13 = "thirteen"
25
false
false
0
5
3
9
4
5
null
null
sdiehl/ghc
compiler/main/CmdLineParser.hs
bsd-3-clause
defFlag :: String -> OptKind m -> Flag m defFlag name optKind = Flag name optKind AllModes
90
defFlag :: String -> OptKind m -> Flag m defFlag name optKind = Flag name optKind AllModes
90
defFlag name optKind = Flag name optKind AllModes
49
false
true
0
7
16
37
17
20
null
null
diku-kmc/repg
src/KMC/RangeSet.hs
mit
member :: (Ord a) => a -> RangeSet a -> Bool member w (RangeSet rs) = any (\(l, h) -> l <= w && w <= h) rs
106
member :: (Ord a) => a -> RangeSet a -> Bool member w (RangeSet rs) = any (\(l, h) -> l <= w && w <= h) rs
106
member w (RangeSet rs) = any (\(l, h) -> l <= w && w <= h) rs
61
false
true
0
10
27
73
38
35
null
null
mrmonday/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
pOptimise :: [(Name, OptInfo)] -> Idris () pOptimise cs = mapM_ (\ (n, c) -> updateIState (\i -> i { idris_optimisation = addDef n c (idris_optimisation i) })) cs
186
pOptimise :: [(Name, OptInfo)] -> Idris () pOptimise cs = mapM_ (\ (n, c) -> updateIState (\i -> i { idris_optimisation = addDef n c (idris_optimisation i) })) cs
186
pOptimise cs = mapM_ (\ (n, c) -> updateIState (\i -> i { idris_optimisation = addDef n c (idris_optimisation i) })) cs
143
false
true
0
15
52
88
46
42
null
null
svenssonjoel/ObsidianGFX
Obsidian/CodeGen/Program.hs
bsd-3-clause
cs i (P.Declare id t) = return ((),out (SDeclare id t))
58
cs i (P.Declare id t) = return ((),out (SDeclare id t))
58
cs i (P.Declare id t) = return ((),out (SDeclare id t))
58
false
false
0
8
13
45
21
24
null
null
romanb/amazonka
amazonka-elb/gen/Network/AWS/ELB/SetLoadBalancerListenerSSLCertificate.hs
mpl-2.0
-- | The name of the load balancer. slblsslcLoadBalancerName :: Lens' SetLoadBalancerListenerSSLCertificate Text slblsslcLoadBalancerName = lens _slblsslcLoadBalancerName (\s a -> s { _slblsslcLoadBalancerName = a })
228
slblsslcLoadBalancerName :: Lens' SetLoadBalancerListenerSSLCertificate Text slblsslcLoadBalancerName = lens _slblsslcLoadBalancerName (\s a -> s { _slblsslcLoadBalancerName = a })
192
slblsslcLoadBalancerName = lens _slblsslcLoadBalancerName (\s a -> s { _slblsslcLoadBalancerName = a })
115
true
true
1
9
37
46
22
24
null
null
lexml/lexml-linker
src/main/haskell/MakeMunicipios.hs
gpl-2.0
limpaChar 'ã' = 'a'
19
limpaChar 'ã' = 'a'
19
limpaChar 'ã' = 'a'
19
false
false
0
5
3
9
4
5
null
null
garetxe/cabal
Cabal/Distribution/Simple/GHC/Internal.hs
bsd-3-clause
showOsString OSX = "darwin"
31
showOsString OSX = "darwin"
31
showOsString OSX = "darwin"
31
false
false
0
5
7
9
4
5
null
null
tjakway/ghcjvm
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
getRegister' _ is32Bit (CmmMachOp (MO_SS_Conv W16 W64) [CmmLoad addr _]) | not is32Bit = do code <- intLoadCode (MOVSxL II16) addr return (Any II64 code)
158
getRegister' _ is32Bit (CmmMachOp (MO_SS_Conv W16 W64) [CmmLoad addr _]) | not is32Bit = do code <- intLoadCode (MOVSxL II16) addr return (Any II64 code)
158
getRegister' _ is32Bit (CmmMachOp (MO_SS_Conv W16 W64) [CmmLoad addr _]) | not is32Bit = do code <- intLoadCode (MOVSxL II16) addr return (Any II64 code)
158
false
false
1
12
29
82
35
47
null
null
JoeyEremondi/elm-type-effect
src/Type/Effect/Pattern.hs
bsd-3-clause
--Group patterns by their constructors, since we might match on more/less specific versions sortByCtor :: [P.CanonicalPattern] -> [(String, [[P.CanonicalPattern]])] sortByCtor patList = let --TODO sort other than by CTOR? allNames = (List.nub $ map (ctorName) patList) maybeAddName name pa@(A.A _ pat) subPatList = case pat of P.Data name2 pats -> if (name == ctorName pa) then (pats : subPatList) else subPatList (P.Record e) -> subPatList (P.Alias e1 e2) -> maybeAddName name e2 subPatList (P.Var e) -> subPatList --Ignor naze these, we should catch this earlier P.Anything -> subPatList --Ignore these, we should catch this earlier (P.Literal e) -> subPatList sortedPats = [ (ctor, List.transpose $ foldr (maybeAddName ctor) [] patList) | ctor <- allNames] in trace ("ALL NAMES " ++ show allNames ) $ sortedPats
877
sortByCtor :: [P.CanonicalPattern] -> [(String, [[P.CanonicalPattern]])] sortByCtor patList = let --TODO sort other than by CTOR? allNames = (List.nub $ map (ctorName) patList) maybeAddName name pa@(A.A _ pat) subPatList = case pat of P.Data name2 pats -> if (name == ctorName pa) then (pats : subPatList) else subPatList (P.Record e) -> subPatList (P.Alias e1 e2) -> maybeAddName name e2 subPatList (P.Var e) -> subPatList --Ignor naze these, we should catch this earlier P.Anything -> subPatList --Ignore these, we should catch this earlier (P.Literal e) -> subPatList sortedPats = [ (ctor, List.transpose $ foldr (maybeAddName ctor) [] patList) | ctor <- allNames] in trace ("ALL NAMES " ++ show allNames ) $ sortedPats
785
sortByCtor patList = let --TODO sort other than by CTOR? allNames = (List.nub $ map (ctorName) patList) maybeAddName name pa@(A.A _ pat) subPatList = case pat of P.Data name2 pats -> if (name == ctorName pa) then (pats : subPatList) else subPatList (P.Record e) -> subPatList (P.Alias e1 e2) -> maybeAddName name e2 subPatList (P.Var e) -> subPatList --Ignor naze these, we should catch this earlier P.Anything -> subPatList --Ignore these, we should catch this earlier (P.Literal e) -> subPatList sortedPats = [ (ctor, List.transpose $ foldr (maybeAddName ctor) [] patList) | ctor <- allNames] in trace ("ALL NAMES " ++ show allNames ) $ sortedPats
712
true
true
0
15
187
272
143
129
null
null
burz/sonada
Model.hs
apache-2.0
discardEmptyString (Just s) = if s == "" then Nothing else Just s
65
discardEmptyString (Just s) = if s == "" then Nothing else Just s
65
discardEmptyString (Just s) = if s == "" then Nothing else Just s
65
false
false
0
7
12
30
15
15
null
null
colinba/tip-toi-reveng
src/PrettyPrint.hs
mit
ppConditional :: Conditional ResReg -> String ppConditional (Cond v1 o v2) = printf "%s%s%s?" (ppTVal v1) (ppCondOp o) (ppTVal v2)
130
ppConditional :: Conditional ResReg -> String ppConditional (Cond v1 o v2) = printf "%s%s%s?" (ppTVal v1) (ppCondOp o) (ppTVal v2)
130
ppConditional (Cond v1 o v2) = printf "%s%s%s?" (ppTVal v1) (ppCondOp o) (ppTVal v2)
84
false
true
0
7
19
58
28
30
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qLayoutListFromPtrList :: [Ptr (TQLayout a)] -> IO [QLayout a] qLayoutListFromPtrList p = objectListFromPtrList_nf p
118
qLayoutListFromPtrList :: [Ptr (TQLayout a)] -> IO [QLayout a] qLayoutListFromPtrList p = objectListFromPtrList_nf p
118
qLayoutListFromPtrList p = objectListFromPtrList_nf p
55
false
true
0
9
15
42
20
22
null
null
dmvianna/haskellbook
src/Ch14Ex-tests.hs
unlicense
square x = x * x
16
square x = x * x
16
square x = x * x
16
false
false
0
5
5
13
6
7
null
null
kawamuray/ganeti
src/Ganeti/Monitoring/Server.hs
gpl-2.0
-- | Return the report of all the available collectors. allReports :: MVar CollectorMap -> Snap () allReports mvar = do reports <- mapM (liftIO . getReport mvar) collectors writeBS . pack . J.encode $ reports -- | Takes the CollectorMap and a DataCollector and returns the report for this -- collector.
307
allReports :: MVar CollectorMap -> Snap () allReports mvar = do reports <- mapM (liftIO . getReport mvar) collectors writeBS . pack . J.encode $ reports -- | Takes the CollectorMap and a DataCollector and returns the report for this -- collector.
251
allReports mvar = do reports <- mapM (liftIO . getReport mvar) collectors writeBS . pack . J.encode $ reports -- | Takes the CollectorMap and a DataCollector and returns the report for this -- collector.
208
true
true
0
11
56
68
33
35
null
null
graninas/Andromeda
src/Andromeda/Language/LogicControl/Translator.hs
bsd-3-clause
feedCreator :: Creator a -> [String] -> a feedCreator (Arity0Cr cr) [] = cr
83
feedCreator :: Creator a -> [String] -> a feedCreator (Arity0Cr cr) [] = cr
83
feedCreator (Arity0Cr cr) [] = cr
41
false
true
0
7
21
38
19
19
null
null
li-zhirui/EoplLangs
src/SimpleModule/TypeChecker.hs
bsd-3-clause
typeOf :: Expression -> TypeEnvironment -> TypeResult typeOf (ConstExpr val) _ = typeOfConstExpr val
111
typeOf :: Expression -> TypeEnvironment -> TypeResult typeOf (ConstExpr val) _ = typeOfConstExpr val
111
typeOf (ConstExpr val) _ = typeOfConstExpr val
57
false
true
0
7
24
33
16
17
null
null
palas/detparaminf
src/DetParamInf/AptaTree.hs
bsd-2-clause
remo n (h:t) = h:remo (n - 1) t
31
remo n (h:t) = h:remo (n - 1) t
31
remo n (h:t) = h:remo (n - 1) t
31
false
false
2
6
8
40
17
23
null
null
ekmett/ermine
src/Ermine/Interpreter.hs
bsd-2-clause
sentinel :: a sentinel = error "PANIC: access past end of stack"
64
sentinel :: a sentinel = error "PANIC: access past end of stack"
64
sentinel = error "PANIC: access past end of stack"
50
false
true
0
6
11
21
8
13
null
null
tekul/cryptonite
Crypto/MAC/CMAC.hs
bsd-3-clause
bxor :: ByteArray ba => ba -> ba -> ba bxor = B.xor
51
bxor :: ByteArray ba => ba -> ba -> ba bxor = B.xor
51
bxor = B.xor
12
false
true
0
7
12
28
14
14
null
null
grandpascorpion/canon
Math/NumberTheory/Canon.hs
gpl-3.0
a ~~~~|<<^>>|~~~~ b = cApplyHy (makeCanon 47) [a,b] True
60
a ~~~~|<<^>>|~~~~ b = cApplyHy (makeCanon 47) [a,b] True
60
a ~~~~|<<^>>|~~~~ b = cApplyHy (makeCanon 47) [a,b] True
60
false
false
0
7
12
31
15
16
null
null
mstksg/jlebot2
src/Util.hs
mit
sealRandom :: (Monad m, RandomGen g, Serialize g) => Auto (RandT g m) a b -> g -> Auto m a b sealRandom = sealState . hoistA (StateT . runRandT)
177
sealRandom :: (Monad m, RandomGen g, Serialize g) => Auto (RandT g m) a b -> g -> Auto m a b sealRandom = sealState . hoistA (StateT . runRandT)
177
sealRandom = sealState . hoistA (StateT . runRandT)
51
false
true
0
9
62
76
38
38
null
null
OpenXT/manager
xenmgr/Vm/React.hs
gpl-2.0
detectBsgDevStatusR = whenE VmBsgDevNodeChange checkBsgDevStatus
66
detectBsgDevStatusR = whenE VmBsgDevNodeChange checkBsgDevStatus
66
detectBsgDevStatusR = whenE VmBsgDevNodeChange checkBsgDevStatus
66
false
false
1
5
6
16
5
11
null
null
oldmanmike/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
pcNonRecDataTyCon :: Name -> Maybe CType -> [TyVar] -> [DataCon] -> TyCon -- Not an enumeration pcNonRecDataTyCon = pcTyCon False NonRecursive
142
pcNonRecDataTyCon :: Name -> Maybe CType -> [TyVar] -> [DataCon] -> TyCon pcNonRecDataTyCon = pcTyCon False NonRecursive
120
pcNonRecDataTyCon = pcTyCon False NonRecursive
46
true
true
0
10
20
50
23
27
null
null
schell/orion
src/Web/Orion/OAuth/Services.hs
bsd-3-clause
stringToService _ = Nothing
37
stringToService _ = Nothing
37
stringToService _ = Nothing
37
false
false
0
4
13
10
4
6
null
null
jekor/vocabulink
hs/Vocabulink.hs
agpl-3.0
frontPage = do mainButton <- case ?member of Nothing -> return buyButton Just m -> do row <- $(queryTuple "SELECT page_no \ \FROM member_reader \ \INNER JOIN reader USING (reader_no) \ \WHERE short_name = 'para-bailar' AND lang = 'es' AND member_no = {memberNumber m}") ?db return $ case row of Nothing -> buyButton Just pageNo -> div ! class_ "button_buy" $ do a ! href (toValue $ "/reader/es/para-bailar/" ++ show (pageNo :: Int32)) ! class_ "gradient" ! title "Continue Reading" $ do span ! class_ "button_price" $ "Continue" span ! class_ "button_text" $ "Reading" stdPage ("Learn Spanish Through Fiction - Vocabulink") [] (do meta ! name "viewport" ! content "width=device-width, initial-scale=1.0, user-scalable=no" preEscapedToMarkup ("<link rel=\"stylesheet\" href=\"//s.vocabulink.com/css/off-the-shelf.css\" media=\"screen, projection\"> \ \<link href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css\" rel=\"stylesheet\">"::String)) $ do section ! id "banner" $ do div ! class_ "row" $ do div ! id "shelf" ! class_ "one_half" $ do img ! alt "book cover" ! width "331" ! height "497" ! src "//s.vocabulink.com/img/reader/es/para-bailar.jpg" div ! class_ "one_half last" $ do hgroup $ do h1 $ "Learn Spanish Through Fiction" h2 ! class_ "subheader" $ "Read real everyday Spanish. Learn new words in context. Designed for beginners, written for adults." p $ "Learning doesn't have to be boring. Stories have entertained and educated for centuries. This book is a collection of stories that will teach you some of the basics of Spanish." p $ "This isn't like any language reader you've seen before. We've designed it by mixing 4 modern accelerated language learning techniques." mainButton article $ do div ! id "main_content" $ do section ! id "features" $ do div ! class_ "row" $ do h2 ! class_ "section_title" $ do span $ "Accelerated Learning Features" ul $ do li ! class_ "one_half" $ do i ! class_ "icon-road icon-4x" $ mempty h4 "Gradual Progression" p "Have you ever tried reading Spanish but just go frustrated and gave up? Our stories start with very simple sentences. Then, gradually over time we introduce new words and new grammar." li ! class_ "one_half last" $ do i ! class_ "icon-magic icon-4x" $ mempty h4 "Linkword Mnemonics" p "Instead of staring at a list of vocabulary or writing words out 100 times, wouldn't it be nice to have a trick to remember each word by? We thought so too. That's why we've included mnemonics for each word we introduce you to." li ! class_ "one_half" $ do i ! class_ "icon-sort-by-attributes-alt icon-4x" $ mempty h4 "Words Selected by Frequency" p "Why waste time learning words you're rarely, if ever, going to use? We analyzed how frequently words occur in written and spoken Spanish and use only words among the most common 3,000." li ! class_ "one_half last" $ do i ! class_ "icon-bar-chart icon-4x" $ mempty h4 "Spaced Repetition" p "Flashcards are great, but we have better technology today. We use a special algorithm to schedule optimal times for you to review each word that you learn. This algorithm adapts to your memory and the difficulty of each word." where buyButton = div ! class_ "button_buy" $ do a ! href "/reader/es/para-bailar/1" ! class_ "gradient" ! title "Preview for Free" $ do span ! class_ "button_price" $ "Start" span ! class_ "button_text" $ "Reading"
4,302
frontPage = do mainButton <- case ?member of Nothing -> return buyButton Just m -> do row <- $(queryTuple "SELECT page_no \ \FROM member_reader \ \INNER JOIN reader USING (reader_no) \ \WHERE short_name = 'para-bailar' AND lang = 'es' AND member_no = {memberNumber m}") ?db return $ case row of Nothing -> buyButton Just pageNo -> div ! class_ "button_buy" $ do a ! href (toValue $ "/reader/es/para-bailar/" ++ show (pageNo :: Int32)) ! class_ "gradient" ! title "Continue Reading" $ do span ! class_ "button_price" $ "Continue" span ! class_ "button_text" $ "Reading" stdPage ("Learn Spanish Through Fiction - Vocabulink") [] (do meta ! name "viewport" ! content "width=device-width, initial-scale=1.0, user-scalable=no" preEscapedToMarkup ("<link rel=\"stylesheet\" href=\"//s.vocabulink.com/css/off-the-shelf.css\" media=\"screen, projection\"> \ \<link href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css\" rel=\"stylesheet\">"::String)) $ do section ! id "banner" $ do div ! class_ "row" $ do div ! id "shelf" ! class_ "one_half" $ do img ! alt "book cover" ! width "331" ! height "497" ! src "//s.vocabulink.com/img/reader/es/para-bailar.jpg" div ! class_ "one_half last" $ do hgroup $ do h1 $ "Learn Spanish Through Fiction" h2 ! class_ "subheader" $ "Read real everyday Spanish. Learn new words in context. Designed for beginners, written for adults." p $ "Learning doesn't have to be boring. Stories have entertained and educated for centuries. This book is a collection of stories that will teach you some of the basics of Spanish." p $ "This isn't like any language reader you've seen before. We've designed it by mixing 4 modern accelerated language learning techniques." mainButton article $ do div ! id "main_content" $ do section ! id "features" $ do div ! class_ "row" $ do h2 ! class_ "section_title" $ do span $ "Accelerated Learning Features" ul $ do li ! class_ "one_half" $ do i ! class_ "icon-road icon-4x" $ mempty h4 "Gradual Progression" p "Have you ever tried reading Spanish but just go frustrated and gave up? Our stories start with very simple sentences. Then, gradually over time we introduce new words and new grammar." li ! class_ "one_half last" $ do i ! class_ "icon-magic icon-4x" $ mempty h4 "Linkword Mnemonics" p "Instead of staring at a list of vocabulary or writing words out 100 times, wouldn't it be nice to have a trick to remember each word by? We thought so too. That's why we've included mnemonics for each word we introduce you to." li ! class_ "one_half" $ do i ! class_ "icon-sort-by-attributes-alt icon-4x" $ mempty h4 "Words Selected by Frequency" p "Why waste time learning words you're rarely, if ever, going to use? We analyzed how frequently words occur in written and spoken Spanish and use only words among the most common 3,000." li ! class_ "one_half last" $ do i ! class_ "icon-bar-chart icon-4x" $ mempty h4 "Spaced Repetition" p "Flashcards are great, but we have better technology today. We use a special algorithm to schedule optimal times for you to review each word that you learn. This algorithm adapts to your memory and the difficulty of each word." where buyButton = div ! class_ "button_buy" $ do a ! href "/reader/es/para-bailar/1" ! class_ "gradient" ! title "Preview for Free" $ do span ! class_ "button_price" $ "Start" span ! class_ "button_text" $ "Reading"
4,302
frontPage = do mainButton <- case ?member of Nothing -> return buyButton Just m -> do row <- $(queryTuple "SELECT page_no \ \FROM member_reader \ \INNER JOIN reader USING (reader_no) \ \WHERE short_name = 'para-bailar' AND lang = 'es' AND member_no = {memberNumber m}") ?db return $ case row of Nothing -> buyButton Just pageNo -> div ! class_ "button_buy" $ do a ! href (toValue $ "/reader/es/para-bailar/" ++ show (pageNo :: Int32)) ! class_ "gradient" ! title "Continue Reading" $ do span ! class_ "button_price" $ "Continue" span ! class_ "button_text" $ "Reading" stdPage ("Learn Spanish Through Fiction - Vocabulink") [] (do meta ! name "viewport" ! content "width=device-width, initial-scale=1.0, user-scalable=no" preEscapedToMarkup ("<link rel=\"stylesheet\" href=\"//s.vocabulink.com/css/off-the-shelf.css\" media=\"screen, projection\"> \ \<link href=\"//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css\" rel=\"stylesheet\">"::String)) $ do section ! id "banner" $ do div ! class_ "row" $ do div ! id "shelf" ! class_ "one_half" $ do img ! alt "book cover" ! width "331" ! height "497" ! src "//s.vocabulink.com/img/reader/es/para-bailar.jpg" div ! class_ "one_half last" $ do hgroup $ do h1 $ "Learn Spanish Through Fiction" h2 ! class_ "subheader" $ "Read real everyday Spanish. Learn new words in context. Designed for beginners, written for adults." p $ "Learning doesn't have to be boring. Stories have entertained and educated for centuries. This book is a collection of stories that will teach you some of the basics of Spanish." p $ "This isn't like any language reader you've seen before. We've designed it by mixing 4 modern accelerated language learning techniques." mainButton article $ do div ! id "main_content" $ do section ! id "features" $ do div ! class_ "row" $ do h2 ! class_ "section_title" $ do span $ "Accelerated Learning Features" ul $ do li ! class_ "one_half" $ do i ! class_ "icon-road icon-4x" $ mempty h4 "Gradual Progression" p "Have you ever tried reading Spanish but just go frustrated and gave up? Our stories start with very simple sentences. Then, gradually over time we introduce new words and new grammar." li ! class_ "one_half last" $ do i ! class_ "icon-magic icon-4x" $ mempty h4 "Linkword Mnemonics" p "Instead of staring at a list of vocabulary or writing words out 100 times, wouldn't it be nice to have a trick to remember each word by? We thought so too. That's why we've included mnemonics for each word we introduce you to." li ! class_ "one_half" $ do i ! class_ "icon-sort-by-attributes-alt icon-4x" $ mempty h4 "Words Selected by Frequency" p "Why waste time learning words you're rarely, if ever, going to use? We analyzed how frequently words occur in written and spoken Spanish and use only words among the most common 3,000." li ! class_ "one_half last" $ do i ! class_ "icon-bar-chart icon-4x" $ mempty h4 "Spaced Repetition" p "Flashcards are great, but we have better technology today. We use a special algorithm to schedule optimal times for you to review each word that you learn. This algorithm adapts to your memory and the difficulty of each word." where buyButton = div ! class_ "button_buy" $ do a ! href "/reader/es/para-bailar/1" ! class_ "gradient" ! title "Preview for Free" $ do span ! class_ "button_price" $ "Start" span ! class_ "button_text" $ "Reading"
4,302
false
false
0
39
1,483
668
288
380
null
null
alios/geojson-types
src/Data/GeoJSON/Geometries.hs
bsd-3-clause
_LineStringObject :: (VectorStructureClass fv fc a) => Prism' (GeometryStructure LineString a fv fc) (GeometryObject a) _LineStringObject = _LineString . iso GeometryLineString (\(GeometryLineString a) -> a)
211
_LineStringObject :: (VectorStructureClass fv fc a) => Prism' (GeometryStructure LineString a fv fc) (GeometryObject a) _LineStringObject = _LineString . iso GeometryLineString (\(GeometryLineString a) -> a)
211
_LineStringObject = _LineString . iso GeometryLineString (\(GeometryLineString a) -> a)
89
false
true
0
10
28
70
36
34
null
null
kojiromike/Idris-dev
src/Idris/Docstrings.hs
bsd-3-clause
-- | Check whether a docstring is emtpy nullDocstring :: Docstring a -> Bool nullDocstring (DocString _ blocks) = S.null blocks
127
nullDocstring :: Docstring a -> Bool nullDocstring (DocString _ blocks) = S.null blocks
87
nullDocstring (DocString _ blocks) = S.null blocks
50
true
true
0
7
20
35
17
18
null
null
markuspf/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
bcc i (UPDATE l r) = indent i ++ creg l ++ " = " ++ creg r ++ ";\n"
67
bcc i (UPDATE l r) = indent i ++ creg l ++ " = " ++ creg r ++ ";\n"
67
bcc i (UPDATE l r) = indent i ++ creg l ++ " = " ++ creg r ++ ";\n"
67
false
false
0
9
19
46
20
26
null
null
urbit/archaeology2
outside/commonmark/specfilter.hs
mit
anchors x = x
13
anchors x = x
13
anchors x = x
13
false
false
0
5
3
9
4
5
null
null
olsner/ghc
ghc/Main.hs
bsd-3-clause
-- ghc --frontend Plugin.Module doMkDependHSMode, doMakeMode, doInteractiveMode, doAbiHashMode, showPackagesMode :: Mode doMkDependHSMode = mkPostLoadMode DoMkDependHS
170
doMkDependHSMode, doMakeMode, doInteractiveMode, doAbiHashMode, showPackagesMode :: Mode doMkDependHSMode = mkPostLoadMode DoMkDependHS
137
doMkDependHSMode = mkPostLoadMode DoMkDependHS
46
true
true
0
5
17
23
16
7
null
null
exclipy/pdata
Data/BitUtil.hs
bsd-3-clause
bitCount8 24 = 2
16
bitCount8 24 = 2
16
bitCount8 24 = 2
16
false
false
0
5
3
9
4
5
null
null
ksaveljev/hake-2
src/Game/Monsters/MBoss31.hs
bsd-3-clause
frameWalk05 :: Int frameWalk05 = 167
36
frameWalk05 :: Int frameWalk05 = 167
36
frameWalk05 = 167
17
false
true
0
4
5
11
6
5
null
null
djeik/fuckdown2
src/Pretty.hs
mit
pretty_ :: Free FuckDSL a -> String pretty_ = pretty (const "")
63
pretty_ :: Free FuckDSL a -> String pretty_ = pretty (const "")
63
pretty_ = pretty (const "")
27
false
true
0
7
11
29
14
15
null
null
PipocaQuemada/ermine
src/Ermine/Loader/Core.hs
bsd-2-clause
-- | Lift a cache key isomorphism. xmapCacheKey :: Functor m => AnIso' e e2 -> Iso' (Loader e m a b) (Loader e2 m a b) xmapCacheKey i = withIso i $ \t f -> iso (xf t f) (xf f t) where xf t f (Loader l r) = Loader (l & mapped.mapped._1 %~ t) (r & fmap (over argument f . over (mapped.mapped.mapped._1) t)) -- | A loader without reloadability. This is the simplest way to make -- a loader.
462
xmapCacheKey :: Functor m => AnIso' e e2 -> Iso' (Loader e m a b) (Loader e2 m a b) xmapCacheKey i = withIso i $ \t f -> iso (xf t f) (xf f t) where xf t f (Loader l r) = Loader (l & mapped.mapped._1 %~ t) (r & fmap (over argument f . over (mapped.mapped.mapped._1) t)) -- | A loader without reloadability. This is the simplest way to make -- a loader.
427
xmapCacheKey i = withIso i $ \t f -> iso (xf t f) (xf f t) where xf t f (Loader l r) = Loader (l & mapped.mapped._1 %~ t) (r & fmap (over argument f . over (mapped.mapped.mapped._1) t)) -- | A loader without reloadability. This is the simplest way to make -- a loader.
327
true
true
0
15
157
175
87
88
null
null
jparyani/capnproto-boostpython
compiler/src/Parser.hs
bsd-2-clause
tokenErrorString ConstKeyword = "keyword \"const\""
51
tokenErrorString ConstKeyword = "keyword \"const\""
51
tokenErrorString ConstKeyword = "keyword \"const\""
51
false
false
0
5
4
9
4
5
null
null
elliottt/pddl
src/Text/PDDL/Parse.hs
bsd-3-clause
runParser :: Parser a -> Either ParseError a runParser m = runM (unParser m) NoLoc
82
runParser :: Parser a -> Either ParseError a runParser m = runM (unParser m) NoLoc
82
runParser m = runM (unParser m) NoLoc
37
false
true
0
7
14
43
18
25
null
null
alphaHeavy/cabal
cabal-install/Distribution/Client/Dependency/Modular/Explore.hs
bsd-3-clause
exploreTree :: Alternative m => Tree a -> m (Assignment, RevDepMap) exploreTree t = explore t (A M.empty M.empty M.empty)
121
exploreTree :: Alternative m => Tree a -> m (Assignment, RevDepMap) exploreTree t = explore t (A M.empty M.empty M.empty)
121
exploreTree t = explore t (A M.empty M.empty M.empty)
53
false
true
0
8
19
58
28
30
null
null
haskell/haddock
haddock-api/src/Haddock.hs
bsd-2-clause
render :: Logger -> DynFlags -> UnitState -> [Flag] -> SinceQual -> QualOption -> [Interface] -> [(FilePath, InstalledInterface)] -> Map Module FilePath -> IO () render logger dflags unit_state flags sinceQual qual ifaces installedIfaces extSrcMap = do let title = fromMaybe "" (optTitle flags) unicode = Flag_UseUnicode `elem` flags pretty = Flag_PrettyHtml `elem` flags opt_wiki_urls = wikiUrls flags opt_base_url = baseUrl flags opt_contents_url = optContentsUrl flags opt_index_url = optIndexUrl flags odir = outputDir flags opt_latex_style = optLaTeXStyle flags opt_source_css = optSourceCssFile flags opt_mathjax = optMathjax flags dflags' | unicode = gopt_set dflags Opt_PrintUnicodeSyntax | otherwise = dflags visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ] -- /All/ visible interfaces including external package modules. allIfaces = map toInstalledIface ifaces ++ map snd installedIfaces allVisibleIfaces = [ i | i <- allIfaces, OptHide `notElem` instOptions i ] pkgMod = fmap ifaceMod (listToMaybe ifaces) pkgKey = fmap moduleUnit pkgMod pkgStr = fmap unitString pkgKey pkgNameVer = modulePackageInfo unit_state flags pkgMod pkgName = fmap (unpackFS . (\(PackageName n) -> n)) (fst pkgNameVer) sincePkg = case sinceQual of External -> pkgName Always -> Nothing (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcModule' | Flag_HyperlinkedSource `elem` flags = Just hypSrcModuleUrlFormat | otherwise = srcModule srcMap = Map.union (Map.map SrcExternal extSrcMap) (Map.fromList [ (ifaceMod iface, SrcLocal) | iface <- ifaces ]) pkgSrcMap = Map.mapKeys moduleUnit extSrcMap pkgSrcMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey = Map.insert k hypSrcModuleNameUrlFormat pkgSrcMap | Just srcNameUrl <- srcEntity , Just k <- pkgKey = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey = Map.singleton k hypSrcModuleLineUrlFormat | Just path <- srcLEntity , Just k <- pkgKey = Map.singleton k path | otherwise = Map.empty sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') installedMap :: Map Module InstalledInterface installedMap = Map.fromList [ (unwire (instMod iface), iface) | (_, iface) <- installedIfaces ] -- The user gives use base-4.9.0.0, but the InstalledInterface -- records the *wired in* identity base. So untranslate it -- so that we can service the request. unwire :: Module -> Module unwire m = m { moduleUnit = unwireUnit unit_state (moduleUnit m) } reexportedIfaces <- concat `fmap` (for (reexportFlags flags) $ \mod_str -> do let warn = hPutStrLn stderr . ("Warning: " ++) case readP_to_S parseHoleyModule mod_str of [(m, "")] | Just iface <- Map.lookup m installedMap -> return [iface] | otherwise -> warn ("Cannot find reexported module '" ++ mod_str ++ "'") >> return [] _ -> warn ("Cannot parse reexported module flag '" ++ mod_str ++ "'") >> return []) libDir <- getHaddockLibDir flags prologue <- getPrologue dflags' flags themes <- getThemes libDir flags >>= either bye return let withQuickjump = Flag_QuickJumpIndex `elem` flags withBaseURL = isJust . find (\flag -> case flag of Flag_BaseURL base_url -> base_url /= "." && base_url /= "./" _ -> False ) $ flags when (Flag_GenIndex `elem` flags) $ do withTiming logger dflags' "ppHtmlIndex" (const ()) $ do _ <- {-# SCC ppHtmlIndex #-} ppHtmlIndex odir title pkgStr themes opt_mathjax opt_contents_url sourceUrls' opt_wiki_urls allVisibleIfaces pretty return () unless withBaseURL $ copyHtmlBits odir libDir themes withQuickjump when (Flag_GenContents `elem` flags) $ do withTiming logger dflags' "ppHtmlContents" (const ()) $ do _ <- {-# SCC ppHtmlContents #-} ppHtmlContents unit_state odir title pkgStr themes opt_mathjax opt_index_url sourceUrls' opt_wiki_urls allVisibleIfaces True prologue pretty sincePkg (makeContentsQual qual) return () copyHtmlBits odir libDir themes withQuickjump when withQuickjump $ void $ ppJsonIndex odir sourceUrls' opt_wiki_urls unicode Nothing qual ifaces (nub $ map fst installedIfaces) when (Flag_Html `elem` flags) $ do withTiming logger dflags' "ppHtml" (const ()) $ do _ <- {-# SCC ppHtml #-} ppHtml unit_state title pkgStr visibleIfaces reexportedIfaces odir prologue themes opt_mathjax sourceUrls' opt_wiki_urls opt_base_url opt_contents_url opt_index_url unicode sincePkg qual pretty withQuickjump return () unless withBaseURL $ do copyHtmlBits odir libDir themes withQuickjump writeHaddockMeta odir withQuickjump -- TODO: we throw away Meta for both Hoogle and LaTeX right now, -- might want to fix that if/when these two get some work on them when (Flag_Hoogle `elem` flags) $ do case pkgNameVer of (Just (PackageName pkgNameFS), mpkgVer) -> let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] = title | otherwise = unpackFS pkgNameFS pkgVer = fromMaybe (makeVersion []) mpkgVer in ppHoogle dflags' unit_state pkgNameStr pkgVer title (fmap _doc prologue) visibleIfaces odir _ -> putStrLn . unlines $ [ "haddock: Unable to find a package providing module " ++ maybe "<no-mod>" (moduleNameString . moduleName) pkgMod ++ ", skipping Hoogle." , "" , " Perhaps try specifying the desired package explicitly" ++ " using the --package-name" , " and --package-version arguments." ] when (Flag_LaTeX `elem` flags) $ do withTiming logger dflags' "ppLatex" (const ()) $ do _ <- {-# SCC ppLatex #-} ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir return () when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger dflags' "ppHyperlinkedSource" (const ()) $ do _ <- {-# SCC ppHyperlinkedSource #-} ppHyperlinkedSource (verbosity flags) odir libDir opt_source_css pretty srcMap ifaces return () ------------------------------------------------------------------------------- -- * Reading and dumping interface files -------------------------------------------------------------------------------
7,452
render :: Logger -> DynFlags -> UnitState -> [Flag] -> SinceQual -> QualOption -> [Interface] -> [(FilePath, InstalledInterface)] -> Map Module FilePath -> IO () render logger dflags unit_state flags sinceQual qual ifaces installedIfaces extSrcMap = do let title = fromMaybe "" (optTitle flags) unicode = Flag_UseUnicode `elem` flags pretty = Flag_PrettyHtml `elem` flags opt_wiki_urls = wikiUrls flags opt_base_url = baseUrl flags opt_contents_url = optContentsUrl flags opt_index_url = optIndexUrl flags odir = outputDir flags opt_latex_style = optLaTeXStyle flags opt_source_css = optSourceCssFile flags opt_mathjax = optMathjax flags dflags' | unicode = gopt_set dflags Opt_PrintUnicodeSyntax | otherwise = dflags visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ] -- /All/ visible interfaces including external package modules. allIfaces = map toInstalledIface ifaces ++ map snd installedIfaces allVisibleIfaces = [ i | i <- allIfaces, OptHide `notElem` instOptions i ] pkgMod = fmap ifaceMod (listToMaybe ifaces) pkgKey = fmap moduleUnit pkgMod pkgStr = fmap unitString pkgKey pkgNameVer = modulePackageInfo unit_state flags pkgMod pkgName = fmap (unpackFS . (\(PackageName n) -> n)) (fst pkgNameVer) sincePkg = case sinceQual of External -> pkgName Always -> Nothing (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcModule' | Flag_HyperlinkedSource `elem` flags = Just hypSrcModuleUrlFormat | otherwise = srcModule srcMap = Map.union (Map.map SrcExternal extSrcMap) (Map.fromList [ (ifaceMod iface, SrcLocal) | iface <- ifaces ]) pkgSrcMap = Map.mapKeys moduleUnit extSrcMap pkgSrcMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey = Map.insert k hypSrcModuleNameUrlFormat pkgSrcMap | Just srcNameUrl <- srcEntity , Just k <- pkgKey = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey = Map.singleton k hypSrcModuleLineUrlFormat | Just path <- srcLEntity , Just k <- pkgKey = Map.singleton k path | otherwise = Map.empty sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') installedMap :: Map Module InstalledInterface installedMap = Map.fromList [ (unwire (instMod iface), iface) | (_, iface) <- installedIfaces ] -- The user gives use base-4.9.0.0, but the InstalledInterface -- records the *wired in* identity base. So untranslate it -- so that we can service the request. unwire :: Module -> Module unwire m = m { moduleUnit = unwireUnit unit_state (moduleUnit m) } reexportedIfaces <- concat `fmap` (for (reexportFlags flags) $ \mod_str -> do let warn = hPutStrLn stderr . ("Warning: " ++) case readP_to_S parseHoleyModule mod_str of [(m, "")] | Just iface <- Map.lookup m installedMap -> return [iface] | otherwise -> warn ("Cannot find reexported module '" ++ mod_str ++ "'") >> return [] _ -> warn ("Cannot parse reexported module flag '" ++ mod_str ++ "'") >> return []) libDir <- getHaddockLibDir flags prologue <- getPrologue dflags' flags themes <- getThemes libDir flags >>= either bye return let withQuickjump = Flag_QuickJumpIndex `elem` flags withBaseURL = isJust . find (\flag -> case flag of Flag_BaseURL base_url -> base_url /= "." && base_url /= "./" _ -> False ) $ flags when (Flag_GenIndex `elem` flags) $ do withTiming logger dflags' "ppHtmlIndex" (const ()) $ do _ <- {-# SCC ppHtmlIndex #-} ppHtmlIndex odir title pkgStr themes opt_mathjax opt_contents_url sourceUrls' opt_wiki_urls allVisibleIfaces pretty return () unless withBaseURL $ copyHtmlBits odir libDir themes withQuickjump when (Flag_GenContents `elem` flags) $ do withTiming logger dflags' "ppHtmlContents" (const ()) $ do _ <- {-# SCC ppHtmlContents #-} ppHtmlContents unit_state odir title pkgStr themes opt_mathjax opt_index_url sourceUrls' opt_wiki_urls allVisibleIfaces True prologue pretty sincePkg (makeContentsQual qual) return () copyHtmlBits odir libDir themes withQuickjump when withQuickjump $ void $ ppJsonIndex odir sourceUrls' opt_wiki_urls unicode Nothing qual ifaces (nub $ map fst installedIfaces) when (Flag_Html `elem` flags) $ do withTiming logger dflags' "ppHtml" (const ()) $ do _ <- {-# SCC ppHtml #-} ppHtml unit_state title pkgStr visibleIfaces reexportedIfaces odir prologue themes opt_mathjax sourceUrls' opt_wiki_urls opt_base_url opt_contents_url opt_index_url unicode sincePkg qual pretty withQuickjump return () unless withBaseURL $ do copyHtmlBits odir libDir themes withQuickjump writeHaddockMeta odir withQuickjump -- TODO: we throw away Meta for both Hoogle and LaTeX right now, -- might want to fix that if/when these two get some work on them when (Flag_Hoogle `elem` flags) $ do case pkgNameVer of (Just (PackageName pkgNameFS), mpkgVer) -> let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] = title | otherwise = unpackFS pkgNameFS pkgVer = fromMaybe (makeVersion []) mpkgVer in ppHoogle dflags' unit_state pkgNameStr pkgVer title (fmap _doc prologue) visibleIfaces odir _ -> putStrLn . unlines $ [ "haddock: Unable to find a package providing module " ++ maybe "<no-mod>" (moduleNameString . moduleName) pkgMod ++ ", skipping Hoogle." , "" , " Perhaps try specifying the desired package explicitly" ++ " using the --package-name" , " and --package-version arguments." ] when (Flag_LaTeX `elem` flags) $ do withTiming logger dflags' "ppLatex" (const ()) $ do _ <- {-# SCC ppLatex #-} ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir return () when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger dflags' "ppHyperlinkedSource" (const ()) $ do _ <- {-# SCC ppHyperlinkedSource #-} ppHyperlinkedSource (verbosity flags) odir libDir opt_source_css pretty srcMap ifaces return () ------------------------------------------------------------------------------- -- * Reading and dumping interface files -------------------------------------------------------------------------------
7,452
render logger dflags unit_state flags sinceQual qual ifaces installedIfaces extSrcMap = do let title = fromMaybe "" (optTitle flags) unicode = Flag_UseUnicode `elem` flags pretty = Flag_PrettyHtml `elem` flags opt_wiki_urls = wikiUrls flags opt_base_url = baseUrl flags opt_contents_url = optContentsUrl flags opt_index_url = optIndexUrl flags odir = outputDir flags opt_latex_style = optLaTeXStyle flags opt_source_css = optSourceCssFile flags opt_mathjax = optMathjax flags dflags' | unicode = gopt_set dflags Opt_PrintUnicodeSyntax | otherwise = dflags visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ] -- /All/ visible interfaces including external package modules. allIfaces = map toInstalledIface ifaces ++ map snd installedIfaces allVisibleIfaces = [ i | i <- allIfaces, OptHide `notElem` instOptions i ] pkgMod = fmap ifaceMod (listToMaybe ifaces) pkgKey = fmap moduleUnit pkgMod pkgStr = fmap unitString pkgKey pkgNameVer = modulePackageInfo unit_state flags pkgMod pkgName = fmap (unpackFS . (\(PackageName n) -> n)) (fst pkgNameVer) sincePkg = case sinceQual of External -> pkgName Always -> Nothing (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcModule' | Flag_HyperlinkedSource `elem` flags = Just hypSrcModuleUrlFormat | otherwise = srcModule srcMap = Map.union (Map.map SrcExternal extSrcMap) (Map.fromList [ (ifaceMod iface, SrcLocal) | iface <- ifaces ]) pkgSrcMap = Map.mapKeys moduleUnit extSrcMap pkgSrcMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey = Map.insert k hypSrcModuleNameUrlFormat pkgSrcMap | Just srcNameUrl <- srcEntity , Just k <- pkgKey = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey = Map.singleton k hypSrcModuleLineUrlFormat | Just path <- srcLEntity , Just k <- pkgKey = Map.singleton k path | otherwise = Map.empty sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') installedMap :: Map Module InstalledInterface installedMap = Map.fromList [ (unwire (instMod iface), iface) | (_, iface) <- installedIfaces ] -- The user gives use base-4.9.0.0, but the InstalledInterface -- records the *wired in* identity base. So untranslate it -- so that we can service the request. unwire :: Module -> Module unwire m = m { moduleUnit = unwireUnit unit_state (moduleUnit m) } reexportedIfaces <- concat `fmap` (for (reexportFlags flags) $ \mod_str -> do let warn = hPutStrLn stderr . ("Warning: " ++) case readP_to_S parseHoleyModule mod_str of [(m, "")] | Just iface <- Map.lookup m installedMap -> return [iface] | otherwise -> warn ("Cannot find reexported module '" ++ mod_str ++ "'") >> return [] _ -> warn ("Cannot parse reexported module flag '" ++ mod_str ++ "'") >> return []) libDir <- getHaddockLibDir flags prologue <- getPrologue dflags' flags themes <- getThemes libDir flags >>= either bye return let withQuickjump = Flag_QuickJumpIndex `elem` flags withBaseURL = isJust . find (\flag -> case flag of Flag_BaseURL base_url -> base_url /= "." && base_url /= "./" _ -> False ) $ flags when (Flag_GenIndex `elem` flags) $ do withTiming logger dflags' "ppHtmlIndex" (const ()) $ do _ <- {-# SCC ppHtmlIndex #-} ppHtmlIndex odir title pkgStr themes opt_mathjax opt_contents_url sourceUrls' opt_wiki_urls allVisibleIfaces pretty return () unless withBaseURL $ copyHtmlBits odir libDir themes withQuickjump when (Flag_GenContents `elem` flags) $ do withTiming logger dflags' "ppHtmlContents" (const ()) $ do _ <- {-# SCC ppHtmlContents #-} ppHtmlContents unit_state odir title pkgStr themes opt_mathjax opt_index_url sourceUrls' opt_wiki_urls allVisibleIfaces True prologue pretty sincePkg (makeContentsQual qual) return () copyHtmlBits odir libDir themes withQuickjump when withQuickjump $ void $ ppJsonIndex odir sourceUrls' opt_wiki_urls unicode Nothing qual ifaces (nub $ map fst installedIfaces) when (Flag_Html `elem` flags) $ do withTiming logger dflags' "ppHtml" (const ()) $ do _ <- {-# SCC ppHtml #-} ppHtml unit_state title pkgStr visibleIfaces reexportedIfaces odir prologue themes opt_mathjax sourceUrls' opt_wiki_urls opt_base_url opt_contents_url opt_index_url unicode sincePkg qual pretty withQuickjump return () unless withBaseURL $ do copyHtmlBits odir libDir themes withQuickjump writeHaddockMeta odir withQuickjump -- TODO: we throw away Meta for both Hoogle and LaTeX right now, -- might want to fix that if/when these two get some work on them when (Flag_Hoogle `elem` flags) $ do case pkgNameVer of (Just (PackageName pkgNameFS), mpkgVer) -> let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] = title | otherwise = unpackFS pkgNameFS pkgVer = fromMaybe (makeVersion []) mpkgVer in ppHoogle dflags' unit_state pkgNameStr pkgVer title (fmap _doc prologue) visibleIfaces odir _ -> putStrLn . unlines $ [ "haddock: Unable to find a package providing module " ++ maybe "<no-mod>" (moduleNameString . moduleName) pkgMod ++ ", skipping Hoogle." , "" , " Perhaps try specifying the desired package explicitly" ++ " using the --package-name" , " and --package-version arguments." ] when (Flag_LaTeX `elem` flags) $ do withTiming logger dflags' "ppLatex" (const ()) $ do _ <- {-# SCC ppLatex #-} ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir return () when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger dflags' "ppHyperlinkedSource" (const ()) $ do _ <- {-# SCC ppHyperlinkedSource #-} ppHyperlinkedSource (verbosity flags) odir libDir opt_source_css pretty srcMap ifaces return () ------------------------------------------------------------------------------- -- * Reading and dumping interface files -------------------------------------------------------------------------------
7,283
false
true
0
23
2,319
1,821
899
922
null
null
kawu/concraft
src/NLP/Concraft/DAG2.hs
bsd-2-clause
---------------------- -- Best path ---------------------- -- | Find all optimal paths in the given annotation. Optimal paths are those -- which go through tags with the assigned probability 1. findOptimalPaths :: Anno t Double -> [[(EdgeID, t)]] findOptimalPaths dag = do edgeID <- DAG.dagEdges dag guard $ DAG.isInitialEdge edgeID dag doit edgeID where doit i = inside i ++ final i inside i = do (tagx, weight) <- M.toList (DAG.edgeLabel i dag) guard $ weight >= 1.0 - eps j <- DAG.nextEdges i dag xs <- doit j return $ (i, tagx) : xs final i = do guard $ DAG.isFinalEdge i dag (tagx, weight) <- M.toList (DAG.edgeLabel i dag) guard $ weight >= 1.0 - eps return [(i, tagx)] eps = 1.0e-9 -- | Make the given path with disamb markers in the given annotation -- and produce a new disamb annotation.
879
findOptimalPaths :: Anno t Double -> [[(EdgeID, t)]] findOptimalPaths dag = do edgeID <- DAG.dagEdges dag guard $ DAG.isInitialEdge edgeID dag doit edgeID where doit i = inside i ++ final i inside i = do (tagx, weight) <- M.toList (DAG.edgeLabel i dag) guard $ weight >= 1.0 - eps j <- DAG.nextEdges i dag xs <- doit j return $ (i, tagx) : xs final i = do guard $ DAG.isFinalEdge i dag (tagx, weight) <- M.toList (DAG.edgeLabel i dag) guard $ weight >= 1.0 - eps return [(i, tagx)] eps = 1.0e-9 -- | Make the given path with disamb markers in the given annotation -- and produce a new disamb annotation.
683
findOptimalPaths dag = do edgeID <- DAG.dagEdges dag guard $ DAG.isInitialEdge edgeID dag doit edgeID where doit i = inside i ++ final i inside i = do (tagx, weight) <- M.toList (DAG.edgeLabel i dag) guard $ weight >= 1.0 - eps j <- DAG.nextEdges i dag xs <- doit j return $ (i, tagx) : xs final i = do guard $ DAG.isFinalEdge i dag (tagx, weight) <- M.toList (DAG.edgeLabel i dag) guard $ weight >= 1.0 - eps return [(i, tagx)] eps = 1.0e-9 -- | Make the given path with disamb markers in the given annotation -- and produce a new disamb annotation.
630
true
true
0
11
224
272
134
138
null
null
kahless/netm
src/WPA/Start/Main.hs
mit
terminateBy :: PHANDLE -> [Signal] -> IO () terminateBy pid = mapM_ $ \ sig -> installHandler sig handler Nothing where handler = Catch (signalProcess sigTERM pid)
166
terminateBy :: PHANDLE -> [Signal] -> IO () terminateBy pid = mapM_ $ \ sig -> installHandler sig handler Nothing where handler = Catch (signalProcess sigTERM pid)
166
terminateBy pid = mapM_ $ \ sig -> installHandler sig handler Nothing where handler = Catch (signalProcess sigTERM pid)
122
false
true
0
8
29
65
32
33
null
null
Helkafen/haddock
haddock-api/src/Haddock/Backends/LaTeX.hs
bsd-2-clause
ppBang _ = empty
40
ppBang _ = empty
40
ppBang _ = empty
40
false
false
0
5
27
9
4
5
null
null
martomi/AI-Reversi
Reversi_AI.hs
mit
right = (1, 0) :: Direction
32
right = (1, 0) :: Direction
32
right = (1, 0) :: Direction
32
false
false
1
5
10
16
9
7
null
null
Zoetermeer/latro
src/Latro/Reorder.hs
mit
rewriteInfix eImp@(ExpImport _ _) = eImp
40
rewriteInfix eImp@(ExpImport _ _) = eImp
40
rewriteInfix eImp@(ExpImport _ _) = eImp
40
false
false
0
8
5
20
10
10
null
null
bjpop/lfg
test/uniform.hs
bsd-3-clause
main :: IO () main = do putStrLn "100000 vals and 1000 bins" let v1 = fill 10000 100 (head LFG.generators) checkChi2 0.05 v1 checkChi2 0.01 v1 putStrLn ""
164
main :: IO () main = do putStrLn "100000 vals and 1000 bins" let v1 = fill 10000 100 (head LFG.generators) checkChi2 0.05 v1 checkChi2 0.01 v1 putStrLn ""
164
main = do putStrLn "100000 vals and 1000 bins" let v1 = fill 10000 100 (head LFG.generators) checkChi2 0.05 v1 checkChi2 0.01 v1 putStrLn ""
150
false
true
0
13
38
68
29
39
null
null
haraldsteinlechner/lambdaWolf
src/Bench.hs
gpl-3.0
mkGeometries n = replicateM n mkRandomGeometry
46
mkGeometries n = replicateM n mkRandomGeometry
46
mkGeometries n = replicateM n mkRandomGeometry
46
false
false
1
5
5
18
6
12
null
null
isomorphism/webgl
src/Graphics/Rendering/WebGL/Constants.hs
mit
gl_SAMPLER_1D_SHADOW :: GLenum gl_SAMPLER_1D_SHADOW = 0x8B61
60
gl_SAMPLER_1D_SHADOW :: GLenum gl_SAMPLER_1D_SHADOW = 0x8B61
60
gl_SAMPLER_1D_SHADOW = 0x8B61
29
false
true
0
4
5
11
6
5
null
null
mettekou/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
-- Interesting: polymorphic recursion would help here. -- We can't use (mkListTy alphaTy) in the defn of consDataCon, else mkListTy -- gets the over-specific type (Type -> Type) -- Wired-in type Maybe maybeTyCon :: TyCon maybeTyCon = pcTyCon False maybeTyConName Nothing alpha_tyvar [nothingDataCon, justDataCon]
335
maybeTyCon :: TyCon maybeTyCon = pcTyCon False maybeTyConName Nothing alpha_tyvar [nothingDataCon, justDataCon]
132
maybeTyCon = pcTyCon False maybeTyConName Nothing alpha_tyvar [nothingDataCon, justDataCon]
112
true
true
0
6
66
32
19
13
null
null
mmisamore/directed-cubical
Examples/bigCube.hs
bsd-3-clause
cx = vsCmplx $ vsCoordsUnsafe (replicate 5 1) (replicate 5 6)
61
cx = vsCmplx $ vsCoordsUnsafe (replicate 5 1) (replicate 5 6)
61
cx = vsCmplx $ vsCoordsUnsafe (replicate 5 1) (replicate 5 6)
61
false
false
3
7
10
35
15
20
null
null
daherb/Haskell-Muste
ajax-backend/Database.hs
artistic-2.0
addUser :: Connection -> String -> String -> Int -> IO () addUser conn user pass enabled = do -- Create a salted password salt <- createSalt let safePw = hashPasswd (B.pack pass) salt -- Remove user if they already exists let deleteQuery = "DELETE FROM User WHERE Username = ?;" :: Query execute conn deleteQuery [user] -- Add new user let insertQuery = "INSERT INTO User (Username, Password, Salt, Enabled) VALUES (?,?,?,?);" :: Query execute conn insertQuery (user,safePw,salt,enabled)
525
addUser :: Connection -> String -> String -> Int -> IO () addUser conn user pass enabled = do -- Create a salted password salt <- createSalt let safePw = hashPasswd (B.pack pass) salt -- Remove user if they already exists let deleteQuery = "DELETE FROM User WHERE Username = ?;" :: Query execute conn deleteQuery [user] -- Add new user let insertQuery = "INSERT INTO User (Username, Password, Salt, Enabled) VALUES (?,?,?,?);" :: Query execute conn insertQuery (user,safePw,salt,enabled)
525
addUser conn user pass enabled = do -- Create a salted password salt <- createSalt let safePw = hashPasswd (B.pack pass) salt -- Remove user if they already exists let deleteQuery = "DELETE FROM User WHERE Username = ?;" :: Query execute conn deleteQuery [user] -- Add new user let insertQuery = "INSERT INTO User (Username, Password, Salt, Enabled) VALUES (?,?,?,?);" :: Query execute conn insertQuery (user,safePw,salt,enabled)
467
false
true
0
14
116
137
67
70
null
null
sdiehl/ghc
testsuite/tests/typecheck/should_run/tcrun041.hs
bsd-3-clause
g = (# , True || False #)
25
g = (# , True || False #)
25
g = (# , True || False #)
25
false
false
1
7
7
17
7
10
null
null
michalkonecny/aern
aern-real/src/Numeric/AERN/RealArithmetic/NumericOrderRounding/MixedFieldOps.hs
bsd-3-clause
mixedAddDn :: (RoundedMixedAdd t tn) => t -> tn -> t mixedAddDn a b = mixedAddDnEff (mixedAddDefaultEffort a b) a b
115
mixedAddDn :: (RoundedMixedAdd t tn) => t -> tn -> t mixedAddDn a b = mixedAddDnEff (mixedAddDefaultEffort a b) a b
115
mixedAddDn a b = mixedAddDnEff (mixedAddDefaultEffort a b) a b
62
false
true
0
7
20
50
25
25
null
null
ghc-android/cabal
Cabal/Distribution/Simple/Utils.hs
bsd-3-clause
currentDir :: FilePath currentDir = "."
39
currentDir :: FilePath currentDir = "."
39
currentDir = "."
16
false
true
0
4
5
11
6
5
null
null
sinelaw/infernu
src/Infernu/Types.hs
gpl-2.0
schemeEmpty :: t -> TScheme t schemeEmpty t = TScheme [] $ qualEmpty t
70
schemeEmpty :: t -> TScheme t schemeEmpty t = TScheme [] $ qualEmpty t
70
schemeEmpty t = TScheme [] $ qualEmpty t
40
false
true
2
7
13
39
16
23
null
null
siddhanathan/ghc
compiler/coreSyn/CoreUnfold.hs
bsd-3-clause
-- Ditto (augment t (\cn -> e) ys) should cost only the cost of -- e plus ys. The -2 accounts for the \cn -- When we return a lambda, give a discount if it's used (applied) lamScrutDiscount :: DynFlags -> ExprSize -> ExprSize lamScrutDiscount dflags (SizeIs n vs _) = SizeIs n vs (ufFunAppDiscount dflags)
314
lamScrutDiscount :: DynFlags -> ExprSize -> ExprSize lamScrutDiscount dflags (SizeIs n vs _) = SizeIs n vs (ufFunAppDiscount dflags)
132
lamScrutDiscount dflags (SizeIs n vs _) = SizeIs n vs (ufFunAppDiscount dflags)
79
true
true
0
7
64
50
26
24
null
null
anton-dessiatov/Win32-security
tests/get-process-sid/Main.hs
mit
printMaybeAcct :: Maybe LookedUpAccount -> IO () printMaybeAcct maybel = case maybel of Just l -> do print (lookedUpAccountName l) print (lookedUpReferencedDomainName l) print (lookedUpUse l) s <- convertSidToStringSid (lookedUpSid l) print s Nothing -> putStrLn "Nothing found"
306
printMaybeAcct :: Maybe LookedUpAccount -> IO () printMaybeAcct maybel = case maybel of Just l -> do print (lookedUpAccountName l) print (lookedUpReferencedDomainName l) print (lookedUpUse l) s <- convertSidToStringSid (lookedUpSid l) print s Nothing -> putStrLn "Nothing found"
306
printMaybeAcct maybel = case maybel of Just l -> do print (lookedUpAccountName l) print (lookedUpReferencedDomainName l) print (lookedUpUse l) s <- convertSidToStringSid (lookedUpSid l) print s Nothing -> putStrLn "Nothing found"
257
false
true
2
10
65
107
46
61
null
null
emilaxelsson/ag-graph
examples/RepminPAG.hs
bsd-3-clause
it2 :: Tree IntTreeF it2 = iNode x (iNode (iLeaf 5) x) where x = iNode (iNode (iLeaf 24) (iLeaf 3)) (iLeaf 4)
113
it2 :: Tree IntTreeF it2 = iNode x (iNode (iLeaf 5) x) where x = iNode (iNode (iLeaf 24) (iLeaf 3)) (iLeaf 4)
113
it2 = iNode x (iNode (iLeaf 5) x) where x = iNode (iNode (iLeaf 24) (iLeaf 3)) (iLeaf 4)
92
false
true
0
11
26
71
35
36
null
null
ben-schulz/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectBinderQuotePattern q ty unq (Hole t) = do t' <- claimTy (sMN 0 "ty") ty; movelast t' fill $ reflCall "Hole" [ty, Var t'] solve focus t'; q unq t
178
reflectBinderQuotePattern q ty unq (Hole t) = do t' <- claimTy (sMN 0 "ty") ty; movelast t' fill $ reflCall "Hole" [ty, Var t'] solve focus t'; q unq t
178
reflectBinderQuotePattern q ty unq (Hole t) = do t' <- claimTy (sMN 0 "ty") ty; movelast t' fill $ reflCall "Hole" [ty, Var t'] solve focus t'; q unq t
178
false
false
0
10
56
87
39
48
null
null
DaMSL/K3
src/Language/K3/Codegen/Haskell.hs
apache-2.0
prefixDoE context (action &&& getCGEmbed -> (Just (HS.Do stmts), m)) = return $ mkCG (HB.doE $ context ++ stmts) m
116
prefixDoE context (action &&& getCGEmbed -> (Just (HS.Do stmts), m)) = return $ mkCG (HB.doE $ context ++ stmts) m
116
prefixDoE context (action &&& getCGEmbed -> (Just (HS.Do stmts), m)) = return $ mkCG (HB.doE $ context ++ stmts) m
116
false
false
0
12
21
61
31
30
null
null
massysett/penny
penny/lib/Penny/Copper/Decopperize.hs
bsd-3-clause
dPostingList :: PostingList Char a -> NonEmptySeq (a, Trio.Trio, Seq (PostingFieldDecop a)) dPostingList (PostingList _ p1 ps) = NE.NonEmptySeq (dPosting p1) (dNextPosting'Star ps)
186
dPostingList :: PostingList Char a -> NonEmptySeq (a, Trio.Trio, Seq (PostingFieldDecop a)) dPostingList (PostingList _ p1 ps) = NE.NonEmptySeq (dPosting p1) (dNextPosting'Star ps)
186
dPostingList (PostingList _ p1 ps) = NE.NonEmptySeq (dPosting p1) (dNextPosting'Star ps)
90
false
true
0
11
28
79
38
41
null
null
dataember/docker-control
src/API.hs
bsd-3-clause
endpointIdGet :: Int -> ReaderT PoolConfig IO (Maybe Endpoint) endpointIdGet key = do poolCfg <- ask lift $ do connPool <- pool poolCfg maybeEp <- getEndpointByKey connPool key return maybeEp
223
endpointIdGet :: Int -> ReaderT PoolConfig IO (Maybe Endpoint) endpointIdGet key = do poolCfg <- ask lift $ do connPool <- pool poolCfg maybeEp <- getEndpointByKey connPool key return maybeEp
223
endpointIdGet key = do poolCfg <- ask lift $ do connPool <- pool poolCfg maybeEp <- getEndpointByKey connPool key return maybeEp
160
false
true
0
12
61
78
33
45
null
null
mtlstats/mtlstats
src/Mtlstats/Control/EditGoalie.hs
gpl-3.0
ytdMinsC :: Bool -> Action () -> Controller ytdMinsC = curry $ promptController . uncurry editGoalieYtdMinsPrompt
115
ytdMinsC :: Bool -> Action () -> Controller ytdMinsC = curry $ promptController . uncurry editGoalieYtdMinsPrompt
115
ytdMinsC = curry $ promptController . uncurry editGoalieYtdMinsPrompt
71
false
true
2
9
17
43
18
25
null
null
fmapfmapfmap/amazonka
gen/src/Gen/AST/Data.hs
mpl-2.0
waiterFields :: HasMetadata a Identity => a -> Operation Identity Ref b -> Waiter Id -> Either Error (Waiter Field) waiterFields m o = traverseOf (waitAcceptors . each) go where out = o ^. opOutput . _Identity . refAnn go :: Accept Id -> Either Error (Accept Field) go x = do n <- traverse (notation m out) (x ^. acceptArgument) return $! x & acceptArgument .~ n
445
waiterFields :: HasMetadata a Identity => a -> Operation Identity Ref b -> Waiter Id -> Either Error (Waiter Field) waiterFields m o = traverseOf (waitAcceptors . each) go where out = o ^. opOutput . _Identity . refAnn go :: Accept Id -> Either Error (Accept Field) go x = do n <- traverse (notation m out) (x ^. acceptArgument) return $! x & acceptArgument .~ n
445
waiterFields m o = traverseOf (waitAcceptors . each) go where out = o ^. opOutput . _Identity . refAnn go :: Accept Id -> Either Error (Accept Field) go x = do n <- traverse (notation m out) (x ^. acceptArgument) return $! x & acceptArgument .~ n
277
false
true
0
11
150
163
78
85
null
null
ku-fpg/kansas-amber
tests/ExprTests/ExprList8.hs
bsd-3-clause
prop_cons :: ArduinoConnection -> RemoteRef [Word8] -> Word8 -> [Word8] -> Property prop_cons c r x xs = monadicIO $ do let local = x : xs remote <- run $ send c $ do writeRemoteRefE r $ (lit x) *: (lit xs) v <- readRemoteRefE r return v assert (local == litEvalL remote)
308
prop_cons :: ArduinoConnection -> RemoteRef [Word8] -> Word8 -> [Word8] -> Property prop_cons c r x xs = monadicIO $ do let local = x : xs remote <- run $ send c $ do writeRemoteRefE r $ (lit x) *: (lit xs) v <- readRemoteRefE r return v assert (local == litEvalL remote)
308
prop_cons c r x xs = monadicIO $ do let local = x : xs remote <- run $ send c $ do writeRemoteRefE r $ (lit x) *: (lit xs) v <- readRemoteRefE r return v assert (local == litEvalL remote)
223
false
true
0
15
90
138
64
74
null
null
onponomarev/ganeti
src/Ganeti/Types.hs
bsd-2-clause
roleDescription NRMaster = "master"
38
roleDescription NRMaster = "master"
38
roleDescription NRMaster = "master"
38
false
false
0
5
6
9
4
5
null
null
peterhurford/DMatrix.hs
src/DMatrix.hs
mit
--TODO: I ended up not needing this, but I don't want to get rid of it. which :: [Bool] -> [Int] which bools = (map fst) . (filter snd) $ zip [0..] bools
153
which :: [Bool] -> [Int] which bools = (map fst) . (filter snd) $ zip [0..] bools
81
which bools = (map fst) . (filter snd) $ zip [0..] bools
56
true
true
0
8
32
53
28
25
null
null
momomimachli/Hedsql-SQLite-simple
src/Database/Hedsql/Connection/SqLite/Simple.hs
gpl-3.0
-------------------------------------------------------------------------------- -- PUBLIC -------------------------------------------------------------------------------- -- | Create a table. createTable :: S.Connection -> H.CreateStmt H.SqLite -> IO () createTable = execute
277
createTable :: S.Connection -> H.CreateStmt H.SqLite -> IO () createTable = execute
83
createTable = execute
21
true
true
0
8
21
37
20
17
null
null
wtanaka/graphql-schema
tests/Spec.hs
gpl-2.0
qcProps :: TestTree qcProps = testGroup "(checked by QuickCheck)" [ QC.testProperty "sort == sort . reverse" $ \list -> sort (list :: [Int]) == sort (reverse list) , QC.testProperty "Fermat's little theorem" $ \x -> ((x :: Integer)^(7 :: Integer) - x) `mod` 7 == 0 -- the following property does not hold -- , QC.testProperty "Fermat's last theorem" $ -- \x y z n -> -- (n :: Integer) >= 3 QC.==> x^n + y^n /= (z^n :: Integer) ]
464
qcProps :: TestTree qcProps = testGroup "(checked by QuickCheck)" [ QC.testProperty "sort == sort . reverse" $ \list -> sort (list :: [Int]) == sort (reverse list) , QC.testProperty "Fermat's little theorem" $ \x -> ((x :: Integer)^(7 :: Integer) - x) `mod` 7 == 0 -- the following property does not hold -- , QC.testProperty "Fermat's last theorem" $ -- \x y z n -> -- (n :: Integer) >= 3 QC.==> x^n + y^n /= (z^n :: Integer) ]
464
qcProps = testGroup "(checked by QuickCheck)" [ QC.testProperty "sort == sort . reverse" $ \list -> sort (list :: [Int]) == sort (reverse list) , QC.testProperty "Fermat's little theorem" $ \x -> ((x :: Integer)^(7 :: Integer) - x) `mod` 7 == 0 -- the following property does not hold -- , QC.testProperty "Fermat's last theorem" $ -- \x y z n -> -- (n :: Integer) >= 3 QC.==> x^n + y^n /= (z^n :: Integer) ]
444
false
true
0
14
116
120
64
56
null
null