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
keithodulaigh/Hets
HasCASL/Builtin.hs
gpl-2.0
eqvId :: Id eqvId = mkInfix equivS
34
eqvId :: Id eqvId = mkInfix equivS
34
eqvId = mkInfix equivS
22
false
true
0
5
6
14
7
7
null
null
green-haskell/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
ppr_mono_ty _ (HsPArrTy ty) = paBrackets (ppr_mono_lty TopPrec ty)
75
ppr_mono_ty _ (HsPArrTy ty) = paBrackets (ppr_mono_lty TopPrec ty)
75
ppr_mono_ty _ (HsPArrTy ty) = paBrackets (ppr_mono_lty TopPrec ty)
75
false
false
0
7
17
28
13
15
null
null
Kirez/hsudoku
src/HSudoku.hs
mit
single :: Technique single g = ng where oneks = findKindredCells g 1 assignments = S.toList . S.fromList $ [ (coord, head ds) | (_, ones) <- oneks , one <- ones, coord <- one , let ds = (\(Left x) -> x) (g ! coord) ] ng = if not . null $ assign...
422
single :: Technique single g = ng where oneks = findKindredCells g 1 assignments = S.toList . S.fromList $ [ (coord, head ds) | (_, ones) <- oneks , one <- ones, coord <- one , let ds = (\(Left x) -> x) (g ! coord) ] ng = if not . null $ assign...
422
single g = ng where oneks = findKindredCells g 1 assignments = S.toList . S.fromList $ [ (coord, head ds) | (_, ones) <- oneks , one <- ones, coord <- one , let ds = (\(Left x) -> x) (g ! coord) ] ng = if not . null $ assignments t...
402
false
true
0
17
167
162
86
76
null
null
thedobs/LTSmin
doc/code/regroup.hs
bsd-3-clause
cover l (x:g) = if subsumed l x then merge_rows x l : g else if subsumed x l then cover (merge_rows l x) g else x:cover l g
134
cover l (x:g) = if subsumed l x then merge_rows x l : g else if subsumed x l then cover (merge_rows l x) g else x:cover l g
134
cover l (x:g) = if subsumed l x then merge_rows x l : g else if subsumed x l then cover (merge_rows l x) g else x:cover l g
134
false
false
0
9
39
75
37
38
null
null
michaelt/lens-simple
examples/Pong.hs
bsd-3-clause
updatePaddles :: Float -> State Pong () updatePaddles time = do p <- get let paddleMovement = time * paddleSpeed keyPressed key = p^.keys.contains (SpecialKey key) -- Update the player's paddle based on keys when (keyPressed KeyUp) $ paddle1 += paddleMovement when (keyPressed KeyDown) $ paddle1 -= p...
953
updatePaddles :: Float -> State Pong () updatePaddles time = do p <- get let paddleMovement = time * paddleSpeed keyPressed key = p^.keys.contains (SpecialKey key) -- Update the player's paddle based on keys when (keyPressed KeyUp) $ paddle1 += paddleMovement when (keyPressed KeyDown) $ paddle1 -= p...
953
updatePaddles time = do p <- get let paddleMovement = time * paddleSpeed keyPressed key = p^.keys.contains (SpecialKey key) -- Update the player's paddle based on keys when (keyPressed KeyUp) $ paddle1 += paddleMovement when (keyPressed KeyDown) $ paddle1 -= paddleMovement -- Calculate the optima...
913
false
true
0
14
229
293
144
149
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2018-06-snoyman-applied-haskell-at-lambdaconf/all/src/E1.hs
unlicense
parse :: T.Text -> [[T.Text]] parse t = map (map T.strip . T.splitOn ",") (T.lines t)
85
parse :: T.Text -> [[T.Text]] parse t = map (map T.strip . T.splitOn ",") (T.lines t)
85
parse t = map (map T.strip . T.splitOn ",") (T.lines t)
55
false
true
0
9
15
58
29
29
null
null
jbalint/banshee-sympatico
meera/Syntax.hs
mit
apply1 = myFmap addOne (TInt 4)
31
apply1 = myFmap addOne (TInt 4)
31
apply1 = myFmap addOne (TInt 4)
31
false
false
1
7
5
20
8
12
null
null
dsorokin/aivika-experiment-chart
examples/MachRep3/Experiment.hs
bsd-3-clause
t = resultByName "totalUpTime"
30
t = resultByName "totalUpTime"
30
t = resultByName "totalUpTime"
30
false
false
1
5
3
12
4
8
null
null
fredmorcos/attic
projects/pet/archive/pet_haskell_petparser/PetParser.hs
isc
parseShop = parseName "Expecting a shop name"
47
parseShop = parseName "Expecting a shop name"
47
parseShop = parseName "Expecting a shop name"
47
false
false
0
5
8
9
4
5
null
null
csabahruska/GFXDemo
GLBackend.hs
bsd-3-clause
setUniform :: GLProgram -> ByteString -> Uniform -> IO Bool setUniform p n u = do st "BEGIN[setUniform]" r <- setUniform' p n u st "END[setUniform]" return r
173
setUniform :: GLProgram -> ByteString -> Uniform -> IO Bool setUniform p n u = do st "BEGIN[setUniform]" r <- setUniform' p n u st "END[setUniform]" return r
173
setUniform p n u = do st "BEGIN[setUniform]" r <- setUniform' p n u st "END[setUniform]" return r
113
false
true
0
9
43
70
29
41
null
null
tjakway/ghcjvm
compiler/deSugar/DsArrows.hs
bsd-3-clause
dsCmdStmts _ _ _ [] _ = panic "dsCmdStmts []"
45
dsCmdStmts _ _ _ [] _ = panic "dsCmdStmts []"
45
dsCmdStmts _ _ _ [] _ = panic "dsCmdStmts []"
45
false
false
1
5
9
23
9
14
null
null
fmthoma/ghc
compiler/types/TyCon.hs
bsd-3-clause
-- | Extract the bound type variables and type expansion of an eta-contracted -- type synonym 'TyCon'. Panics if the 'TyCon' is not a synonym newTyConEtadRhs :: TyCon -> ([TyVar], Type) newTyConEtadRhs (AlgTyCon {algTcRhs = NewTyCon { nt_etad_rhs = tvs_rhs }}) = tvs_rhs
271
newTyConEtadRhs :: TyCon -> ([TyVar], Type) newTyConEtadRhs (AlgTyCon {algTcRhs = NewTyCon { nt_etad_rhs = tvs_rhs }}) = tvs_rhs
128
newTyConEtadRhs (AlgTyCon {algTcRhs = NewTyCon { nt_etad_rhs = tvs_rhs }}) = tvs_rhs
84
true
true
0
11
43
55
30
25
null
null
graninas/Haskell-Algorithms
Tests/TransitionGraph/transition-graph/app/AdvGame/AdvGameRuntime.hs
gpl-3.0
interpret (Put s next) = error "Not implemented."
53
interpret (Put s next) = error "Not implemented."
53
interpret (Put s next) = error "Not implemented."
53
false
false
0
7
11
20
9
11
null
null
lamdu/lamdu
src/Lamdu/GUI/DefinitionEdit.hs
gpl-3.0
make :: _ => ExprGui.Top Sugar.Definition i o -> M.WidgetId -> GuiM env i o (Responsive o) make def myId = do env <- Lens.view id let nextOutdated = E.keyPresses (env ^. has . Config.pane . Config.nextOutdatedKeys) (E.Doc [env ^. has . ...
853
make :: _ => ExprGui.Top Sugar.Definition i o -> M.WidgetId -> GuiM env i o (Responsive o) make def myId = do env <- Lens.view id let nextOutdated = E.keyPresses (env ^. has . Config.pane . Config.nextOutdatedKeys) (E.Doc [env ^. has . ...
853
make def myId = do env <- Lens.view id let nextOutdated = E.keyPresses (env ^. has . Config.pane . Config.nextOutdatedKeys) (E.Doc [env ^. has . Texts.gotoNextOutdated]) (def ^. Sugar.drGotoNextOutdated <&> foldMap (...
746
false
true
0
17
280
239
114
125
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | The ID of the settlement report. srSettlementId :: Lens' SettlementReport (Maybe Text) srSettlementId = lens _srSettlementId (\ s a -> s{_srSettlementId = a})
171
srSettlementId :: Lens' SettlementReport (Maybe Text) srSettlementId = lens _srSettlementId (\ s a -> s{_srSettlementId = a})
133
srSettlementId = lens _srSettlementId (\ s a -> s{_srSettlementId = a})
79
true
true
0
9
32
48
25
23
null
null
phischu/fragnix
tests/packages/scotty/Control.Concurrent.STM.TChan.hs
bsd-3-clause
writeTChan :: TChan a -> a -> STM () writeTChan (TChan _read write) a = do listend <- readTVar write -- listend == TVar pointing to TNil new_listend <- newTVar TNil writeTVar listend (TCons a new_listend) writeTVar write new_listend -- |Read the next value from the 'TChan'.
283
writeTChan :: TChan a -> a -> STM () writeTChan (TChan _read write) a = do listend <- readTVar write -- listend == TVar pointing to TNil new_listend <- newTVar TNil writeTVar listend (TCons a new_listend) writeTVar write new_listend -- |Read the next value from the 'TChan'.
283
writeTChan (TChan _read write) a = do listend <- readTVar write -- listend == TVar pointing to TNil new_listend <- newTVar TNil writeTVar listend (TCons a new_listend) writeTVar write new_listend -- |Read the next value from the 'TChan'.
246
false
true
0
10
55
91
40
51
null
null
Mokosha/HsTetrisAttack
TetrisAttack/Board/Gravity.hs
mit
updateFalling (_, Just ft) = (ft, resolveFalling True)
54
updateFalling (_, Just ft) = (ft, resolveFalling True)
54
updateFalling (_, Just ft) = (ft, resolveFalling True)
54
false
false
0
7
7
27
14
13
null
null
liyanchang/scheme-in-haskell
src/chp5.hs
mit
eval badForm = throwError $ BadSpecialForm "Unrecognized special form" badForm
78
eval badForm = throwError $ BadSpecialForm "Unrecognized special form" badForm
78
eval badForm = throwError $ BadSpecialForm "Unrecognized special form" badForm
78
false
false
1
6
9
21
8
13
null
null
LambdaHack/LambdaHack
engine-src/Game/LambdaHack/Common/Vector.hs
bsd-3-clause
vicinityUnsafe p = [ shift p dxy | dxy <- moves ]
49
vicinityUnsafe p = [ shift p dxy | dxy <- moves ]
49
vicinityUnsafe p = [ shift p dxy | dxy <- moves ]
49
false
false
1
8
11
29
12
17
null
null
carymrobbins/intellij-haskforce
tests/gold/parser/String00007.hs
apache-2.0
s = "\818\773"
14
s = "\818\773"
14
s = "\818\773"
14
false
false
1
5
2
10
3
7
null
null
cuklev/JSBoiler
src/JSBoiler/Eval/Property.hs
gpl-3.0
setPropertyValue :: Text -> IORef Object -> JSType -> JSBoiler () setPropertyValue name ref value = do obj <- liftIO $ readIORef ref let props = properties obj mprop = M.lookup name props setValue prop val = case setter prop of Nothing -> if writeable prop ...
1,179
setPropertyValue :: Text -> IORef Object -> JSType -> JSBoiler () setPropertyValue name ref value = do obj <- liftIO $ readIORef ref let props = properties obj mprop = M.lookup name props setValue prop val = case setter prop of Nothing -> if writeable prop ...
1,179
setPropertyValue name ref value = do obj <- liftIO $ readIORef ref let props = properties obj mprop = M.lookup name props setValue prop val = case setter prop of Nothing -> if writeable prop then let obj' = setProperty name (prop { propertyValue = val }) o...
1,113
false
true
0
21
498
302
154
148
null
null
brendanhay/gogol
gogol-dataproc/gen/Network/Google/Dataproc/Types/Product.hs
mpl-2.0
-- | Output only. The time when this state was entered. jsStateStartTime :: Lens' JobStatus (Maybe UTCTime) jsStateStartTime = lens _jsStateStartTime (\ s a -> s{_jsStateStartTime = a}) . mapping _DateTime
219
jsStateStartTime :: Lens' JobStatus (Maybe UTCTime) jsStateStartTime = lens _jsStateStartTime (\ s a -> s{_jsStateStartTime = a}) . mapping _DateTime
163
jsStateStartTime = lens _jsStateStartTime (\ s a -> s{_jsStateStartTime = a}) . mapping _DateTime
111
true
true
0
10
44
55
28
27
null
null
ksoda/atCoder
a/22.hs
bsd-3-clause
bestBody :: Ord a => (a, a) -> a -> Bool bestBody (s, t) x = s <= x && x <= t
77
bestBody :: Ord a => (a, a) -> a -> Bool bestBody (s, t) x = s <= x && x <= t
77
bestBody (s, t) x = s <= x && x <= t
36
false
true
4
10
22
63
31
32
null
null
stone-guru/tmmha
src/TMM/Selector.hs
gpl-3.0
cget :: Monad m => (Context e -> a) -> SelectT e m a cget f = SelectT $ \sc -> return (f sc, sc)
96
cget :: Monad m => (Context e -> a) -> SelectT e m a cget f = SelectT $ \sc -> return (f sc, sc)
96
cget f = SelectT $ \sc -> return (f sc, sc)
43
false
true
0
9
24
63
31
32
null
null
Zigazou/HaMinitel
src/Minitel/Minitel.hs
gpl-3.0
waitForConnection :: Minitel -> IO (Maybe MString) waitForConnection minitel' = do firstByte <- waitFor 20000000 (getter minitel') followingBytes <- readNCount (getter minitel') 100 return ((:) <$> firstByte <*> Just followingBytes) -- | Opens a full-duplex connection to a Minitel. The default serial is se...
345
waitForConnection :: Minitel -> IO (Maybe MString) waitForConnection minitel' = do firstByte <- waitFor 20000000 (getter minitel') followingBytes <- readNCount (getter minitel') 100 return ((:) <$> firstByte <*> Just followingBytes) -- | Opens a full-duplex connection to a Minitel. The default serial is se...
345
waitForConnection minitel' = do firstByte <- waitFor 20000000 (getter minitel') followingBytes <- readNCount (getter minitel') 100 return ((:) <$> firstByte <*> Just followingBytes) -- | Opens a full-duplex connection to a Minitel. The default serial is set -- to \/dev\/ttyUSB0.
294
false
true
0
10
61
87
42
45
null
null
crooney/cinder
examples/Transformer.hs
bsd-3-clause
transformer :: Fay () transformer = do root >>= insert (markup !+ rHWXY 10 15 10 10 ! fill "green" !+ atDRT 4 7 [Scale2d 1 1, Scale2d 2 3, Scale2d 1 1] ! additive "sum" !<+ atDRT 3 8 [Rotate 0 100 100,Rotate 270 100 100,Rotate 0 100 100] ! additive "sum" !< Complete) return (...
321
transformer :: Fay () transformer = do root >>= insert (markup !+ rHWXY 10 15 10 10 ! fill "green" !+ atDRT 4 7 [Scale2d 1 1, Scale2d 2 3, Scale2d 1 1] ! additive "sum" !<+ atDRT 3 8 [Rotate 0 100 100,Rotate 270 100 100,Rotate 0 100 100] ! additive "sum" !< Complete) return (...
321
transformer = do root >>= insert (markup !+ rHWXY 10 15 10 10 ! fill "green" !+ atDRT 4 7 [Scale2d 1 1, Scale2d 2 3, Scale2d 1 1] ! additive "sum" !<+ atDRT 3 8 [Rotate 0 100 100,Rotate 270 100 100,Rotate 0 100 100] ! additive "sum" !< Complete) return ()
299
false
true
0
18
100
157
72
85
null
null
shlevy/ghc
libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
bsd-3-clause
recordPatSyn :: [Name] -> PatSynArgsQ recordPatSyn sels = return $ RecordPatSyn sels
84
recordPatSyn :: [Name] -> PatSynArgsQ recordPatSyn sels = return $ RecordPatSyn sels
84
recordPatSyn sels = return $ RecordPatSyn sels
46
false
true
0
7
11
33
15
18
null
null
gregorycollins/cabal2macpkg
Program/MakePackage.hs
bsd-3-clause
makeMacPkg :: Options -- ^ command-line options -> FilePath -- ^ path to temp directory -> PackageDescription -- ^ a parsed .cabal file -> IO () makeMacPkg opts tmpdir pkgDesc = do -- some portions of package building process require root -- privileges (than...
5,755
makeMacPkg :: Options -- ^ command-line options -> FilePath -- ^ path to temp directory -> PackageDescription -- ^ a parsed .cabal file -> IO () makeMacPkg opts tmpdir pkgDesc = do -- some portions of package building process require root -- privileges (than...
5,755
makeMacPkg opts tmpdir pkgDesc = do -- some portions of package building process require root -- privileges (thanks, Apple!) checkRootPrivileges createDirectories -------------------------------------------------------------------- hasPostFlight <- buildPackageContents setRootPrivileges ...
5,556
false
true
3
15
1,862
831
431
400
null
null
sebastiaanvisser/salvia-sessions
src/Network/Salvia/Handler/Login.hs
bsd-3-clause
authenticate :: Parameters -> UserDatabase -> Maybe User authenticate ps db = do user <- "username" `lookup` ps >>= id pass <- "password" `lookup` ps >>= id case headMay $ filter ((==user) . getL username) (getL users db) of Just u | getL password u == show (md5 (fromString pass)) -> Just u _ ...
448
authenticate :: Parameters -> UserDatabase -> Maybe User authenticate ps db = do user <- "username" `lookup` ps >>= id pass <- "password" `lookup` ps >>= id case headMay $ filter ((==user) . getL username) (getL users db) of Just u | getL password u == show (md5 (fromString pass)) -> Just u _ ...
448
authenticate ps db = do user <- "username" `lookup` ps >>= id pass <- "password" `lookup` ps >>= id case headMay $ filter ((==user) . getL username) (getL users db) of Just u | getL password u == show (md5 (fromString pass)) -> Just u _ ->...
391
false
true
0
18
148
148
72
76
null
null
GaloisInc/delicious
Network/Delicious/RSS.hs
bsd-3-clause
recent_url :: {-URL-}String recent_url = deli_base ++ "/rss/recent"
69
recent_url :: {-URL-}String recent_url = deli_base ++ "/rss/recent"
69
recent_url = deli_base ++ "/rss/recent"
40
false
true
0
5
9
16
9
7
null
null
haBuu/tfs-website
Helpers.hs
mit
showDay :: Day -> String showDay date = (show d) ++ "." ++ (show m) ++ "." ++ (show y) where (y,m,d) = toGregorian date
127
showDay :: Day -> String showDay date = (show d) ++ "." ++ (show m) ++ "." ++ (show y) where (y,m,d) = toGregorian date
127
showDay date = (show d) ++ "." ++ (show m) ++ "." ++ (show y) where (y,m,d) = toGregorian date
102
false
true
0
10
32
72
37
35
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2014-Alejandro_Serrano_Mena-Beginning_Haskell/old/code/src/C05.hs
unlicense
foo :: a foo = undefined
24
foo :: a foo = undefined
24
foo = undefined
15
false
true
0
6
5
18
7
11
null
null
beni55/hs-tls
core/Tests/PipeChan.hs
bsd-3-clause
runPipe (PipeChan _ _ cToS sToC) = runUniPipe cToS >> runUniPipe sToC
69
runPipe (PipeChan _ _ cToS sToC) = runUniPipe cToS >> runUniPipe sToC
69
runPipe (PipeChan _ _ cToS sToC) = runUniPipe cToS >> runUniPipe sToC
69
false
false
0
7
11
31
14
17
null
null
iu-parfunc/AutoObsidian
interface_brainstorming/06_ExtensibleEffects/newVer/Eff1.hs
bsd-3-clause
-- Application to the `generalized effectful function' GenArr r b w qApp :: b -> GenArr r b w -> Eff r w qApp x q = case tviewl q of TAEmptyL -> Val x k :< t -> case unArr k x of Val y -> qApp y t E u q -> E u (q >< t) -- Compose effectful arrows (and possibly change the effect!)
303
qApp :: b -> GenArr r b w -> Eff r w qApp x q = case tviewl q of TAEmptyL -> Val x k :< t -> case unArr k x of Val y -> qApp y t E u q -> E u (q >< t) -- Compose effectful arrows (and possibly change the effect!)
235
qApp x q = case tviewl q of TAEmptyL -> Val x k :< t -> case unArr k x of Val y -> qApp y t E u q -> E u (q >< t) -- Compose effectful arrows (and possibly change the effect!)
198
true
true
0
13
90
110
52
58
null
null
rrnewton/pcg-random
src/System/Random/PCG/Class.hs
bsd-3-clause
uniformBW8 :: Generator g m => Word8 -> g -> m Word8 uniformBW8 = uniformB
74
uniformBW8 :: Generator g m => Word8 -> g -> m Word8 uniformBW8 = uniformB
74
uniformBW8 = uniformB
21
false
true
0
9
14
37
16
21
null
null
nfjinjing/mps
src/MPS/Math/PermutationGroupExamples.hs
bsd-3-clause
-- t -> t+1 betaL2_23 = fromCycles (map (map (+2)) [[-1],[15,7,14,5,10,20,17,11,22,21,19],[0],[3,6,12,1,2,4,8,16,9,18,13]])
124
betaL2_23 = fromCycles (map (map (+2)) [[-1],[15,7,14,5,10,20,17,11,22,21,19],[0],[3,6,12,1,2,4,8,16,9,18,13]])
111
betaL2_23 = fromCycles (map (map (+2)) [[-1],[15,7,14,5,10,20,17,11,22,21,19],[0],[3,6,12,1,2,4,8,16,9,18,13]])
111
true
false
0
10
11
114
72
42
null
null
beni55/hermit
src/HERMIT/Dictionary/Composite.hs
bsd-2-clause
-- | As bash, but with "let-nonrec-subst" instead of "let-nonrec-subst-safe". smashComponents1 :: ( AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb , HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadCatch m, MonadIO m, MonadThings m, MonadUnique m ) ...
2,603
smashComponents1 :: ( AddBindings c, ExtendPath c Crumb, HasEmptyContext c, ReadBindings c, ReadPath c Crumb , HasDynFlags m, HasHermitMEnv m, LiftCoreM m, MonadCatch m, MonadIO m, MonadThings m, MonadUnique m ) => [(Rewrite c m LCore, String)] smashComponents1 = [ -- (promoteExpr...
2,525
smashComponents1 = [ -- (promoteExprR occurAnalyseExprChangedR, "occur-analyse-expr") -- ?? (promoteExprR betaReduceR, "beta-reduce") -- O(1) , (promoteExprR (caseReduceR True), "case-reduce") -- O(n) , (promoteExprR (caseReduceUnfoldR True), "case-reduce-unfold") ...
2,243
true
true
3
10
758
443
257
186
null
null
bitemyapp/commercialhaskell.com
src/HL/View/Home/Features.hs
bsd-3-clause
inference :: Html () inference = do h2_ "Type inference" p_ "You don't have to explicitly write out every type in a Haskell program. \ \Types will be inferred by unifying every type bidirectionally. However, you \ \can write out types if you choose, or ask the compiler to write them for you \ ...
1,971
inference :: Html () inference = do h2_ "Type inference" p_ "You don't have to explicitly write out every type in a Haskell program. \ \Types will be inferred by unifying every type bidirectionally. However, you \ \can write out types if you choose, or ask the compiler to write them for you \ ...
1,971
inference = do h2_ "Type inference" p_ "You don't have to explicitly write out every type in a Haskell program. \ \Types will be inferred by unifying every type bidirectionally. However, you \ \can write out types if you choose, or ask the compiler to write them for you \ \for handy document...
1,950
false
true
0
10
797
112
44
68
null
null
gnn/Hets
Common/ProverTools.hs
gpl-2.0
checkBinary :: String -> IO (Maybe String) checkBinary name = fmap (\ l -> if null l then Just $ "missing binary in $PATH: " ++ name else Nothing) $ check4FileAux name "PATH"
198
checkBinary :: String -> IO (Maybe String) checkBinary name = fmap (\ l -> if null l then Just $ "missing binary in $PATH: " ++ name else Nothing) $ check4FileAux name "PATH"
198
checkBinary name = fmap (\ l -> if null l then Just $ "missing binary in $PATH: " ++ name else Nothing) $ check4FileAux name "PATH"
155
false
true
2
9
56
67
33
34
null
null
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/raster/Crystal/Main.hs
mit
th = pi / phi
14
!th = pi / phi
14
!th = pi / phi
14
false
false
3
4
5
14
5
9
null
null
maoe/text-keepalived
src/Text/Keepalived/Parser.hs
bsd-3-clause
pGarpMasterDelay :: Stream s Identity Token => Parsec s u Integer pGarpMasterDelay = do identifier "garp_master_delay" value natural
136
pGarpMasterDelay :: Stream s Identity Token => Parsec s u Integer pGarpMasterDelay = do identifier "garp_master_delay" value natural
136
pGarpMasterDelay = do identifier "garp_master_delay" value natural
70
false
true
0
7
21
41
18
23
null
null
nikita-volkov/stm-containers
library/StmContainers/Bimap.hs
mit
insertRight :: (Eq leftKey, Hashable leftKey, Eq rightKey, Hashable rightKey) => leftKey -> rightKey -> Bimap leftKey rightKey -> STM () insertRight leftKey rightKey (Bimap leftMap rightMap) = insertLeft leftKey rightKey (Bimap rightMap leftMap)
248
insertRight :: (Eq leftKey, Hashable leftKey, Eq rightKey, Hashable rightKey) => leftKey -> rightKey -> Bimap leftKey rightKey -> STM () insertRight leftKey rightKey (Bimap leftMap rightMap) = insertLeft leftKey rightKey (Bimap rightMap leftMap)
248
insertRight leftKey rightKey (Bimap leftMap rightMap) = insertLeft leftKey rightKey (Bimap rightMap leftMap)
111
false
true
0
10
36
90
44
46
null
null
2015-Fall-UPT-PLDA/homework
02/your_full_name_here.hs
mit
testLambdaAndApply = assert result (IntVal 42) "testLambdaAndApply" where result = interpret expr -- equivalent to: (\x y -> x * y) 6 7 expr = (Apply (Lambda [Var "x", Var "y"] ((Var "x") :*: (Var "y")) ) [Const (IntVal 6),...
426
testLambdaAndApply = assert result (IntVal 42) "testLambdaAndApply" where result = interpret expr -- equivalent to: (\x y -> x * y) 6 7 expr = (Apply (Lambda [Var "x", Var "y"] ((Var "x") :*: (Var "y")) ) [Const (IntVal 6),...
426
testLambdaAndApply = assert result (IntVal 42) "testLambdaAndApply" where result = interpret expr -- equivalent to: (\x y -> x * y) 6 7 expr = (Apply (Lambda [Var "x", Var "y"] ((Var "x") :*: (Var "y")) ) [Const (IntVal 6),...
426
false
false
1
13
157
109
55
54
null
null
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Sql.hs
bsd-3-clause
-- | Example type specialization: -- -- @ -- showSqlForPostgres :: Query (Column a, Column b) -> String -- @ -- -- Assuming the @makeAdaptorAndInstance@ splice has been run for the -- product type @Foo@: -- -- @ -- showSqlForPostgres :: Query (Foo (Column a) (Column b) (Column c)) -> String -- @ showSqlForPostgres :: f...
513
showSqlForPostgres :: forall columns . D.Default U.Unpackspec columns columns => Q.Query columns -> String showSqlForPostgres = showSqlForPostgresExplicit (D.def :: U.Unpackspec columns columns)
216
showSqlForPostgres = showSqlForPostgresExplicit (D.def :: U.Unpackspec columns columns)
87
true
true
0
9
96
70
41
29
null
null
epost/psc-ide
lib/Purescript/Ide.hs
bsd-3-clause
parseModuleDecl :: Parser ExternDecl parseModuleDecl = do string "module" spaces name <- many1 (noneOf " ") return (ModuleDecl (T.pack name) [])
152
parseModuleDecl :: Parser ExternDecl parseModuleDecl = do string "module" spaces name <- many1 (noneOf " ") return (ModuleDecl (T.pack name) [])
152
parseModuleDecl = do string "module" spaces name <- many1 (noneOf " ") return (ModuleDecl (T.pack name) [])
115
false
true
0
12
28
63
28
35
null
null
dmitmel/goiteens-hw-in-haskell
sorters/Main.hs
apache-2.0
getSorter "merge" = mergeSort
32
getSorter "merge" = mergeSort
32
getSorter "merge" = mergeSort
32
false
false
1
5
6
13
4
9
null
null
rahulmutt/ghcvm
compiler/Eta/HsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (HsTcBracketOut {}) = False
45
hsExprNeedsParens (HsTcBracketOut {}) = False
45
hsExprNeedsParens (HsTcBracketOut {}) = False
45
false
false
0
7
4
16
8
8
null
null
mariefarrell/Hets
MMT/XMLtoPT.hs
gpl-2.0
parse :: String -> IO [Result Decl] parse fname = do putStr $ "reading file " ++ fname ++ "\n" tree <- readPT fname -- putStr $ "reading XML tree: \n" ++ (show (onlyElems tree)) ++ "\n\n" return (map parseDeclR (onlyElems tree)) -- get attribute value by key (string)
280
parse :: String -> IO [Result Decl] parse fname = do putStr $ "reading file " ++ fname ++ "\n" tree <- readPT fname -- putStr $ "reading XML tree: \n" ++ (show (onlyElems tree)) ++ "\n\n" return (map parseDeclR (onlyElems tree)) -- get attribute value by key (string)
280
parse fname = do putStr $ "reading file " ++ fname ++ "\n" tree <- readPT fname -- putStr $ "reading XML tree: \n" ++ (show (onlyElems tree)) ++ "\n\n" return (map parseDeclR (onlyElems tree)) -- get attribute value by key (string)
244
false
true
0
12
61
78
36
42
null
null
haskellbr/missingh
missingh-all/testsrc/MIMETypestest.hs
mit
test_guessType = let f strict inp exp = TestCase $ exp @=? guessType defaultmtd strict inp in [ f True "" (Nothing, Nothing) ,f True "foo" (Nothing, Nothing) ,f True "foo.txt" (Just "text/plain", Nothing) ,f True "foo.txt.gz" (Just "text/plain", Just "gzip") ...
852
test_guessType = let f strict inp exp = TestCase $ exp @=? guessType defaultmtd strict inp in [ f True "" (Nothing, Nothing) ,f True "foo" (Nothing, Nothing) ,f True "foo.txt" (Just "text/plain", Nothing) ,f True "foo.txt.gz" (Just "text/plain", Just "gzip") ...
852
test_guessType = let f strict inp exp = TestCase $ exp @=? guessType defaultmtd strict inp in [ f True "" (Nothing, Nothing) ,f True "foo" (Nothing, Nothing) ,f True "foo.txt" (Just "text/plain", Nothing) ,f True "foo.txt.gz" (Just "text/plain", Just "gzip") ...
852
false
false
1
11
246
265
136
129
null
null
olorin/github
Github/Private.hs
bsd-3-clause
buildPath :: [String] -> String buildPath paths = '/' : intercalate "/" paths
77
buildPath :: [String] -> String buildPath paths = '/' : intercalate "/" paths
77
buildPath paths = '/' : intercalate "/" paths
45
false
true
0
7
12
35
16
19
null
null
goldfirere/singletons
singletons-th/src/Data/Singletons/TH/Single.hs
bsd-3-clause
singLit :: Lit -> SgM DExp singLit (IntegerL n) = do opts <- getOptions if n >= 0 then return $ DVarE (singledValueName opts fromIntegerName) `DAppE` (DVarE singMethName `DSigE` (singFamily `DAppT` DLitT (NumTyLit n))) else do sLit <- singLit (IntegerL (-n)) ret...
379
singLit :: Lit -> SgM DExp singLit (IntegerL n) = do opts <- getOptions if n >= 0 then return $ DVarE (singledValueName opts fromIntegerName) `DAppE` (DVarE singMethName `DSigE` (singFamily `DAppT` DLitT (NumTyLit n))) else do sLit <- singLit (IntegerL (-n)) ret...
379
singLit (IntegerL n) = do opts <- getOptions if n >= 0 then return $ DVarE (singledValueName opts fromIntegerName) `DAppE` (DVarE singMethName `DSigE` (singFamily `DAppT` DLitT (NumTyLit n))) else do sLit <- singLit (IntegerL (-n)) return $ DVarE (singledValueNa...
352
false
true
0
15
106
145
74
71
null
null
andorp/grin
grin/test/ParserSpec.hs
bsd-3-clause
spec :: Spec spec = do describe "quoted names" $ do it "basic" $ do let before = [prog| "GHC.Tuple.()" = pure (C"GHC.Tuple.()") |] let after = Program [] [ Def "GHC.Tuple.()" [] $ SReturn $ ConstTagNode (Tag C "GHC.Tuple.()") [] ] before `sameAs` after ...
16,354
spec :: Spec spec = do describe "quoted names" $ do it "basic" $ do let before = [prog| "GHC.Tuple.()" = pure (C"GHC.Tuple.()") |] let after = Program [] [ Def "GHC.Tuple.()" [] $ SReturn $ ConstTagNode (Tag C "GHC.Tuple.()") [] ] before `sameAs` after ...
16,354
spec = do describe "quoted names" $ do it "basic" $ do let before = [prog| "GHC.Tuple.()" = pure (C"GHC.Tuple.()") |] let after = Program [] [ Def "GHC.Tuple.()" [] $ SReturn $ ConstTagNode (Tag C "GHC.Tuple.()") [] ] before `sameAs` after it "special...
16,341
false
true
24
47
7,399
3,922
2,100
1,822
null
null
kevinjcliao/bb
src/Main.hs
bsd-3-clause
prettyPrintMessage :: BlueBus -> String prettyPrintMessage (HcToBmc (Haverford d1 t1) (BrynMawr d2 t2)) = "The next blue bus leaves Haverford at: " ++ (show d1) ++ " " ++ (show t1) ++ "\n" ++ " and will arrive at Bryn Mawr at: " ++ (show d2) ++ " " ++ (show t2)
265
prettyPrintMessage :: BlueBus -> String prettyPrintMessage (HcToBmc (Haverford d1 t1) (BrynMawr d2 t2)) = "The next blue bus leaves Haverford at: " ++ (show d1) ++ " " ++ (show t1) ++ "\n" ++ " and will arrive at Bryn Mawr at: " ++ (show d2) ++ " " ++ (show t2)
265
prettyPrintMessage (HcToBmc (Haverford d1 t1) (BrynMawr d2 t2)) = "The next blue bus leaves Haverford at: " ++ (show d1) ++ " " ++ (show t1) ++ "\n" ++ " and will arrive at Bryn Mawr at: " ++ (show d2) ++ " " ++ (show t2)
225
false
true
2
10
55
104
50
54
null
null
siddhanathan/yi
yi-frontend-pango/src/Yi/Frontend/Pango/Layouts.hs
gpl-2.0
-- | Bounds the given requisition to not exceed screen dimensions boundRequisition :: Requisition -> IO Requisition boundRequisition r@(Requisition w h) = do mscr <- screenGetDefault case mscr of Just scr -> Requisition <$> (min w <$> screenGetWidth scr) <*> (min h <$> scre...
435
boundRequisition :: Requisition -> IO Requisition boundRequisition r@(Requisition w h) = do mscr <- screenGetDefault case mscr of Just scr -> Requisition <$> (min w <$> screenGetWidth scr) <*> (min h <$> screenGetHeight scr) Nothing -> return r -- | Position the chil...
369
boundRequisition r@(Requisition w h) = do mscr <- screenGetDefault case mscr of Just scr -> Requisition <$> (min w <$> screenGetWidth scr) <*> (min h <$> screenGetHeight scr) Nothing -> return r -- | Position the children appropriately for the given width and height
319
true
true
0
14
113
100
48
52
null
null
dimara/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
ispecNicCount :: String ispecNicCount = ConstantUtils.ispecNicCount
67
ispecNicCount :: String ispecNicCount = ConstantUtils.ispecNicCount
67
ispecNicCount = ConstantUtils.ispecNicCount
43
false
true
0
6
5
20
8
12
null
null
gcampax/ghc
compiler/llvmGen/LlvmCodeGen/Base.hs
bsd-3-clause
-- | Translate a Cmm Bit Width to a LlvmType. widthToLlvmInt :: Width -> LlvmType widthToLlvmInt w = LMInt $ widthInBits w
122
widthToLlvmInt :: Width -> LlvmType widthToLlvmInt w = LMInt $ widthInBits w
76
widthToLlvmInt w = LMInt $ widthInBits w
40
true
true
0
6
21
26
13
13
null
null
nevrenato/Hets_Fork
Common/Result.hs
gpl-2.0
-- | check whether no errors are present, coerce into 'Maybe' resultToMaybe :: Result a -> Maybe a resultToMaybe = resultToMonad ""
131
resultToMaybe :: Result a -> Maybe a resultToMaybe = resultToMonad ""
69
resultToMaybe = resultToMonad ""
32
true
true
0
6
21
25
12
13
null
null
fmapfmapfmap/amazonka
amazonka-cognito-sync/gen/Network/AWS/CognitoSync/UnsubscribeFromDataset.hs
mpl-2.0
-- | Creates a value of 'UnsubscribeFromDatasetResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ufdrsResponseStatus' unsubscribeFromDatasetResponse :: Int -- ^ 'ufdrsResponseStatus' -> UnsubscribeFromDatasetResponse u...
456
unsubscribeFromDatasetResponse :: Int -- ^ 'ufdrsResponseStatus' -> UnsubscribeFromDatasetResponse unsubscribeFromDatasetResponse pResponseStatus_ = UnsubscribeFromDatasetResponse' { _ufdrsResponseStatus = pResponseStatus_ }
244
unsubscribeFromDatasetResponse pResponseStatus_ = UnsubscribeFromDatasetResponse' { _ufdrsResponseStatus = pResponseStatus_ }
137
true
true
0
6
70
32
20
12
null
null
begriffs/postgrest
src/PostgREST/Error.hs
mit
gucHeadersError :: Response gucHeadersError = simpleError HT.status500 [] "response.headers guc must be a JSON array composed of objects with a single key and a string value"
176
gucHeadersError :: Response gucHeadersError = simpleError HT.status500 [] "response.headers guc must be a JSON array composed of objects with a single key and a string value"
176
gucHeadersError = simpleError HT.status500 [] "response.headers guc must be a JSON array composed of objects with a single key and a string value"
148
false
true
0
6
27
23
11
12
null
null
gsdlab/clafer
src/Language/Clafer/ClaferArgs.hs
mit
retrieveModelFromURL :: String -> IO String retrieveModelFromURL url = case url of "" -> getContents -- this is the pre-module system behavior ('f':'i':'l':'e':':':'/':'/':n) -> readFile n ('h':'t':'t':'p':':':'/':'/':_) -> getURL url ('f':'t':'p':':':'/':'/':_) -> getURL url n -> readFile n -- th...
356
retrieveModelFromURL :: String -> IO String retrieveModelFromURL url = case url of "" -> getContents -- this is the pre-module system behavior ('f':'i':'l':'e':':':'/':'/':n) -> readFile n ('h':'t':'t':'p':':':'/':'/':_) -> getURL url ('f':'t':'p':':':'/':'/':_) -> getURL url n -> readFile n -- th...
356
retrieveModelFromURL url = case url of "" -> getContents -- this is the pre-module system behavior ('f':'i':'l':'e':':':'/':'/':n) -> readFile n ('h':'t':'t':'p':':':'/':'/':_) -> getURL url ('f':'t':'p':':':'/':'/':_) -> getURL url n -> readFile n -- this is the pre-module system behavior
312
false
true
0
15
66
158
79
79
null
null
romanb/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeVTLDevices.hs
mpl-2.0
-- | 'DescribeVTLDevicesResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dvtldrGatewayARN' @::@ 'Maybe' 'Text' -- -- * 'dvtldrMarker' @::@ 'Maybe' 'Text' -- -- * 'dvtldrVTLDevices' @::@ ['VTLDevice'] -- describeVTLDevicesResponse :: DescribeVTLDevicesResponse describeVTLDevi...
467
describeVTLDevicesResponse :: DescribeVTLDevicesResponse describeVTLDevicesResponse = DescribeVTLDevicesResponse { _dvtldrGatewayARN = Nothing , _dvtldrVTLDevices = mempty , _dvtldrMarker = Nothing }
219
describeVTLDevicesResponse = DescribeVTLDevicesResponse { _dvtldrGatewayARN = Nothing , _dvtldrVTLDevices = mempty , _dvtldrMarker = Nothing }
162
true
true
0
7
72
51
31
20
null
null
sdiehl/ghc
compiler/prelude/PrimOp.hs
bsd-3-clause
-- CoreUnfold.primOpSize already takes into account primOpOutOfLine -- and adds some further costs for the args in that case. primOpCodeSizeForeignCall :: Int primOpCodeSizeForeignCall = 4
191
primOpCodeSizeForeignCall :: Int primOpCodeSizeForeignCall = 4
62
primOpCodeSizeForeignCall = 4
29
true
true
0
4
27
13
8
5
null
null
jaalonso/I1M-Cod-Temas
src/Tema_8.hs
gpl-2.0
-- take.1 take _ [] = []
29
take _ [] = []
19
take _ [] = []
19
true
false
0
6
11
16
8
8
null
null
rpglover64/lens
src/Language/Haskell/TH/Lens.hs
bsd-3-clause
_PrimTyConI :: Prism' Info (Name, Arity, Unlifted) _PrimTyConI = prism remitter reviewer where remitter (x, y, z) = PrimTyConI x y z reviewer (PrimTyConI x y z) = Right (x, y, z) reviewer x = Left x
220
_PrimTyConI :: Prism' Info (Name, Arity, Unlifted) _PrimTyConI = prism remitter reviewer where remitter (x, y, z) = PrimTyConI x y z reviewer (PrimTyConI x y z) = Right (x, y, z) reviewer x = Left x
220
_PrimTyConI = prism remitter reviewer where remitter (x, y, z) = PrimTyConI x y z reviewer (PrimTyConI x y z) = Right (x, y, z) reviewer x = Left x
169
false
true
2
7
58
97
51
46
null
null
parapluu/encore
src/back/CodeGen/CCodeNames.hs
bsd-3-clause
partySequence :: CCode Name partySequence = Nam "party_sequence"
64
partySequence :: CCode Name partySequence = Nam "party_sequence"
64
partySequence = Nam "party_sequence"
36
false
true
1
5
7
20
8
12
null
null
vTurbine/ghc
compiler/main/DynFlags.hs
bsd-3-clause
-- | Unset a 'WarningFlag' wopt_unset :: DynFlags -> WarningFlag -> DynFlags wopt_unset dfs f = dfs{ warningFlags = IntSet.delete (fromEnum f) (warningFlags dfs) }
163
wopt_unset :: DynFlags -> WarningFlag -> DynFlags wopt_unset dfs f = dfs{ warningFlags = IntSet.delete (fromEnum f) (warningFlags dfs) }
136
wopt_unset dfs f = dfs{ warningFlags = IntSet.delete (fromEnum f) (warningFlags dfs) }
86
true
true
0
10
24
57
28
29
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/WebSocket.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/WebSocket.protocol Mozilla WebSocket.protocol documentation> getProtocolUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => WebSocket -> m result getProtocolUnsafe self = liftDOM (((self ^. js "protocol") >>= ...
401
getProtocolUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => WebSocket -> m result getProtocolUnsafe self = liftDOM (((self ^. js "protocol") >>= fromMaybeJSString) >>= maybe (Prelude.error "Nothing to return") return)
284
getProtocolUnsafe self = liftDOM (((self ^. js "protocol") >>= fromMaybeJSString) >>= maybe (Prelude.error "Nothing to return") return)
152
true
true
0
12
90
81
41
40
null
null
urbanslug/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
ltResult :: OrdOp -> LHsExpr RdrName -- Knowing a<b, what is the result for a `op` b? ltResult OrdCompare = ltTag_Expr
118
ltResult :: OrdOp -> LHsExpr RdrName ltResult OrdCompare = ltTag_Expr
69
ltResult OrdCompare = ltTag_Expr
32
true
true
0
6
20
26
12
14
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Embedded.hs
bsd-3-clause
area' ∷ forall t m a. DomBuilder t m ⇒ Area → m a → m (Element EventResult (DomBuilderSpace m) t, a) area' bm = elAttr' "area" (A.attrMap bm)
142
area' ∷ forall t m a. DomBuilder t m ⇒ Area → m a → m (Element EventResult (DomBuilderSpace m) t, a) area' bm = elAttr' "area" (A.attrMap bm)
142
area' bm = elAttr' "area" (A.attrMap bm)
41
false
true
0
13
29
76
38
38
null
null
m00nlight/99-problems
haskell/p-71.hs
bsd-3-clause
tree4 = Node 'b' [Node 'd' [], Node 'e' []]
43
tree4 = Node 'b' [Node 'd' [], Node 'e' []]
43
tree4 = Node 'b' [Node 'd' [], Node 'e' []]
43
false
false
0
8
9
31
15
16
null
null
atwupack/LearnOpenGL
app/2_Lighting/6_Multiple-lights/Multiple-lights-with-spot.hs
bsd-3-clause
drawLight :: ShaderProgram -> Int -> IO () drawLight shader i = do let model = mkTransformationMat (0.2 *!! identity) (pointLightPositions !! i) setUniform shader "model" model drawArrays Triangles 0 36
214
drawLight :: ShaderProgram -> Int -> IO () drawLight shader i = do let model = mkTransformationMat (0.2 *!! identity) (pointLightPositions !! i) setUniform shader "model" model drawArrays Triangles 0 36
214
drawLight shader i = do let model = mkTransformationMat (0.2 *!! identity) (pointLightPositions !! i) setUniform shader "model" model drawArrays Triangles 0 36
171
false
true
0
12
42
77
36
41
null
null
bitemyapp/bloodhound
src/Database/Bloodhound/Internal/Highlight.hs
bsd-3-clause
commonHighlightPairs (Just (CommonHighlight chScore chForceSource chTag chEncoder chNoMatchSize chHighlightQuery chRequireFieldMatch)) = [ "order" .= chScore , "force_source" .= chForceSource , "encoder" .= chEncoder , "no_match_size" .= chNoMatchS...
456
commonHighlightPairs (Just (CommonHighlight chScore chForceSource chTag chEncoder chNoMatchSize chHighlightQuery chRequireFieldMatch)) = [ "order" .= chScore , "force_source" .= chForceSource , "encoder" .= chEncoder , "no_match_size" .= chNoMatchS...
456
commonHighlightPairs (Just (CommonHighlight chScore chForceSource chTag chEncoder chNoMatchSize chHighlightQuery chRequireFieldMatch)) = [ "order" .= chScore , "force_source" .= chForceSource , "encoder" .= chEncoder , "no_match_size" .= chNoMatchS...
456
false
false
2
9
126
83
43
40
null
null
andygill/kansas-lava
Language/KansasLava/Test.hs
bsd-3-clause
fileReporter :: FilePath -> FilePath -> Result -> IO () fileReporter path nm res = do createDirectoryIfMissing True (path </> nm) writeFile (path </> nm </> "result") $ show res ------------------------------------------------------------------------------------- -- Given a circuit that returns an a, and the ...
366
fileReporter :: FilePath -> FilePath -> Result -> IO () fileReporter path nm res = do createDirectoryIfMissing True (path </> nm) writeFile (path </> nm </> "result") $ show res ------------------------------------------------------------------------------------- -- Given a circuit that returns an a, and the ...
366
fileReporter path nm res = do createDirectoryIfMissing True (path </> nm) writeFile (path </> nm </> "result") $ show res ------------------------------------------------------------------------------------- -- Given a circuit that returns an a, and the expected results, -- do some tests for sanity.
310
false
true
0
12
58
82
39
43
null
null
omefire/lens
src/Control/Lens/Lens.hs
bsd-3-clause
-- | Adjust the target of an 'IndexedLens' returning the old value, or -- adjust all of the targets of an 'Control.Lens.Traversal.IndexedTraversal' and return a monoidal summary -- of the old values along with the answer. -- -- @ -- ('<<%@~') :: 'IndexedLens' i s t a b -> (i -> a -> b) -> s -> (a, t) -...
567
(<<%@~) :: Over (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t) l <<%@~ f = l $ Indexed $ \i a -> second' (f i) (a,a)
129
l <<%@~ f = l $ Indexed $ \i a -> second' (f i) (a,a)
53
true
true
0
11
137
117
65
52
null
null
katydid/haslapse
src/Data/Katydid/Relapse/Zip.hs
bsd-3-clause
indexOf :: [Pattern] -> Pattern -> ZipEntry indexOf _ ZAny = ZipZAny
83
indexOf :: [Pattern] -> Pattern -> ZipEntry indexOf _ ZAny = ZipZAny
83
indexOf _ ZAny = ZipZAny
39
false
true
0
6
26
27
14
13
null
null
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs
mpl-2.0
-- | If set, contains a pubsub label from which to extract record timestamps. -- If left empty, record timestamps will be generated upon arrival. plTimestampLabel :: Lens' PubsubLocation (Maybe Text) plTimestampLabel = lens _plTimestampLabel (\ s a -> s{_plTimestampLabel = a})
285
plTimestampLabel :: Lens' PubsubLocation (Maybe Text) plTimestampLabel = lens _plTimestampLabel (\ s a -> s{_plTimestampLabel = a})
139
plTimestampLabel = lens _plTimestampLabel (\ s a -> s{_plTimestampLabel = a})
85
true
true
0
9
49
49
26
23
null
null
jeffreyrosenbluth/stackage
Stackage/CompleteBuild.hs
mit
finallyUpload :: Settings -> Manager -> IO () finallyUpload settings@Settings{..} man = do putStrLn "Uploading bundle to Stackage Server" mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN" token <- case mtoken of Nothing -> decodeUtf8 <$> readFile "/auth-token" Just token -> return $...
1,749
finallyUpload :: Settings -> Manager -> IO () finallyUpload settings@Settings{..} man = do putStrLn "Uploading bundle to Stackage Server" mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN" token <- case mtoken of Nothing -> decodeUtf8 <$> readFile "/auth-token" Just token -> return $...
1,749
finallyUpload settings@Settings{..} man = do putStrLn "Uploading bundle to Stackage Server" mtoken <- lookupEnv "STACKAGE_AUTH_TOKEN" token <- case mtoken of Nothing -> decodeUtf8 <$> readFile "/auth-token" Just token -> return $ pack token now <- epochTime let ghcV...
1,703
false
true
0
14
512
464
224
240
null
null
jstolarek/lattice-structure-hs
src/Signal/Wavelet/List2.hs
bsd-3-clause
dwt angles signal = dwtWorker latticeSeq tail angles extendedSignal where extendedSignal = extendEnd layers signal layers = length angles
161
dwt angles signal = dwtWorker latticeSeq tail angles extendedSignal where extendedSignal = extendEnd layers signal layers = length angles
161
dwt angles signal = dwtWorker latticeSeq tail angles extendedSignal where extendedSignal = extendEnd layers signal layers = length angles
161
false
false
0
7
42
40
19
21
null
null
ozgurakgun/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
highestFC (PUnquote tm) = highestFC tm
48
highestFC (PUnquote tm) = highestFC tm
48
highestFC (PUnquote tm) = highestFC tm
48
false
false
0
6
15
19
8
11
null
null
ddssff/rdf4h
src/Rdf4hParseMain.hs
bsd-3-clause
strValue (OutputFormat s) = s
30
strValue (OutputFormat s) = s
30
strValue (OutputFormat s) = s
30
false
false
0
6
5
16
7
9
null
null
zachsully/hakaru
haskell/Tests/Models.hs
bsd-3-clause
negate_prob :: Text negate_prob = "unsafeProb(1.0 + negate(2.0))"
65
negate_prob :: Text negate_prob = "unsafeProb(1.0 + negate(2.0))"
65
negate_prob = "unsafeProb(1.0 + negate(2.0))"
45
false
true
0
4
7
11
6
5
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x1EEB' = "\x0075\x031B\x0300"
45
decomposeChar '\x1EEB' = "\x0075\x031B\x0300"
45
decomposeChar '\x1EEB' = "\x0075\x031B\x0300"
45
false
false
0
5
3
9
4
5
null
null
ezyang/ghc
compiler/main/ErrUtils.hs
bsd-3-clause
pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc] pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag Nothing bag ]
124
pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc] pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag Nothing bag ]
124
pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag Nothing bag ]
80
false
true
0
9
18
47
22
25
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Protocol.hs
bsd-3-clause
parseQueryResult (IfThenElseW16Unit _ _ _) (IfThenElseW16LeftReply r) = Just $ exprLeft $ lit r
95
parseQueryResult (IfThenElseW16Unit _ _ _) (IfThenElseW16LeftReply r) = Just $ exprLeft $ lit r
95
parseQueryResult (IfThenElseW16Unit _ _ _) (IfThenElseW16LeftReply r) = Just $ exprLeft $ lit r
95
false
false
0
7
13
38
18
20
null
null
codemac/yi-editor
src/Yi/Monad.hs
gpl-2.0
-- | Combination of the Control.Monad.State 'modify' and 'gets' getsAndModify :: MonadState s m => (s -> (s,a)) -> m a getsAndModify f = do e <- get let (e',result) = f e put e' return result
199
getsAndModify :: MonadState s m => (s -> (s,a)) -> m a getsAndModify f = do e <- get let (e',result) = f e put e' return result
135
getsAndModify f = do e <- get let (e',result) = f e put e' return result
80
true
true
0
10
44
82
39
43
null
null
pparkkin/eta
compiler/ETA/Prelude/PrelNames.hs
bsd-3-clause
floatingClassKey = mkPreludeClassUnique 5
48
floatingClassKey = mkPreludeClassUnique 5
48
floatingClassKey = mkPreludeClassUnique 5
48
false
false
0
5
10
9
4
5
null
null
jesboat/173tourney
server-src/CS173/Actions.hs
bsd-3-clause
dbRep = db "reports"
20
dbRep = db "reports"
20
dbRep = db "reports"
20
false
false
1
5
3
13
4
9
null
null
beni55/cryptol
src/Cryptol/TypeCheck/Solver/Numeric/Simplify.hs
bsd-3-clause
crySimpStep :: Prop -> Maybe Prop crySimpStep prop = case prop of Fin x -> cryIsFin x -- Fin only on variables. x :== y -> Just (cryIsEq x y) x :> y -> Just (cryIsGt x y) x :>= y -> case (x,y) of -- XXX: DUPLICTION (K (Nat 0), _) -> Just (y :== zero) ...
1,613
crySimpStep :: Prop -> Maybe Prop crySimpStep prop = case prop of Fin x -> cryIsFin x -- Fin only on variables. x :== y -> Just (cryIsEq x y) x :> y -> Just (cryIsGt x y) x :>= y -> case (x,y) of -- XXX: DUPLICTION (K (Nat 0), _) -> Just (y :== zero) ...
1,613
crySimpStep prop = case prop of Fin x -> cryIsFin x -- Fin only on variables. x :== y -> Just (cryIsEq x y) x :> y -> Just (cryIsGt x y) x :>= y -> case (x,y) of -- XXX: DUPLICTION (K (Nat 0), _) -> Just (y :== zero) (K (Nat a), Width b) -> Just (K (...
1,579
false
true
20
17
676
700
354
346
null
null
ScrambledEggsOnToast/kdt
app-src/Tests/StaticTest.hs
mit
prop_unbalancedInsertNNEqualToLinear :: Point2d -> Property prop_unbalancedInsertNNEqualToLinear query = forAll (listOf1 arbitrary) $ \xs -> let kdm = batchInsertUnbalanced (empty pointAsList2d) $ testElements xs in nearest kdm query == nearestLinear pointAsList2d (testElements xs) query
299
prop_unbalancedInsertNNEqualToLinear :: Point2d -> Property prop_unbalancedInsertNNEqualToLinear query = forAll (listOf1 arbitrary) $ \xs -> let kdm = batchInsertUnbalanced (empty pointAsList2d) $ testElements xs in nearest kdm query == nearestLinear pointAsList2d (testElements xs) query
299
prop_unbalancedInsertNNEqualToLinear query = forAll (listOf1 arbitrary) $ \xs -> let kdm = batchInsertUnbalanced (empty pointAsList2d) $ testElements xs in nearest kdm query == nearestLinear pointAsList2d (testElements xs) query
239
false
true
0
14
43
85
40
45
null
null
danr/tfp1
Lang/Simple.hs
gpl-3.0
injectExpr :: Expr a -> R.Expr a injectExpr e0 = case e0 of Var x ts -> R.Var x ts App e1 e2 -> R.App (injectExpr e1) (injectExpr e2) Lit l tc -> R.Lit l tc
170
injectExpr :: Expr a -> R.Expr a injectExpr e0 = case e0 of Var x ts -> R.Var x ts App e1 e2 -> R.App (injectExpr e1) (injectExpr e2) Lit l tc -> R.Lit l tc
170
injectExpr e0 = case e0 of Var x ts -> R.Var x ts App e1 e2 -> R.App (injectExpr e1) (injectExpr e2) Lit l tc -> R.Lit l tc
137
false
true
0
10
49
96
44
52
null
null
victoredwardocallaghan/hbts
src/BTS/GSMCommon.hs
gpl-2.0
downlinkFreqKHz :: GSMBand -- ^ GSM band -> Int -- ^ ARFCN -> Int downlinkFreqKHz band arfcn = uplinkFreqKHz band arfcn + uplinkOffsetKHz band
178
downlinkFreqKHz :: GSMBand -- ^ GSM band -> Int -- ^ ARFCN -> Int downlinkFreqKHz band arfcn = uplinkFreqKHz band arfcn + uplinkOffsetKHz band
178
downlinkFreqKHz band arfcn = uplinkFreqKHz band arfcn + uplinkOffsetKHz band
76
false
true
0
6
59
38
19
19
null
null
apriori/daak
lib/DAAK/Algorithms/Gamo.hs
mit
solutionMergeCrossover _ _ gs = fail $ "Invalid crossover attempt with list of len " ++ show (length gs)
104
solutionMergeCrossover _ _ gs = fail $ "Invalid crossover attempt with list of len " ++ show (length gs)
104
solutionMergeCrossover _ _ gs = fail $ "Invalid crossover attempt with list of len " ++ show (length gs)
104
false
false
0
8
18
30
14
16
null
null
GaloisInc/saw-script
saw-core/src/Verifier/SAW/Prim.hs
bsd-3-clause
------------------------------------------------------------ -- Primitive operations -- coerce :: (y x :: sort 0) -> Eq (sort 0) x y -> x -> y; coerce :: () -> () -> () -> a -> a coerce _ _ _ x = x
198
coerce :: () -> () -> () -> a -> a coerce _ _ _ x = x
53
coerce _ _ _ x = x
18
true
true
0
10
40
51
25
26
null
null
imalsogreg/reflex-dom
src/Reflex/Dom/Widget/Input.hs
bsd-3-clause
--TODO: Make attributes possibly dynamic -- | Create an editable checkbox -- Note: if the "type" or "checked" attributes are provided as attributes, they will be ignored checkbox :: MonadWidget t m => Bool -> CheckboxConfig t -> m (Checkbox t) checkbox checked config = do attrs <- mapDyn (\c -> Map.insert "type" "c...
819
checkbox :: MonadWidget t m => Bool -> CheckboxConfig t -> m (Checkbox t) checkbox checked config = do attrs <- mapDyn (\c -> Map.insert "type" "checkbox" $ (if checked then Map.insert "checked" "checked" else Map.delete "checked") c) (_checkboxConfig_attributes config) e <- liftM castToHTMLInputElement $ buildEmpt...
647
checkbox checked config = do attrs <- mapDyn (\c -> Map.insert "type" "checkbox" $ (if checked then Map.insert "checked" "checked" else Map.delete "checked") c) (_checkboxConfig_attributes config) e <- liftM castToHTMLInputElement $ buildEmptyElement "input" attrs eClick <- wrapDomEvent e elementOnclick $ liftIO ...
573
true
true
0
16
126
227
107
120
null
null
rprospero/PhotoAlign
Main.hs
mit
upgrade :: (Monad m) => Maybe a -> MaybeT m a upgrade = MaybeT . return
71
upgrade :: (Monad m) => Maybe a -> MaybeT m a upgrade = MaybeT . return
71
upgrade = MaybeT . return
25
false
true
0
7
15
36
18
18
null
null
vladfi1/hs-misc
ExpressionHOS.hs
mit
-- call by value eval :: Exp t a -> a eval (Ret a) = a
55
eval :: Exp t a -> a eval (Ret a) = a
37
eval (Ret a) = a
16
true
true
0
9
16
36
16
20
null
null
Fuuzetsu/cabal2nix
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs
bsd-3-clause
libNixName x = return (guessNixIdentifier x)
79
libNixName x = return (guessNixIdentifier x)
79
libNixName x = return (guessNixIdentifier x)
79
false
false
0
7
40
18
8
10
null
null
capitanbatata/sandbox
free-monads/src/TestDSL.hs
gpl-3.0
createN :: Int -> EntityType -> Free (TestCommand e) [e] createN n et = mapM (const $ create et) [0..n-1]
105
createN :: Int -> EntityType -> Free (TestCommand e) [e] createN n et = mapM (const $ create et) [0..n-1]
105
createN n et = mapM (const $ create et) [0..n-1]
48
false
true
0
9
19
62
31
31
null
null
sdiehl/ghc
compiler/coreSyn/CoreMap.hs
bsd-3-clause
extendCoreMap :: CoreMap a -> CoreExpr -> a -> CoreMap a extendCoreMap m e v = alterTM e (\_ -> Just v) m
105
extendCoreMap :: CoreMap a -> CoreExpr -> a -> CoreMap a extendCoreMap m e v = alterTM e (\_ -> Just v) m
105
extendCoreMap m e v = alterTM e (\_ -> Just v) m
48
false
true
0
8
22
54
26
28
null
null
Fornost461/drafts-and-stuff
Haskell/projects/colors/Color.hs
cc0-1.0
res5 = signum c2
16
res5 = signum c2
16
res5 = signum c2
16
false
false
0
5
3
9
4
5
null
null