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
facebookincubator/duckling
Duckling/Rules.hs
bsd-3-clause
defaultRules ID = IDRules.defaultRules
38
defaultRules ID = IDRules.defaultRules
38
defaultRules ID = IDRules.defaultRules
38
false
false
0
5
3
11
5
6
null
null
kylcarte/threepenny-extras
src/Foundation/Layout.hs
bsd-3-clause
uniformGridSize :: Int -> [a] -> Grid a uniformGridSize smSize = Grid (Just smSize) Nothing
91
uniformGridSize :: Int -> [a] -> Grid a uniformGridSize smSize = Grid (Just smSize) Nothing
91
uniformGridSize smSize = Grid (Just smSize) Nothing
51
false
true
0
7
14
39
19
20
null
null
Cahu/krpc-hs
examples/FlightRecorderCSV.hs
gpl-3.0
printTelemetryCSV :: TelemetryData -> IO () printTelemetryCSV TelemetryData{..} = putStrLn $ intercalate ";" [show time, show altitude, show latitude, show longitude, show mass, show thrust]
194
printTelemetryCSV :: TelemetryData -> IO () printTelemetryCSV TelemetryData{..} = putStrLn $ intercalate ";" [show time, show altitude, show latitude, show longitude, show mass, show thrust]
194
printTelemetryCSV TelemetryData{..} = putStrLn $ intercalate ";" [show time, show altitude, show latitude, show longitude, show mass, show thrust]
150
false
true
3
7
28
86
38
48
null
null
ekmett/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr _ = panic "X86.Ppr.pprInstr: no match"
55
pprInstr _ = panic "X86.Ppr.pprInstr: no match"
55
pprInstr _ = panic "X86.Ppr.pprInstr: no match"
55
false
false
0
5
14
12
5
7
null
null
mzero/plush
src/Plush/Run/Posix/Utilities.hs
apache-2.0
outStrLn = writeStrLn stdOutput
31
outStrLn = writeStrLn stdOutput
31
outStrLn = writeStrLn stdOutput
31
false
false
1
5
3
13
4
9
null
null
x-y-z/cabal
Cabal/Distribution/Simple/Build.hs
bsd-3-clause
replComponent verbosity pkg_descr lbi0 suffixes comp@(CTest test@TestSuite { testInterface = TestSuiteLibV09{} }) clbi distPref = do pwd <- getCurrentDirectory let (pkg, lib, libClbi, lbi, _, _, _) = testSuiteLibV09AsLibAndExe pkg_descr test clbi lbi0 distPref pwd preprocessComponent pkg_descr comp lbi False verbosity suffixes extras <- preprocessExtras comp lbi let libbi = libBuildInfo lib lib' = lib { libBuildInfo = libbi { cSources = cSources libbi ++ extras } } replLib verbosity pkg lbi lib' libClbi
597
replComponent verbosity pkg_descr lbi0 suffixes comp@(CTest test@TestSuite { testInterface = TestSuiteLibV09{} }) clbi distPref = do pwd <- getCurrentDirectory let (pkg, lib, libClbi, lbi, _, _, _) = testSuiteLibV09AsLibAndExe pkg_descr test clbi lbi0 distPref pwd preprocessComponent pkg_descr comp lbi False verbosity suffixes extras <- preprocessExtras comp lbi let libbi = libBuildInfo lib lib' = lib { libBuildInfo = libbi { cSources = cSources libbi ++ extras } } replLib verbosity pkg lbi lib' libClbi
597
replComponent verbosity pkg_descr lbi0 suffixes comp@(CTest test@TestSuite { testInterface = TestSuiteLibV09{} }) clbi distPref = do pwd <- getCurrentDirectory let (pkg, lib, libClbi, lbi, _, _, _) = testSuiteLibV09AsLibAndExe pkg_descr test clbi lbi0 distPref pwd preprocessComponent pkg_descr comp lbi False verbosity suffixes extras <- preprocessExtras comp lbi let libbi = libBuildInfo lib lib' = lib { libBuildInfo = libbi { cSources = cSources libbi ++ extras } } replLib verbosity pkg lbi lib' libClbi
597
false
false
0
15
162
181
90
91
null
null
ethercrow/ai-challenger
game-grid/Grid.hs
mit
gridScore :: Grid -> Score gridScore (Grid tiles) = Score s1 s2 where (Sum s1, Sum s2) = foldMap (foldMap (\case Empty -> (mempty, mempty) Captured (PlayerId 1) -> (Sum 1, mempty) Captured (PlayerId 2) -> (mempty, Sum 1) Captured (PlayerId n) -> error ("Unexpected PlayerId " <> show n))) tiles
422
gridScore :: Grid -> Score gridScore (Grid tiles) = Score s1 s2 where (Sum s1, Sum s2) = foldMap (foldMap (\case Empty -> (mempty, mempty) Captured (PlayerId 1) -> (Sum 1, mempty) Captured (PlayerId 2) -> (mempty, Sum 1) Captured (PlayerId n) -> error ("Unexpected PlayerId " <> show n))) tiles
422
gridScore (Grid tiles) = Score s1 s2 where (Sum s1, Sum s2) = foldMap (foldMap (\case Empty -> (mempty, mempty) Captured (PlayerId 1) -> (Sum 1, mempty) Captured (PlayerId 2) -> (mempty, Sum 1) Captured (PlayerId n) -> error ("Unexpected PlayerId " <> show n))) tiles
395
false
true
0
14
178
162
77
85
null
null
frantisekfarka/ghc-dsi
compiler/cmm/CmmBuildInfoTables.hs
bsd-3-clause
srtToData :: TopSRT -> CmmGroup srtToData srt = [CmmData RelocatableReadOnlyData (Statics (lbl srt) tbl)] where tbl = map (CmmStaticLit . CmmLabel) (reverse (rev_elts srt)) -- Once we have found the CAFs, we need to do two things: -- 1. Build a table of all the CAFs used in the procedure. -- 2. Compute the C_SRT describing the subset of CAFs live at each procpoint. -- -- When building the local view of the SRT, we first make sure that all the CAFs are -- in the SRT. Then, if the number of CAFs is small enough to fit in a bitmap, -- we make sure they're all close enough to the bottom of the table that the -- bitmap will be able to cover all of them.
661
srtToData :: TopSRT -> CmmGroup srtToData srt = [CmmData RelocatableReadOnlyData (Statics (lbl srt) tbl)] where tbl = map (CmmStaticLit . CmmLabel) (reverse (rev_elts srt)) -- Once we have found the CAFs, we need to do two things: -- 1. Build a table of all the CAFs used in the procedure. -- 2. Compute the C_SRT describing the subset of CAFs live at each procpoint. -- -- When building the local view of the SRT, we first make sure that all the CAFs are -- in the SRT. Then, if the number of CAFs is small enough to fit in a bitmap, -- we make sure they're all close enough to the bottom of the table that the -- bitmap will be able to cover all of them.
661
srtToData srt = [CmmData RelocatableReadOnlyData (Statics (lbl srt) tbl)] where tbl = map (CmmStaticLit . CmmLabel) (reverse (rev_elts srt)) -- Once we have found the CAFs, we need to do two things: -- 1. Build a table of all the CAFs used in the procedure. -- 2. Compute the C_SRT describing the subset of CAFs live at each procpoint. -- -- When building the local view of the SRT, we first make sure that all the CAFs are -- in the SRT. Then, if the number of CAFs is small enough to fit in a bitmap, -- we make sure they're all close enough to the bottom of the table that the -- bitmap will be able to cover all of them.
629
false
true
0
10
131
80
44
36
null
null
siddhanathan/ghc
testsuite/tests/numeric/should_run/T7014.hs
bsd-3-clause
test_addf2 :: Float -> Float test_addf2 x = 0 + x
49
test_addf2 :: Float -> Float test_addf2 x = 0 + x
49
test_addf2 x = 0 + x
20
false
true
0
5
10
22
11
11
null
null
Heather/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
hasValidIBCVersion :: FilePath -> Idris Bool hasValidIBCVersion fp = do archiveFile <- runIO $ B.readFile fp case toArchiveOrFail archiveFile of Left _ -> return False Right archive -> do ver <- getEntry 0 "ver" archive return (ver == ibcVersion)
282
hasValidIBCVersion :: FilePath -> Idris Bool hasValidIBCVersion fp = do archiveFile <- runIO $ B.readFile fp case toArchiveOrFail archiveFile of Left _ -> return False Right archive -> do ver <- getEntry 0 "ver" archive return (ver == ibcVersion)
282
hasValidIBCVersion fp = do archiveFile <- runIO $ B.readFile fp case toArchiveOrFail archiveFile of Left _ -> return False Right archive -> do ver <- getEntry 0 "ver" archive return (ver == ibcVersion)
237
false
true
0
14
74
95
42
53
null
null
eklinkhammer/haskell-vision
src/ImageRep/Utility.hs
mit
onTop :: Int -> DIM2 -> Bool onTop height (Z :. y :. _) = y == (height - 1)
75
onTop :: Int -> DIM2 -> Bool onTop height (Z :. y :. _) = y == (height - 1)
75
onTop height (Z :. y :. _) = y == (height - 1)
46
false
true
0
11
19
52
25
27
null
null
ollef/Grempa
Data/Parser/Grempa/Grammar/Untyped.hs
bsd-3-clause
follow' :: Token s => RId s -> RId s -> [RId s] -> Done (RId s) () (Set (Tok s)) follow' rid startrid rids = ifNotDoneG rid (const S.empty) $ do putDone rid () (if rid == startrid then S.insert EOF else id) <$> S.unions <$> sequence [followProd prod a | a@(RId _ prods) <- rids , prod <- prods] where followProd [] _ = return S.empty followProd (b:beta) a | b == SRule rid = S.union rest <$> liftM2 S.union (followProd beta a) (if Epsilon `S.member` firstbeta then follow' a startrid rids else return S.empty) | otherwise = followProd beta a where firstbeta = firstProd beta rest = S.map (Tok . unETok) $ S.delete Epsilon firstbeta
931
follow' :: Token s => RId s -> RId s -> [RId s] -> Done (RId s) () (Set (Tok s)) follow' rid startrid rids = ifNotDoneG rid (const S.empty) $ do putDone rid () (if rid == startrid then S.insert EOF else id) <$> S.unions <$> sequence [followProd prod a | a@(RId _ prods) <- rids , prod <- prods] where followProd [] _ = return S.empty followProd (b:beta) a | b == SRule rid = S.union rest <$> liftM2 S.union (followProd beta a) (if Epsilon `S.member` firstbeta then follow' a startrid rids else return S.empty) | otherwise = followProd beta a where firstbeta = firstProd beta rest = S.map (Tok . unETok) $ S.delete Epsilon firstbeta
931
follow' rid startrid rids = ifNotDoneG rid (const S.empty) $ do putDone rid () (if rid == startrid then S.insert EOF else id) <$> S.unions <$> sequence [followProd prod a | a@(RId _ prods) <- rids , prod <- prods] where followProd [] _ = return S.empty followProd (b:beta) a | b == SRule rid = S.union rest <$> liftM2 S.union (followProd beta a) (if Epsilon `S.member` firstbeta then follow' a startrid rids else return S.empty) | otherwise = followProd beta a where firstbeta = firstProd beta rest = S.map (Tok . unETok) $ S.delete Epsilon firstbeta
850
false
true
0
15
417
333
161
172
null
null
tekul/cryptonite
Crypto/Cipher/ChaCha.hs
bsd-3-clause
generateSimple :: ByteArray ba => StateSimple -> Int -> (ba, StateSimple) generateSimple (StateSimple prevSt) nbBytes = unsafeDoIO $ do newSt <- B.copy prevSt (\_ -> return ()) output <- B.alloc nbBytes $ \dstPtr -> B.withByteArray newSt $ \stPtr -> ccryptonite_chacha_random 8 dstPtr stPtr (fromIntegral nbBytes) return (output, StateSimple newSt)
426
generateSimple :: ByteArray ba => StateSimple -> Int -> (ba, StateSimple) generateSimple (StateSimple prevSt) nbBytes = unsafeDoIO $ do newSt <- B.copy prevSt (\_ -> return ()) output <- B.alloc nbBytes $ \dstPtr -> B.withByteArray newSt $ \stPtr -> ccryptonite_chacha_random 8 dstPtr stPtr (fromIntegral nbBytes) return (output, StateSimple newSt)
426
generateSimple (StateSimple prevSt) nbBytes = unsafeDoIO $ do newSt <- B.copy prevSt (\_ -> return ()) output <- B.alloc nbBytes $ \dstPtr -> B.withByteArray newSt $ \stPtr -> ccryptonite_chacha_random 8 dstPtr stPtr (fromIntegral nbBytes) return (output, StateSimple newSt)
307
false
true
0
15
126
139
68
71
null
null
todays-mitsui/discussion
src/Discussion/Bool.hs
mit
isClosed' vs (Lambda vs' t) = isClosed' (vs ++ vs') t
53
isClosed' vs (Lambda vs' t) = isClosed' (vs ++ vs') t
53
isClosed' vs (Lambda vs' t) = isClosed' (vs ++ vs') t
53
false
false
0
7
10
31
15
16
null
null
angerman/data-bitcode-edsl
src/EDSL/Example/HelloBranch.hs
bsd-3-clause
helloBranch, helloBranch2, helloPtrFn, helloWorld, gepFun, binOpFun, prefixDataFun :: Module helloBranch = mod "helloWorld" [ def "main" ([i32, ptr =<< i8ptr] --> i32) $ \[ argc, _argv ] -> mdo block "entry" $ do constOne <- int32 1 cond <- argc `iugt` constOne br cond one two one <- block "one" $ do strPtr <- bind2 gep (global private "one" =<< cStr "One") (sequence [int32 0, int32 0]) puts <- fun "puts" =<< [i8ptr] --> i32 ccall puts [strPtr] ret =<< int32 0 two <- block "two" $ do two <- global private "two" =<< cStr "Two" strPtr <- gep two =<< sequence [int32 0, int32 0] f <- fun "puts" =<< [i8ptr] --> i32 ccall f [strPtr] ret =<< int32 0 pure () ]
787
helloBranch, helloBranch2, helloPtrFn, helloWorld, gepFun, binOpFun, prefixDataFun :: Module helloBranch = mod "helloWorld" [ def "main" ([i32, ptr =<< i8ptr] --> i32) $ \[ argc, _argv ] -> mdo block "entry" $ do constOne <- int32 1 cond <- argc `iugt` constOne br cond one two one <- block "one" $ do strPtr <- bind2 gep (global private "one" =<< cStr "One") (sequence [int32 0, int32 0]) puts <- fun "puts" =<< [i8ptr] --> i32 ccall puts [strPtr] ret =<< int32 0 two <- block "two" $ do two <- global private "two" =<< cStr "Two" strPtr <- gep two =<< sequence [int32 0, int32 0] f <- fun "puts" =<< [i8ptr] --> i32 ccall f [strPtr] ret =<< int32 0 pure () ]
786
helloBranch = mod "helloWorld" [ def "main" ([i32, ptr =<< i8ptr] --> i32) $ \[ argc, _argv ] -> mdo block "entry" $ do constOne <- int32 1 cond <- argc `iugt` constOne br cond one two one <- block "one" $ do strPtr <- bind2 gep (global private "one" =<< cStr "One") (sequence [int32 0, int32 0]) puts <- fun "puts" =<< [i8ptr] --> i32 ccall puts [strPtr] ret =<< int32 0 two <- block "two" $ do two <- global private "two" =<< cStr "Two" strPtr <- gep two =<< sequence [int32 0, int32 0] f <- fun "puts" =<< [i8ptr] --> i32 ccall f [strPtr] ret =<< int32 0 pure () ]
693
false
true
3
20
250
335
158
177
null
null
wavewave/hoodle-core
src/Hoodle/Type/Canvas.hs
gpl-3.0
-- | defaultHighligherWCS :: WidthColorStyle defaultHighligherWCS = WidthColorStyle predefined_highlighter_medium ColorYellow
126
defaultHighligherWCS :: WidthColorStyle defaultHighligherWCS = WidthColorStyle predefined_highlighter_medium ColorYellow
120
defaultHighligherWCS = WidthColorStyle predefined_highlighter_medium ColorYellow
80
true
true
0
5
10
17
9
8
null
null
snoyberg/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
-- Base strings Strings unpackCStringName, unpackCStringFoldrName, unpackCStringUtf8Name, eqStringName :: Name unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
204
unpackCStringName, unpackCStringFoldrName, unpackCStringUtf8Name, eqStringName :: Name unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
180
unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey
89
true
true
0
7
26
31
19
12
null
null
DanielWaterworth/Idris-dev
src/Idris/ElabTerm.hs
bsd-3-clause
reifyReportPart (App (P (DCon _ _) n _) ttn) | n == reflErrName "NamePart" = case runElab [] (reifyTTName ttn) (initElaborator NErased initContext Erased) of Error e -> Left . InternalMsg $ "could not reify name term " ++ show ttn ++ " when reflecting an error:" ++ show e OK (n', _)-> Right $ NamePart n'
344
reifyReportPart (App (P (DCon _ _) n _) ttn) | n == reflErrName "NamePart" = case runElab [] (reifyTTName ttn) (initElaborator NErased initContext Erased) of Error e -> Left . InternalMsg $ "could not reify name term " ++ show ttn ++ " when reflecting an error:" ++ show e OK (n', _)-> Right $ NamePart n'
344
reifyReportPart (App (P (DCon _ _) n _) ttn) | n == reflErrName "NamePart" = case runElab [] (reifyTTName ttn) (initElaborator NErased initContext Erased) of Error e -> Left . InternalMsg $ "could not reify name term " ++ show ttn ++ " when reflecting an error:" ++ show e OK (n', _)-> Right $ NamePart n'
344
false
false
0
13
95
135
63
72
null
null
a143753/AOJ
0300.hs
apache-2.0
trn 'W' x = foldl (\x p -> swap p x) x patw
43
trn 'W' x = foldl (\x p -> swap p x) x patw
43
trn 'W' x = foldl (\x p -> swap p x) x patw
43
false
false
1
8
12
38
16
22
null
null
anton-k/sharc-timbre
src/Sharc/Instruments/Clarinet.hs
bsd-3-clause
note14 :: Note note14 = Note (Pitch 329.628 52 "e4") 15 (Range (NoteRange (NoteRangeAmplitude 9888.84 30 0.6) (NoteRangeHarmonicFreq 1 329.62)) (NoteRange (NoteRangeAmplitude 1648.14 5 1791.0) (NoteRangeHarmonicFreq 30 9888.84))) [Harmonic 1 1.631 1253.59 ,Harmonic 2 1.274 60.12 ,Harmonic 3 2.483 1154.11 ,Harmonic 4 0.669 403.22 ,Harmonic 5 0.661 1791.0 ,Harmonic 6 0.781 64.14 ,Harmonic 7 (-2.386) 526.62 ,Harmonic 8 (-1.513) 235.53 ,Harmonic 9 2.242 171.61 ,Harmonic 10 (-2.717) 149.91 ,Harmonic 11 (-0.762) 126.34 ,Harmonic 12 1.057 219.11 ,Harmonic 13 (-0.115) 57.9 ,Harmonic 14 (-1.719) 119.37 ,Harmonic 15 3.1e-2 63.78 ,Harmonic 16 2.968 10.97 ,Harmonic 17 (-1.88) 65.98 ,Harmonic 18 (-1.613) 10.66 ,Harmonic 19 1.181 24.21 ,Harmonic 20 (-1.798) 1.11 ,Harmonic 21 (-0.655) 6.43 ,Harmonic 22 (-0.827) 6.52 ,Harmonic 23 2.184 5.91 ,Harmonic 24 1.107 4.07 ,Harmonic 25 2.081 3.57 ,Harmonic 26 1.318 1.86 ,Harmonic 27 (-1.116) 1.85 ,Harmonic 28 (-1.841) 2.23 ,Harmonic 29 2.932 0.86 ,Harmonic 30 (-2.002) 0.6]
1,209
note14 :: Note note14 = Note (Pitch 329.628 52 "e4") 15 (Range (NoteRange (NoteRangeAmplitude 9888.84 30 0.6) (NoteRangeHarmonicFreq 1 329.62)) (NoteRange (NoteRangeAmplitude 1648.14 5 1791.0) (NoteRangeHarmonicFreq 30 9888.84))) [Harmonic 1 1.631 1253.59 ,Harmonic 2 1.274 60.12 ,Harmonic 3 2.483 1154.11 ,Harmonic 4 0.669 403.22 ,Harmonic 5 0.661 1791.0 ,Harmonic 6 0.781 64.14 ,Harmonic 7 (-2.386) 526.62 ,Harmonic 8 (-1.513) 235.53 ,Harmonic 9 2.242 171.61 ,Harmonic 10 (-2.717) 149.91 ,Harmonic 11 (-0.762) 126.34 ,Harmonic 12 1.057 219.11 ,Harmonic 13 (-0.115) 57.9 ,Harmonic 14 (-1.719) 119.37 ,Harmonic 15 3.1e-2 63.78 ,Harmonic 16 2.968 10.97 ,Harmonic 17 (-1.88) 65.98 ,Harmonic 18 (-1.613) 10.66 ,Harmonic 19 1.181 24.21 ,Harmonic 20 (-1.798) 1.11 ,Harmonic 21 (-0.655) 6.43 ,Harmonic 22 (-0.827) 6.52 ,Harmonic 23 2.184 5.91 ,Harmonic 24 1.107 4.07 ,Harmonic 25 2.081 3.57 ,Harmonic 26 1.318 1.86 ,Harmonic 27 (-1.116) 1.85 ,Harmonic 28 (-1.841) 2.23 ,Harmonic 29 2.932 0.86 ,Harmonic 30 (-2.002) 0.6]
1,209
note14 = Note (Pitch 329.628 52 "e4") 15 (Range (NoteRange (NoteRangeAmplitude 9888.84 30 0.6) (NoteRangeHarmonicFreq 1 329.62)) (NoteRange (NoteRangeAmplitude 1648.14 5 1791.0) (NoteRangeHarmonicFreq 30 9888.84))) [Harmonic 1 1.631 1253.59 ,Harmonic 2 1.274 60.12 ,Harmonic 3 2.483 1154.11 ,Harmonic 4 0.669 403.22 ,Harmonic 5 0.661 1791.0 ,Harmonic 6 0.781 64.14 ,Harmonic 7 (-2.386) 526.62 ,Harmonic 8 (-1.513) 235.53 ,Harmonic 9 2.242 171.61 ,Harmonic 10 (-2.717) 149.91 ,Harmonic 11 (-0.762) 126.34 ,Harmonic 12 1.057 219.11 ,Harmonic 13 (-0.115) 57.9 ,Harmonic 14 (-1.719) 119.37 ,Harmonic 15 3.1e-2 63.78 ,Harmonic 16 2.968 10.97 ,Harmonic 17 (-1.88) 65.98 ,Harmonic 18 (-1.613) 10.66 ,Harmonic 19 1.181 24.21 ,Harmonic 20 (-1.798) 1.11 ,Harmonic 21 (-0.655) 6.43 ,Harmonic 22 (-0.827) 6.52 ,Harmonic 23 2.184 5.91 ,Harmonic 24 1.107 4.07 ,Harmonic 25 2.081 3.57 ,Harmonic 26 1.318 1.86 ,Harmonic 27 (-1.116) 1.85 ,Harmonic 28 (-1.841) 2.23 ,Harmonic 29 2.932 0.86 ,Harmonic 30 (-2.002) 0.6]
1,194
false
true
0
11
343
460
237
223
null
null
olsner/ghc
compiler/types/Type.hs
bsd-3-clause
equalityTyCon Phantom = eqPhantPrimTyCon
49
equalityTyCon Phantom = eqPhantPrimTyCon
49
equalityTyCon Phantom = eqPhantPrimTyCon
49
false
false
0
5
12
9
4
5
null
null
fedep3/Metaheuriscticas-Data-Clustering
Tests/src/Files.hs
gpl-2.0
-- | Comando para encontrar el ID de un conjunto de parámetros. selectParamGA :: String selectParamGA = "SELECT gap_id\ \ FROM geneticop WHERE\ \ gap_i = ?\ \ AND gap_cr = ?\ \ AND gap_mr = ?\ \ AND gap_ts = ?"
290
selectParamGA :: String selectParamGA = "SELECT gap_id\ \ FROM geneticop WHERE\ \ gap_i = ?\ \ AND gap_cr = ?\ \ AND gap_mr = ?\ \ AND gap_ts = ?"
226
selectParamGA = "SELECT gap_id\ \ FROM geneticop WHERE\ \ gap_i = ?\ \ AND gap_cr = ?\ \ AND gap_mr = ?\ \ AND gap_ts = ?"
202
true
true
0
4
121
12
7
5
null
null
hbrouwer/pdrt-sandbox
src/Data/DRS/Show.hs
apache-2.0
showContent :: Int -> String -> String showContent l s = unlines (map show' (lines s)) where show' :: String -> String show' s' = [boxVerLine] ++ " " ++ s' ++ showWhitespace (l - 4 - length s') ++ " " ++ [boxVerLine] --------------------------------------------------------------------------- -- | Shows a horizontal line of length @l@ with left corner symbol @lc@ and -- right corner symbol @rc@. ---------------------------------------------------------------------------
484
showContent :: Int -> String -> String showContent l s = unlines (map show' (lines s)) where show' :: String -> String show' s' = [boxVerLine] ++ " " ++ s' ++ showWhitespace (l - 4 - length s') ++ " " ++ [boxVerLine] --------------------------------------------------------------------------- -- | Shows a horizontal line of length @l@ with left corner symbol @lc@ and -- right corner symbol @rc@. ---------------------------------------------------------------------------
484
showContent l s = unlines (map show' (lines s)) where show' :: String -> String show' s' = [boxVerLine] ++ " " ++ s' ++ showWhitespace (l - 4 - length s') ++ " " ++ [boxVerLine] --------------------------------------------------------------------------- -- | Shows a horizontal line of length @l@ with left corner symbol @lc@ and -- right corner symbol @rc@. ---------------------------------------------------------------------------
445
false
true
0
11
76
119
58
61
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * Cluster Verify error classes cvTcluster :: String cvTcluster = "cluster"
78
cvTcluster :: String cvTcluster = "cluster"
43
cvTcluster = "cluster"
22
true
true
0
6
12
19
8
11
null
null
SkyA1ex/tetris
src/World.hs
bsd-3-clause
shiftLeftFigure :: TetrisGame -> TetrisGame shiftLeftFigure curTetrisGame@(Game ff (shiftLeft -> fpos) spos fc nc w h fs grid hrd scr fcnt isPs go km) | goodCoords grid w h (getRealCoords ff fpos) = Game ff fpos spos fc nc w h fs grid hrd scr fcnt isPs go km | otherwise = curTetrisGame
290
shiftLeftFigure :: TetrisGame -> TetrisGame shiftLeftFigure curTetrisGame@(Game ff (shiftLeft -> fpos) spos fc nc w h fs grid hrd scr fcnt isPs go km) | goodCoords grid w h (getRealCoords ff fpos) = Game ff fpos spos fc nc w h fs grid hrd scr fcnt isPs go km | otherwise = curTetrisGame
290
shiftLeftFigure curTetrisGame@(Game ff (shiftLeft -> fpos) spos fc nc w h fs grid hrd scr fcnt isPs go km) | goodCoords grid w h (getRealCoords ff fpos) = Game ff fpos spos fc nc w h fs grid hrd scr fcnt isPs go km | otherwise = curTetrisGame
246
false
true
1
10
56
124
61
63
null
null
ulricha/dsh
src/Database/DSH/NKL/Rewrite.hs
bsd-3-clause
unusedBindingR :: RewriteN Expr unusedBindingR = do Let _ x _ e2 <- idR 0 <- childT LetBody $ countVarRefT x return e2 -- | Inline a let-binding that is only referenced once.
198
unusedBindingR :: RewriteN Expr unusedBindingR = do Let _ x _ e2 <- idR 0 <- childT LetBody $ countVarRefT x return e2 -- | Inline a let-binding that is only referenced once.
198
unusedBindingR = do Let _ x _ e2 <- idR 0 <- childT LetBody $ countVarRefT x return e2 -- | Inline a let-binding that is only referenced once.
166
false
true
0
9
56
54
24
30
null
null
GaloisInc/halvm-ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
cmpEqTick (CaseOfCase a) (CaseOfCase b) = a `compare` b
87
cmpEqTick (CaseOfCase a) (CaseOfCase b) = a `compare` b
87
cmpEqTick (CaseOfCase a) (CaseOfCase b) = a `compare` b
87
false
false
0
6
40
31
15
16
null
null
brendanhay/semver
src/Data/SemVer/Delimited.hs
mpl-2.0
-- | Lens for the patch version delimiter. Default: @.@ patch :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters patch f x = (\y -> x { _delimPatch = y }) <$> f (_delimPatch x)
188
patch :: Functor f => (Char -> f Char) -> Delimiters -> f Delimiters patch f x = (\y -> x { _delimPatch = y }) <$> f (_delimPatch x)
132
patch f x = (\y -> x { _delimPatch = y }) <$> f (_delimPatch x)
63
true
true
0
9
39
74
38
36
null
null
vrom911/hs-init
summoner-cli/src/Summoner/Question.hs
mit
printQuestion question (def:rest) = do putStrFlush $ question <> boldDefault def let restSlash = T.intercalate "/" rest if restSlash == "" then putTextLn "" else putTextLn $ "/" <> restSlash -- | Allows users to choose one of the given options. -- It asks the question until the appropriate answer is received.
331
printQuestion question (def:rest) = do putStrFlush $ question <> boldDefault def let restSlash = T.intercalate "/" rest if restSlash == "" then putTextLn "" else putTextLn $ "/" <> restSlash -- | Allows users to choose one of the given options. -- It asks the question until the appropriate answer is received.
331
printQuestion question (def:rest) = do putStrFlush $ question <> boldDefault def let restSlash = T.intercalate "/" rest if restSlash == "" then putTextLn "" else putTextLn $ "/" <> restSlash -- | Allows users to choose one of the given options. -- It asks the question until the appropriate answer is received.
331
false
false
0
11
72
76
37
39
null
null
cirquit/hjc
src/Cmm/X86/Backend.hs
mit
-- | Main function -- generatex86 :: MiniJava -> IO X86Prog generatex86 ast = runNameGenT $ generatex86Gen ast
110
generatex86 :: MiniJava -> IO X86Prog generatex86 ast = runNameGenT $ generatex86Gen ast
88
generatex86 ast = runNameGenT $ generatex86Gen ast
50
true
true
0
6
17
30
15
15
null
null
MetaMemoryT/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
expandNS :: SyntaxInfo -> Name -> Name expandNS syn n@(NS _ _) = n
66
expandNS :: SyntaxInfo -> Name -> Name expandNS syn n@(NS _ _) = n
66
expandNS syn n@(NS _ _) = n
27
false
true
0
8
13
35
18
17
null
null
jfoutz/language-bash
src/Language/Bash/Parse/Builder.hs
bsd-3-clause
-- | 'Builder' version of 'P.oneOf'. oneOf :: Stream s m Char => [Char] -> ParsecT s u m Builder oneOf cs = fromChar <$> P.oneOf cs
131
oneOf :: Stream s m Char => [Char] -> ParsecT s u m Builder oneOf cs = fromChar <$> P.oneOf cs
94
oneOf cs = fromChar <$> P.oneOf cs
34
true
true
0
7
26
51
25
26
null
null
TomMD/ghc
compiler/prelude/THNames.hs
bsd-3-clause
qTyConKey = mkPreludeTyConUnique 203
50
qTyConKey = mkPreludeTyConUnique 203
50
qTyConKey = mkPreludeTyConUnique 203
50
false
false
0
5
17
9
4
5
null
null
nilthehuman/H-99
BinaryTrees.hs
unlicense
fullTree l x = let oneLower = fullTree (pred l) x in Branch x oneLower oneLower
79
fullTree l x = let oneLower = fullTree (pred l) x in Branch x oneLower oneLower
79
fullTree l x = let oneLower = fullTree (pred l) x in Branch x oneLower oneLower
79
false
false
0
11
15
40
18
22
null
null
brendanhay/gogol
gogol-adexchangebuyer2/gen/Network/Google/AdExchangeBuyer2/Types/Product.hs
mpl-2.0
-- | Operating system related targeting information. ttOperatingSystemTargeting :: Lens' TechnologyTargeting (Maybe OperatingSystemTargeting) ttOperatingSystemTargeting = lens _ttOperatingSystemTargeting (\ s a -> s{_ttOperatingSystemTargeting = a})
257
ttOperatingSystemTargeting :: Lens' TechnologyTargeting (Maybe OperatingSystemTargeting) ttOperatingSystemTargeting = lens _ttOperatingSystemTargeting (\ s a -> s{_ttOperatingSystemTargeting = a})
204
ttOperatingSystemTargeting = lens _ttOperatingSystemTargeting (\ s a -> s{_ttOperatingSystemTargeting = a})
115
true
true
1
9
31
52
25
27
null
null
ezyang/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
smallArrayPrimTyCon = pcPrimTyCon smallArrayPrimTyConName [Representational] UnliftedRep
102
smallArrayPrimTyCon = pcPrimTyCon smallArrayPrimTyConName [Representational] UnliftedRep
102
smallArrayPrimTyCon = pcPrimTyCon smallArrayPrimTyConName [Representational] UnliftedRep
102
false
false
0
6
19
16
8
8
null
null
JoeLoser/CS4450-Principles-of-Programming
homeworks/hw2/hw2_jrlmwc.hs
mit
xor' F F = F
12
xor' F F = F
12
xor' F F = F
12
false
false
1
5
4
16
5
11
null
null
metabrainz/musicbrainz-data-service
src/MusicBrainz/API/Label.hs
gpl-2.0
-------------------------------------------------------------------------------- viewIpiCodes :: Form Text MusicBrainz (Map.Map (Ref (Revision Label)) (Set.Set IPI)) viewIpiCodes = Common.viewIpiCodes
200
viewIpiCodes :: Form Text MusicBrainz (Map.Map (Ref (Revision Label)) (Set.Set IPI)) viewIpiCodes = Common.viewIpiCodes
119
viewIpiCodes = Common.viewIpiCodes
34
true
true
1
11
14
57
26
31
null
null
RocketPuppy/PupCollide
Demo.hs
gpl-3.0
-- |Initial OpenGL setup function. The interesting thing here is that -- we fork a thread using 'checkEvents' to check for events. main :: IO () main = do args <- getArgs let ip = args !! 0 let priorities = read (args !! 1) :: Int (progname, _) <- GLUT.getArgsAndInitialize (outqueue, inqueue) <- Events.doClient (Just ip) priorities GLUT.createWindow "Hello World" GLUT.initialDisplayMode $= [GLUT.DoubleBuffered, GLUT.RGBAMode] GLUT.keyboardMouseCallback $=! Just (keyboardMouse inqueue outqueue) GLUT.displayCallback $=! render forkOS $ checkEvents inqueue GL.clearColor $= GL.Color4 0 0 0 1 GL.blend $= GL.Enabled GL.blendFunc $= (GL.SrcAlpha, GL.OneMinusSrcAlpha) GL.lineSmooth $= GL.Enabled GL.pointSmooth $= GL.Enabled GL.polygonSmooth $= GL.Enabled GL.clear [GL.ColorBuffer] GL.normalize $= GL.Enabled GLUT.mainLoop -- |This is very simple, since all of the drawing is done by Event -- handlers. We set this function as the display callback and call it -- after each event has been handled.
1,149
main :: IO () main = do args <- getArgs let ip = args !! 0 let priorities = read (args !! 1) :: Int (progname, _) <- GLUT.getArgsAndInitialize (outqueue, inqueue) <- Events.doClient (Just ip) priorities GLUT.createWindow "Hello World" GLUT.initialDisplayMode $= [GLUT.DoubleBuffered, GLUT.RGBAMode] GLUT.keyboardMouseCallback $=! Just (keyboardMouse inqueue outqueue) GLUT.displayCallback $=! render forkOS $ checkEvents inqueue GL.clearColor $= GL.Color4 0 0 0 1 GL.blend $= GL.Enabled GL.blendFunc $= (GL.SrcAlpha, GL.OneMinusSrcAlpha) GL.lineSmooth $= GL.Enabled GL.pointSmooth $= GL.Enabled GL.polygonSmooth $= GL.Enabled GL.clear [GL.ColorBuffer] GL.normalize $= GL.Enabled GLUT.mainLoop -- |This is very simple, since all of the drawing is done by Event -- handlers. We set this function as the display callback and call it -- after each event has been handled.
1,018
main = do args <- getArgs let ip = args !! 0 let priorities = read (args !! 1) :: Int (progname, _) <- GLUT.getArgsAndInitialize (outqueue, inqueue) <- Events.doClient (Just ip) priorities GLUT.createWindow "Hello World" GLUT.initialDisplayMode $= [GLUT.DoubleBuffered, GLUT.RGBAMode] GLUT.keyboardMouseCallback $=! Just (keyboardMouse inqueue outqueue) GLUT.displayCallback $=! render forkOS $ checkEvents inqueue GL.clearColor $= GL.Color4 0 0 0 1 GL.blend $= GL.Enabled GL.blendFunc $= (GL.SrcAlpha, GL.OneMinusSrcAlpha) GL.lineSmooth $= GL.Enabled GL.pointSmooth $= GL.Enabled GL.polygonSmooth $= GL.Enabled GL.clear [GL.ColorBuffer] GL.normalize $= GL.Enabled GLUT.mainLoop -- |This is very simple, since all of the drawing is done by Event -- handlers. We set this function as the display callback and call it -- after each event has been handled.
1,004
true
true
0
12
291
282
136
146
null
null
Hodapp87/ivory
ivory/src/Ivory/Language/Array.hs
bsd-3-clause
fromIx :: ANat n => Ix n -> IxRep fromIx = wrapExpr . unwrapExpr
64
fromIx :: ANat n => Ix n -> IxRep fromIx = wrapExpr . unwrapExpr
64
fromIx = wrapExpr . unwrapExpr
30
false
true
0
8
13
36
15
21
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/PackageDescription.hs
bsd-3-clause
emptyPackageDescription :: PackageDescription emptyPackageDescription = PackageDescription { package = PackageIdentifier (PackageName "") (Version [] []), license = UnspecifiedLicense, licenseFiles = [], specVersionRaw = Right anyVersion, buildType = Nothing, copyright = "", maintainer = "", author = "", stability = "", testedWith = [], buildDepends = [], homepage = "", pkgUrl = "", bugReports = "", sourceRepos = [], synopsis = "", description = "", category = "", customFieldsPD = [], setupBuildInfo = Nothing, library = Nothing, executables = [], testSuites = [], benchmarks = [], dataFiles = [], dataDir = "", extraSrcFiles = [], extraTmpFiles = [], extraDocFiles = [] }
1,465
emptyPackageDescription :: PackageDescription emptyPackageDescription = PackageDescription { package = PackageIdentifier (PackageName "") (Version [] []), license = UnspecifiedLicense, licenseFiles = [], specVersionRaw = Right anyVersion, buildType = Nothing, copyright = "", maintainer = "", author = "", stability = "", testedWith = [], buildDepends = [], homepage = "", pkgUrl = "", bugReports = "", sourceRepos = [], synopsis = "", description = "", category = "", customFieldsPD = [], setupBuildInfo = Nothing, library = Nothing, executables = [], testSuites = [], benchmarks = [], dataFiles = [], dataDir = "", extraSrcFiles = [], extraTmpFiles = [], extraDocFiles = [] }
1,465
emptyPackageDescription = PackageDescription { package = PackageIdentifier (PackageName "") (Version [] []), license = UnspecifiedLicense, licenseFiles = [], specVersionRaw = Right anyVersion, buildType = Nothing, copyright = "", maintainer = "", author = "", stability = "", testedWith = [], buildDepends = [], homepage = "", pkgUrl = "", bugReports = "", sourceRepos = [], synopsis = "", description = "", category = "", customFieldsPD = [], setupBuildInfo = Nothing, library = Nothing, executables = [], testSuites = [], benchmarks = [], dataFiles = [], dataDir = "", extraSrcFiles = [], extraTmpFiles = [], extraDocFiles = [] }
1,419
false
true
0
10
888
237
147
90
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp WriteJIntArrayOp = _ILIT(1127)
43
tagOf_PrimOp WriteJIntArrayOp = _ILIT(1127)
43
tagOf_PrimOp WriteJIntArrayOp = _ILIT(1127)
43
false
false
0
6
3
16
7
9
null
null
keithodulaigh/Hets
Comorphisms/HasCASL2IsabelleHOL.hs
gpl-2.0
matriArg :: As.Term -> As.Term -> CaseMatrix matriArg pat cTerm = case pat of ApplTerm t1 t2 _ -> let (c, p) = stripAppl t1 (Nothing, []) in CaseMatrix { patBrand = Appl, cons = c, args = p ++ [t2], newArgs = [], term = cTerm } TupleTerm ts _ -> CaseMatrix { patBrand = Tuple, cons = Nothing, args = ts, newArgs = [], term = cTerm } TypedTerm t _ _ _ -> matriArg t cTerm qv@(QualVar _) -> CaseMatrix { patBrand = QuVar, cons = Nothing, args = [qv], newArgs = [], term = cTerm } qo@(QualOp {}) -> CaseMatrix { patBrand = QuOp, cons = Nothing, args = [qo], newArgs = [], term = cTerm } _ -> error "HasCASL2IsabelleHOL.matriArg" {- Assumption: The innermost term of a case-pattern consisting of a ApplTerm is a QualOp, that is a datatype constructor -} where stripAppl ct tp = case ct of TypedTerm (ApplTerm q@(QualOp {}) t' _) _ _ _ -> (Just q, t' : snd tp) TypedTerm (ApplTerm (TypedTerm q@(QualOp {}) _ _ _) t' _) _ _ _ -> (Just q, t' : snd tp) TypedTerm (ApplTerm t' t'' _) _ _ _ -> stripAppl t' (fst tp, t'' : snd tp) ApplTerm q@(QualOp {}) t' _ -> (Just q, t' : snd tp) ApplTerm (TypedTerm q@(QualOp {}) _ _ _) t' _ -> (Just q, [t']) ApplTerm t' t'' _ -> stripAppl t' (fst tp, t'' : snd tp) q@(QualOp {}) -> (Just q, snd tp) _ -> (Nothing, ct : snd tp) {- Input: List with CaseMatrix of same leading constructor pattern Functionality: First: Groups CMs so that these CMs are in one list that only differ in their last argument then: reduces list of every CMslist to one CM -}
1,869
matriArg :: As.Term -> As.Term -> CaseMatrix matriArg pat cTerm = case pat of ApplTerm t1 t2 _ -> let (c, p) = stripAppl t1 (Nothing, []) in CaseMatrix { patBrand = Appl, cons = c, args = p ++ [t2], newArgs = [], term = cTerm } TupleTerm ts _ -> CaseMatrix { patBrand = Tuple, cons = Nothing, args = ts, newArgs = [], term = cTerm } TypedTerm t _ _ _ -> matriArg t cTerm qv@(QualVar _) -> CaseMatrix { patBrand = QuVar, cons = Nothing, args = [qv], newArgs = [], term = cTerm } qo@(QualOp {}) -> CaseMatrix { patBrand = QuOp, cons = Nothing, args = [qo], newArgs = [], term = cTerm } _ -> error "HasCASL2IsabelleHOL.matriArg" {- Assumption: The innermost term of a case-pattern consisting of a ApplTerm is a QualOp, that is a datatype constructor -} where stripAppl ct tp = case ct of TypedTerm (ApplTerm q@(QualOp {}) t' _) _ _ _ -> (Just q, t' : snd tp) TypedTerm (ApplTerm (TypedTerm q@(QualOp {}) _ _ _) t' _) _ _ _ -> (Just q, t' : snd tp) TypedTerm (ApplTerm t' t'' _) _ _ _ -> stripAppl t' (fst tp, t'' : snd tp) ApplTerm q@(QualOp {}) t' _ -> (Just q, t' : snd tp) ApplTerm (TypedTerm q@(QualOp {}) _ _ _) t' _ -> (Just q, [t']) ApplTerm t' t'' _ -> stripAppl t' (fst tp, t'' : snd tp) q@(QualOp {}) -> (Just q, snd tp) _ -> (Nothing, ct : snd tp) {- Input: List with CaseMatrix of same leading constructor pattern Functionality: First: Groups CMs so that these CMs are in one list that only differ in their last argument then: reduces list of every CMslist to one CM -}
1,869
matriArg pat cTerm = case pat of ApplTerm t1 t2 _ -> let (c, p) = stripAppl t1 (Nothing, []) in CaseMatrix { patBrand = Appl, cons = c, args = p ++ [t2], newArgs = [], term = cTerm } TupleTerm ts _ -> CaseMatrix { patBrand = Tuple, cons = Nothing, args = ts, newArgs = [], term = cTerm } TypedTerm t _ _ _ -> matriArg t cTerm qv@(QualVar _) -> CaseMatrix { patBrand = QuVar, cons = Nothing, args = [qv], newArgs = [], term = cTerm } qo@(QualOp {}) -> CaseMatrix { patBrand = QuOp, cons = Nothing, args = [qo], newArgs = [], term = cTerm } _ -> error "HasCASL2IsabelleHOL.matriArg" {- Assumption: The innermost term of a case-pattern consisting of a ApplTerm is a QualOp, that is a datatype constructor -} where stripAppl ct tp = case ct of TypedTerm (ApplTerm q@(QualOp {}) t' _) _ _ _ -> (Just q, t' : snd tp) TypedTerm (ApplTerm (TypedTerm q@(QualOp {}) _ _ _) t' _) _ _ _ -> (Just q, t' : snd tp) TypedTerm (ApplTerm t' t'' _) _ _ _ -> stripAppl t' (fst tp, t'' : snd tp) ApplTerm q@(QualOp {}) t' _ -> (Just q, t' : snd tp) ApplTerm (TypedTerm q@(QualOp {}) _ _ _) t' _ -> (Just q, [t']) ApplTerm t' t'' _ -> stripAppl t' (fst tp, t'' : snd tp) q@(QualOp {}) -> (Just q, snd tp) _ -> (Nothing, ct : snd tp) {- Input: List with CaseMatrix of same leading constructor pattern Functionality: First: Groups CMs so that these CMs are in one list that only differ in their last argument then: reduces list of every CMslist to one CM -}
1,824
false
true
6
15
688
638
345
293
null
null
dillonhuff/Proper
src/Proper/Lexer.hs
bsd-3-clause
pos (Sep _ p) = p
17
pos (Sep _ p) = p
17
pos (Sep _ p) = p
17
false
false
0
6
5
18
8
10
null
null
notae/haskell-exercise
cp/CFPFD2.hs
bsd-3-clause
runIM :: (forall s. IM e m s a) -> e -> m (a, e) runIM im = runStateT (unIM im)
79
runIM :: (forall s. IM e m s a) -> e -> m (a, e) runIM im = runStateT (unIM im)
79
runIM im = runStateT (unIM im)
30
false
true
0
8
20
57
29
28
null
null
tpsinnem/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
-- | Replaces all terms equal (in the sense of @(==)@) to -- the old term with the new term. substTerm :: Eq n => TT n {-^ Old term -} -> TT n {-^ New term -} -> TT n {-^ template term -} -> TT n substTerm old new = st where st t | eqAlpha [] t old = new st (App s f a) = App s (st f) (st a) st (Bind x b sc) = Bind x (fmap st b) (st sc) st t = t eqAlpha as (P _ x _) (P _ y _) = x == y || (x, y) `elem` as || (y, x) `elem` as eqAlpha as (V x) (V y) = x == y eqAlpha as (Bind x xb xs) (Bind y yb ys) = eqAlphaB as xb yb && eqAlpha ((x, y) : as) xs ys eqAlpha as (App _ fx ax) (App _ fy ay) = eqAlpha as fx fy && eqAlpha as ax ay eqAlpha as x y = x == y eqAlphaB as (Let xt xv) (Let yt yv) = eqAlpha as xt yt && eqAlpha as xv yv eqAlphaB as (Guess xt xv) (Guess yt yv) = eqAlpha as xt yt && eqAlpha as xv yv eqAlphaB as bx by = eqAlpha as (binderTy bx) (binderTy by) -- | Return number of occurrences of V 0 or bound name i the term
1,027
substTerm :: Eq n => TT n {-^ Old term -} -> TT n {-^ New term -} -> TT n {-^ template term -} -> TT n substTerm old new = st where st t | eqAlpha [] t old = new st (App s f a) = App s (st f) (st a) st (Bind x b sc) = Bind x (fmap st b) (st sc) st t = t eqAlpha as (P _ x _) (P _ y _) = x == y || (x, y) `elem` as || (y, x) `elem` as eqAlpha as (V x) (V y) = x == y eqAlpha as (Bind x xb xs) (Bind y yb ys) = eqAlphaB as xb yb && eqAlpha ((x, y) : as) xs ys eqAlpha as (App _ fx ax) (App _ fy ay) = eqAlpha as fx fy && eqAlpha as ax ay eqAlpha as x y = x == y eqAlphaB as (Let xt xv) (Let yt yv) = eqAlpha as xt yt && eqAlpha as xv yv eqAlphaB as (Guess xt xv) (Guess yt yv) = eqAlpha as xt yt && eqAlpha as xv yv eqAlphaB as bx by = eqAlpha as (binderTy bx) (binderTy by) -- | Return number of occurrences of V 0 or bound name i the term
934
substTerm old new = st where st t | eqAlpha [] t old = new st (App s f a) = App s (st f) (st a) st (Bind x b sc) = Bind x (fmap st b) (st sc) st t = t eqAlpha as (P _ x _) (P _ y _) = x == y || (x, y) `elem` as || (y, x) `elem` as eqAlpha as (V x) (V y) = x == y eqAlpha as (Bind x xb xs) (Bind y yb ys) = eqAlphaB as xb yb && eqAlpha ((x, y) : as) xs ys eqAlpha as (App _ fx ax) (App _ fy ay) = eqAlpha as fx fy && eqAlpha as ax ay eqAlpha as x y = x == y eqAlphaB as (Let xt xv) (Let yt yv) = eqAlpha as xt yt && eqAlpha as xv yv eqAlphaB as (Guess xt xv) (Guess yt yv) = eqAlpha as xt yt && eqAlpha as xv yv eqAlphaB as bx by = eqAlpha as (binderTy bx) (binderTy by) -- | Return number of occurrences of V 0 or bound name i the term
792
true
true
0
11
334
510
254
256
null
null
brendanhay/gogol
gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Databases/Sessions/PartitionRead.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). pidsprUploadType :: Lens' ProjectsInstancesDatabasesSessionsPartitionRead (Maybe Text) pidsprUploadType = lens _pidsprUploadType (\ s a -> s{_pidsprUploadType = a})
243
pidsprUploadType :: Lens' ProjectsInstancesDatabasesSessionsPartitionRead (Maybe Text) pidsprUploadType = lens _pidsprUploadType (\ s a -> s{_pidsprUploadType = a})
172
pidsprUploadType = lens _pidsprUploadType (\ s a -> s{_pidsprUploadType = a})
85
true
true
1
9
34
51
25
26
null
null
avieth/diplomacy
Diplomacy/Province.hs
bsd-3-clause
supplyCentre Kiel = True
24
supplyCentre Kiel = True
24
supplyCentre Kiel = True
24
false
false
0
5
3
9
4
5
null
null
mpitid/scheme48
src/Scheme48/Interpreter.hs
mit
cdr [badArg] = throwError $ TypeMismatch "pair" badArg
69
cdr [badArg] = throwError $ TypeMismatch "pair" badArg
69
cdr [badArg] = throwError $ TypeMismatch "pair" badArg
69
false
false
0
6
22
21
10
11
null
null
MichielDerhaeg/stack
src/Stack/Types/Compiler.hs
bsd-3-clause
actualToWanted :: CompilerVersion 'CVActual -> CompilerVersion 'CVWanted actualToWanted (GhcVersion x) = GhcVersion x
117
actualToWanted :: CompilerVersion 'CVActual -> CompilerVersion 'CVWanted actualToWanted (GhcVersion x) = GhcVersion x
117
actualToWanted (GhcVersion x) = GhcVersion x
44
false
true
0
7
12
37
17
20
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
bindsOnlyPass :: (CoreProgram -> CoreM CoreProgram) -> ModGuts -> CoreM ModGuts bindsOnlyPass pass guts = do { binds' <- pass (mg_binds guts) ; return (guts { mg_binds = binds' }) }
190
bindsOnlyPass :: (CoreProgram -> CoreM CoreProgram) -> ModGuts -> CoreM ModGuts bindsOnlyPass pass guts = do { binds' <- pass (mg_binds guts) ; return (guts { mg_binds = binds' }) }
190
bindsOnlyPass pass guts = do { binds' <- pass (mg_binds guts) ; return (guts { mg_binds = binds' }) }
110
false
true
0
10
39
73
37
36
null
null
spacekitteh/smcghc
libraries/base/Data/OldList.hs
bsd-3-clause
genericDrop _ [] = []
29
genericDrop _ [] = []
29
genericDrop _ [] = []
29
false
false
0
6
12
15
7
8
null
null
erikd/hs-tls
core/Network/TLS/Handshake/Certificate.hs
bsd-3-clause
certificateRejected (CertificateRejectOther s) = throwCore $ Error_Protocol ("certificate rejected: " ++ s, True, CertificateUnknown)
137
certificateRejected (CertificateRejectOther s) = throwCore $ Error_Protocol ("certificate rejected: " ++ s, True, CertificateUnknown)
137
certificateRejected (CertificateRejectOther s) = throwCore $ Error_Protocol ("certificate rejected: " ++ s, True, CertificateUnknown)
137
false
false
0
8
17
35
18
17
null
null
nomeata/nofib-analyse
Main.hs
bsd-3-clause
csv_show_results :: Result a => [ResultTable] -> (Results -> Maybe a) -> (Results -> Status) -> (a -> Bool) -> Normalise -> Bool -> ShowS csv_show_results [] _ _ _ _ _ = error "csv_show_results: Can't happen?"
278
csv_show_results :: Result a => [ResultTable] -> (Results -> Maybe a) -> (Results -> Status) -> (a -> Bool) -> Normalise -> Bool -> ShowS csv_show_results [] _ _ _ _ _ = error "csv_show_results: Can't happen?"
277
csv_show_results [] _ _ _ _ _ = error "csv_show_results: Can't happen?"
80
false
true
0
14
105
93
45
48
null
null
d0kt0r0/Tidal
src/Sound/Tidal/Params.hs
gpl-3.0
-- | formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect. vowel :: Pattern String -> ControlPattern vowel = pS "vowel"
193
vowel :: Pattern String -> ControlPattern vowel = pS "vowel"
60
vowel = pS "vowel"
18
true
true
0
6
36
22
11
11
null
null
vito/atomo
src/Atomo/Environment.hs
bsd-3-clause
targets' is (PNamed _ p) = targets' is p
40
targets' is (PNamed _ p) = targets' is p
40
targets' is (PNamed _ p) = targets' is p
40
false
false
0
7
8
24
11
13
null
null
shicks/shsh
System/Console/ShSh/Shell.hs
bsd-3-clause
-- |Now this allows modifying the state, but locals and redirects -- are /preserved/ back to the original values. -- We could possibly be smart by using a flag in a variable to tell -- whether to merge its value back... i.e. "this var is local to -- the current block, so fully defer to the previous block". This -- could hold equally well for functions and aliases, etc. withEnvironment :: (Word -> Shell String) -> [Redir] -> [Assignment] -> Shell a -> Shell a withEnvironment expand rs as (Shell sub) = Shell $ do s <- get pipest <- gets pipeState let redir' (xxx,yyy) zzz = do (xxx',yyy') <- redir expand xxx zzz return (xxx', yyy' >> yyy) (p,closehs) <- foldM redir' (pipest, return ()) rs ls <- flip (foldM (assign expand)) as =<< gets locals (result,s') <- catchIO $ runStateT (runErrorT sub) $ s { pipeState = p, locals = ls } catchIO closehs put $ s' { locals = locals s, pipeState = pipeState s } case result of Right a -> return a Left err -> throwError err
1,062
withEnvironment :: (Word -> Shell String) -> [Redir] -> [Assignment] -> Shell a -> Shell a withEnvironment expand rs as (Shell sub) = Shell $ do s <- get pipest <- gets pipeState let redir' (xxx,yyy) zzz = do (xxx',yyy') <- redir expand xxx zzz return (xxx', yyy' >> yyy) (p,closehs) <- foldM redir' (pipest, return ()) rs ls <- flip (foldM (assign expand)) as =<< gets locals (result,s') <- catchIO $ runStateT (runErrorT sub) $ s { pipeState = p, locals = ls } catchIO closehs put $ s' { locals = locals s, pipeState = pipeState s } case result of Right a -> return a Left err -> throwError err
688
withEnvironment expand rs as (Shell sub) = Shell $ do s <- get pipest <- gets pipeState let redir' (xxx,yyy) zzz = do (xxx',yyy') <- redir expand xxx zzz return (xxx', yyy' >> yyy) (p,closehs) <- foldM redir' (pipest, return ()) rs ls <- flip (foldM (assign expand)) as =<< gets locals (result,s') <- catchIO $ runStateT (runErrorT sub) $ s { pipeState = p, locals = ls } catchIO closehs put $ s' { locals = locals s, pipeState = pipeState s } case result of Right a -> return a Left err -> throwError err
581
true
true
0
16
275
322
159
163
null
null
robinbb/hs-text-xhtml
Text/XHtml/Table.hs
apache-2.0
besides xs = foldr1 (<->) (map cell xs)
39
besides xs = foldr1 (<->) (map cell xs)
39
besides xs = foldr1 (<->) (map cell xs)
39
false
false
0
7
7
24
12
12
null
null
metabrainz/changed-mbid-feed
service/src/Main.hs
gpl-2.0
intersect :: ChangeSet -> ChangeSet -> ChangeSet intersect a b = ChangeSet { artistChanges = artistChanges a `HashSet.intersection` artistChanges b , labelChanges = labelChanges a `HashSet.intersection` labelChanges b , recordingChanges = recordingChanges a `HashSet.intersection` recordingChanges b , releaseChanges = releaseChanges a `HashSet.intersection` releaseChanges b , releaseGroupChanges = releaseGroupChanges a `HashSet.intersection` releaseGroupChanges b , workChanges = workChanges a `HashSet.intersection` workChanges b }
549
intersect :: ChangeSet -> ChangeSet -> ChangeSet intersect a b = ChangeSet { artistChanges = artistChanges a `HashSet.intersection` artistChanges b , labelChanges = labelChanges a `HashSet.intersection` labelChanges b , recordingChanges = recordingChanges a `HashSet.intersection` recordingChanges b , releaseChanges = releaseChanges a `HashSet.intersection` releaseChanges b , releaseGroupChanges = releaseGroupChanges a `HashSet.intersection` releaseGroupChanges b , workChanges = workChanges a `HashSet.intersection` workChanges b }
549
intersect a b = ChangeSet { artistChanges = artistChanges a `HashSet.intersection` artistChanges b , labelChanges = labelChanges a `HashSet.intersection` labelChanges b , recordingChanges = recordingChanges a `HashSet.intersection` recordingChanges b , releaseChanges = releaseChanges a `HashSet.intersection` releaseChanges b , releaseGroupChanges = releaseGroupChanges a `HashSet.intersection` releaseGroupChanges b , workChanges = workChanges a `HashSet.intersection` workChanges b }
500
false
true
0
9
74
150
80
70
null
null
kawamuray/ganeti
test/hs/Test/Ganeti/HTools/Backend/Simu.hs
gpl-2.0
prop_Load :: Property prop_Load = forAll (choose (0, 10)) $ \ngroups -> forAll (replicateM ngroups genSimuSpec) $ \specs -> let strspecs = map (\(p, n, d, m, c) -> printf "%s,%d,%d,%d,%d" p n d m c::String) specs totnodes = sum $ map (\(_, n, _, _, _) -> n) specs mdc_in = concatMap (\(_, n, d, m, c) -> replicate n (fromIntegral m, fromIntegral d, fromIntegral c, fromIntegral m, fromIntegral d)) specs :: [(Double, Double, Double, Int, Int)] in case Simu.parseData strspecs of Bad msg -> failTest $ "Failed to load specs: " ++ msg Ok (Loader.ClusterData gl nl il tags ipol) -> let nodes = map snd $ IntMap.toAscList nl nidx = map Node.idx nodes mdc_out = map (\n -> (Node.tMem n, Node.tDsk n, Node.tCpu n, Node.fMem n, Node.fDsk n)) nodes in conjoin [ Container.size gl ==? ngroups , Container.size nl ==? totnodes , Container.size il ==? 0 , length tags ==? 0 , ipol ==? Types.defIPolicy , nidx ==? [1..totnodes] , mdc_in ==? mdc_out , map Group.iPolicy (Container.elems gl) ==? replicate ngroups Types.defIPolicy ]
1,484
prop_Load :: Property prop_Load = forAll (choose (0, 10)) $ \ngroups -> forAll (replicateM ngroups genSimuSpec) $ \specs -> let strspecs = map (\(p, n, d, m, c) -> printf "%s,%d,%d,%d,%d" p n d m c::String) specs totnodes = sum $ map (\(_, n, _, _, _) -> n) specs mdc_in = concatMap (\(_, n, d, m, c) -> replicate n (fromIntegral m, fromIntegral d, fromIntegral c, fromIntegral m, fromIntegral d)) specs :: [(Double, Double, Double, Int, Int)] in case Simu.parseData strspecs of Bad msg -> failTest $ "Failed to load specs: " ++ msg Ok (Loader.ClusterData gl nl il tags ipol) -> let nodes = map snd $ IntMap.toAscList nl nidx = map Node.idx nodes mdc_out = map (\n -> (Node.tMem n, Node.tDsk n, Node.tCpu n, Node.fMem n, Node.fDsk n)) nodes in conjoin [ Container.size gl ==? ngroups , Container.size nl ==? totnodes , Container.size il ==? 0 , length tags ==? 0 , ipol ==? Types.defIPolicy , nidx ==? [1..totnodes] , mdc_in ==? mdc_out , map Group.iPolicy (Container.elems gl) ==? replicate ngroups Types.defIPolicy ]
1,484
prop_Load = forAll (choose (0, 10)) $ \ngroups -> forAll (replicateM ngroups genSimuSpec) $ \specs -> let strspecs = map (\(p, n, d, m, c) -> printf "%s,%d,%d,%d,%d" p n d m c::String) specs totnodes = sum $ map (\(_, n, _, _, _) -> n) specs mdc_in = concatMap (\(_, n, d, m, c) -> replicate n (fromIntegral m, fromIntegral d, fromIntegral c, fromIntegral m, fromIntegral d)) specs :: [(Double, Double, Double, Int, Int)] in case Simu.parseData strspecs of Bad msg -> failTest $ "Failed to load specs: " ++ msg Ok (Loader.ClusterData gl nl il tags ipol) -> let nodes = map snd $ IntMap.toAscList nl nidx = map Node.idx nodes mdc_out = map (\n -> (Node.tMem n, Node.tDsk n, Node.tCpu n, Node.fMem n, Node.fDsk n)) nodes in conjoin [ Container.size gl ==? ngroups , Container.size nl ==? totnodes , Container.size il ==? 0 , length tags ==? 0 , ipol ==? Types.defIPolicy , nidx ==? [1..totnodes] , mdc_in ==? mdc_out , map Group.iPolicy (Container.elems gl) ==? replicate ngroups Types.defIPolicy ]
1,462
false
true
0
23
641
486
256
230
null
null
mikeyhc/harkerbot
src/Main.hs
bsd-3-clause
run :: Bot () run = ircInit >> asks socket >>= listen
53
run :: Bot () run = ircInit >> asks socket >>= listen
53
run = ircInit >> asks socket >>= listen
39
false
true
1
7
11
31
13
18
null
null
hirokai/PaperServer
Parser/Publisher/NatureRev.hs
bsd-2-clause
_year _ = fmap (read . T.unpack . T.take 4) . headm . getMeta "prism.publicationDate"
85
_year _ = fmap (read . T.unpack . T.take 4) . headm . getMeta "prism.publicationDate"
85
_year _ = fmap (read . T.unpack . T.take 4) . headm . getMeta "prism.publicationDate"
85
false
false
0
11
14
41
19
22
null
null
keithodulaigh/Hets
SoftFOL/ProveSPASS.hs
gpl-2.0
-- * Prover implementation {- | The Prover implementation. Implemented are: a prover GUI, and both commandline prover interfaces. -} spassName :: String spassName = "SPASS"
179
spassName :: String spassName = "SPASS"
39
spassName = "SPASS"
19
true
true
0
4
32
13
8
5
null
null
meteficha/HipmunkPlayground
Playground.hs
mit
advanceSimulTime stateVar steps = do removeOutOfSight stateVar state <- SV.get stateVar -- Do (steps-1) steps that clear the collisions variable. let clearCollisions = writeIORef (stCollisionsVar state) [] step = H.step (stSpace state) frameDelta replicateM_ (steps-1) $ step >> clearCollisions -- Do a final step that will leave the collisions variable filled. step -- | Removes all shapes that may be out of sight forever.
447
advanceSimulTime stateVar steps = do removeOutOfSight stateVar state <- SV.get stateVar -- Do (steps-1) steps that clear the collisions variable. let clearCollisions = writeIORef (stCollisionsVar state) [] step = H.step (stSpace state) frameDelta replicateM_ (steps-1) $ step >> clearCollisions -- Do a final step that will leave the collisions variable filled. step -- | Removes all shapes that may be out of sight forever.
447
advanceSimulTime stateVar steps = do removeOutOfSight stateVar state <- SV.get stateVar -- Do (steps-1) steps that clear the collisions variable. let clearCollisions = writeIORef (stCollisionsVar state) [] step = H.step (stSpace state) frameDelta replicateM_ (steps-1) $ step >> clearCollisions -- Do a final step that will leave the collisions variable filled. step -- | Removes all shapes that may be out of sight forever.
447
false
false
0
12
86
97
45
52
null
null
fortun13/latex2mathml
src/Latex2MathML/Scanner/Main.hs
gpl-2.0
getCommand lst name line | member name commands == True = return $ Command name | name == "begin" || name == "end" = if readComplexCommandName lst "" == True then return $ Command name else throwError $ "Scanner: Command not recognized around: " ++ name ++ show (take 20 lst) ++ " line: " ++ show line | otherwise = throwError $ "Scanner: Command not recognized: " ++ name ++ " line: " ++ show line
434
getCommand lst name line | member name commands == True = return $ Command name | name == "begin" || name == "end" = if readComplexCommandName lst "" == True then return $ Command name else throwError $ "Scanner: Command not recognized around: " ++ name ++ show (take 20 lst) ++ " line: " ++ show line | otherwise = throwError $ "Scanner: Command not recognized: " ++ name ++ " line: " ++ show line
434
getCommand lst name line | member name commands == True = return $ Command name | name == "begin" || name == "end" = if readComplexCommandName lst "" == True then return $ Command name else throwError $ "Scanner: Command not recognized around: " ++ name ++ show (take 20 lst) ++ " line: " ++ show line | otherwise = throwError $ "Scanner: Command not recognized: " ++ name ++ " line: " ++ show line
434
false
false
1
12
112
142
67
75
null
null
jstolarek/haddock
haddock-api/src/Haddock/Interface/Rename.hs
bsd-2-clause
renameDocumentation :: Documentation Name -> RnM (Documentation DocName) renameDocumentation (Documentation mDoc mWarning) = Documentation <$> mapM renameDoc mDoc <*> mapM renameDoc mWarning
192
renameDocumentation :: Documentation Name -> RnM (Documentation DocName) renameDocumentation (Documentation mDoc mWarning) = Documentation <$> mapM renameDoc mDoc <*> mapM renameDoc mWarning
192
renameDocumentation (Documentation mDoc mWarning) = Documentation <$> mapM renameDoc mDoc <*> mapM renameDoc mWarning
119
false
true
0
8
23
56
26
30
null
null
allanderek/ipclib
Language/Pepa/Analysis/Analysis.hs
gpl-2.0
hprintAnResult ( UsedButUndefinedProcesses pids ) = unwords [ "The following process identifers are used but not defined" , hprintProcessIdList pids ]
183
hprintAnResult ( UsedButUndefinedProcesses pids ) = unwords [ "The following process identifers are used but not defined" , hprintProcessIdList pids ]
183
hprintAnResult ( UsedButUndefinedProcesses pids ) = unwords [ "The following process identifers are used but not defined" , hprintProcessIdList pids ]
183
false
false
0
7
53
27
13
14
null
null
np/propellor
src/Propellor/PrivData/Paths.hs
bsd-2-clause
privDataFile :: FilePath privDataFile = privDataDir </> "privdata.gpg"
70
privDataFile :: FilePath privDataFile = privDataDir </> "privdata.gpg"
70
privDataFile = privDataDir </> "privdata.gpg"
45
false
true
0
5
7
15
8
7
null
null
yiannist/ganeti
src/Ganeti/HTools/Loader.hs
bsd-2-clause
-- | Update node memory stat based on instance list. updateMemStat :: Node.Node -> Instance.List -> Node.Node updateMemStat node il = let node2 = node { Node.iMem = nodeImem node il } node3 = node2 { Node.xMem = Node.missingMem node2 } in node3 { Node.pMem = fromIntegral (Node.unallocatedMem node3) / Node.tMem node3 }
354
updateMemStat :: Node.Node -> Instance.List -> Node.Node updateMemStat node il = let node2 = node { Node.iMem = nodeImem node il } node3 = node2 { Node.xMem = Node.missingMem node2 } in node3 { Node.pMem = fromIntegral (Node.unallocatedMem node3) / Node.tMem node3 }
301
updateMemStat node il = let node2 = node { Node.iMem = nodeImem node il } node3 = node2 { Node.xMem = Node.missingMem node2 } in node3 { Node.pMem = fromIntegral (Node.unallocatedMem node3) / Node.tMem node3 }
244
true
true
0
13
87
107
55
52
null
null
andorp/grin
grin/src/AbstractInterpretation/HeapPointsTo/Result.hs
bsd-3-clause
_T_Location _ rest = pure rest
40
_T_Location _ rest = pure rest
40
_T_Location _ rest = pure rest
40
false
false
0
5
15
14
6
8
null
null
mhwombat/interactive-wains
test/Main.hs
bsd-3-clause
main :: IO () main = defaultMain tests
38
main :: IO () main = defaultMain tests
38
main = defaultMain tests
24
false
true
0
7
7
25
10
15
null
null
CulpaBS/wbBach
src/Futhark/Representation/AST/Traversals.hs
bsd-3-clause
mapExpM tv (Apply fname args ret) = do args' <- forM args $ \(arg, d) -> (,) <$> mapOnSubExp tv arg <*> pure d pure (Apply fname) <*> pure args' <*> mapOnRetType tv ret
189
mapExpM tv (Apply fname args ret) = do args' <- forM args $ \(arg, d) -> (,) <$> mapOnSubExp tv arg <*> pure d pure (Apply fname) <*> pure args' <*> mapOnRetType tv ret
189
mapExpM tv (Apply fname args ret) = do args' <- forM args $ \(arg, d) -> (,) <$> mapOnSubExp tv arg <*> pure d pure (Apply fname) <*> pure args' <*> mapOnRetType tv ret
189
false
false
0
12
54
93
44
49
null
null
Fuuzetsu/yi-emacs-colours
src/Yi/Style/EmacsColours.hs
gpl-2.0
-- | Names: @["grey96"]@ -- -- R245 G245 B245, 0xf5f5f5 grey96 :: Color grey96 = RGB 245 245 245
96
grey96 :: Color grey96 = RGB 245 245 245
40
grey96 = RGB 245 245 245
24
true
true
0
6
18
27
13
14
null
null
andyarvanitis/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
process fn (SetOpt ShowOrigErr) = setShowOrigErr True
55
process fn (SetOpt ShowOrigErr) = setShowOrigErr True
55
process fn (SetOpt ShowOrigErr) = setShowOrigErr True
55
false
false
0
6
8
22
9
13
null
null
erikstenlund/lisp-parser
lisp.hs
mit
-- '<datum> or (quote <datum>), second solved by parseList parseQuotation = do char '\'' datum <- parseASTNode return $ List [Identifier "quote", datum]
197
parseQuotation = do char '\'' datum <- parseASTNode return $ List [Identifier "quote", datum]
138
parseQuotation = do char '\'' datum <- parseASTNode return $ List [Identifier "quote", datum]
138
true
false
0
10
67
39
18
21
null
null
janschulz/pandoc
src/Text/Pandoc/Readers/Markdown.hs
gpl-2.0
-- Parse a table separator - dashed line. tableSep :: MarkdownParser Char tableSep = try $ skipNonindentSpaces >> many1 (dashedLine '-') >> char '\n'
149
tableSep :: MarkdownParser Char tableSep = try $ skipNonindentSpaces >> many1 (dashedLine '-') >> char '\n'
107
tableSep = try $ skipNonindentSpaces >> many1 (dashedLine '-') >> char '\n'
75
true
true
0
9
23
39
19
20
null
null
urbanslug/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
-- \subsection{Lifting IO into the monad} -- | Lift an 'IOEnv' operation into 'CoreM' liftIOEnv :: CoreIOEnv a -> CoreM a liftIOEnv mx = CoreM (\s -> mx >>= (\x -> nop s x))
174
liftIOEnv :: CoreIOEnv a -> CoreM a liftIOEnv mx = CoreM (\s -> mx >>= (\x -> nop s x))
87
liftIOEnv mx = CoreM (\s -> mx >>= (\x -> nop s x))
51
true
true
0
11
34
59
29
30
null
null
sopvop/cabal
cabal-install/Distribution/Client/Init/Heuristics.hs
bsd-3-clause
happyOutput :: (ExitCode, a, t) -> Flag a happyOutput v = case v of (ExitSuccess, s, _) -> Flag s _ -> mempty
131
happyOutput :: (ExitCode, a, t) -> Flag a happyOutput v = case v of (ExitSuccess, s, _) -> Flag s _ -> mempty
131
happyOutput v = case v of (ExitSuccess, s, _) -> Flag s _ -> mempty
89
false
true
2
6
44
54
30
24
null
null
cirquit/HaskellPie
HaskellPie/Handler/SignUp.hs
mit
postSignUpR :: Handler Html postSignUpR = do ((res, widget), enctype) <- runFormPost signupMForm case res of (FormSuccess (Person nick pw email (Info subject degree semCountResult) perms)) -> do mnick <- runDB $ getBy $ UniqueNick nick case mnick of (Just _) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> This username is already taken, sorry.|] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout") (_) -> do (_) <- runDB $ insert (Person nick pw email (Info subject degree semCountResult) perms) setSession "_ID" nick redirectUltDest HomeR (FormFailure (err:_)) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> #{err}|] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout") (_) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> Some error happend, please try again |] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout")
1,517
postSignUpR :: Handler Html postSignUpR = do ((res, widget), enctype) <- runFormPost signupMForm case res of (FormSuccess (Person nick pw email (Info subject degree semCountResult) perms)) -> do mnick <- runDB $ getBy $ UniqueNick nick case mnick of (Just _) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> This username is already taken, sorry.|] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout") (_) -> do (_) <- runDB $ insert (Person nick pw email (Info subject degree semCountResult) perms) setSession "_ID" nick redirectUltDest HomeR (FormFailure (err:_)) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> #{err}|] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout") (_) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> Some error happend, please try again |] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout")
1,517
postSignUpR = do ((res, widget), enctype) <- runFormPost signupMForm case res of (FormSuccess (Person nick pw email (Info subject degree semCountResult) perms)) -> do mnick <- runDB $ getBy $ UniqueNick nick case mnick of (Just _) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> This username is already taken, sorry.|] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout") (_) -> do (_) <- runDB $ insert (Person nick pw email (Info subject degree semCountResult) perms) setSession "_ID" nick redirectUltDest HomeR (FormFailure (err:_)) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> #{err}|] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout") (_) -> do let headline = "You can create an account here" :: Text leftWidget = [whamlet| <span .simpleBlack> Some error happend, please try again |] >> postWidget enctype widget rightWidget = [whamlet| <span> |] defaultLayout $(widgetFile "left-right-layout")
1,489
false
true
0
24
522
365
189
176
null
null
acowley/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
mkLastStmt body = LastStmt body noSyntaxExpr
48
mkLastStmt body = LastStmt body noSyntaxExpr
48
mkLastStmt body = LastStmt body noSyntaxExpr
48
false
false
0
5
9
14
6
8
null
null
Austin-Haskell/origami
caesar1.hs
gpl-3.0
caesar :: String -> Int -> String caesar [] _ = []
50
caesar :: String -> Int -> String caesar [] _ = []
50
caesar [] _ = []
16
false
true
0
6
11
28
14
14
null
null
geraldus/transient
src/Transient/Internals.hs
mit
addThreads' :: Int -> TransIO () addThreads' n= Transient $ do msem <- gets maxThread case msem of Just sem -> liftIO $ modifyIORef sem $ \n' -> n + n' Nothing -> do sem <- liftIO (newIORef n) modify $ \ s -> s{maxThread= Just sem} return $ Just () -- | assure that at least there are n threads available
339
addThreads' :: Int -> TransIO () addThreads' n= Transient $ do msem <- gets maxThread case msem of Just sem -> liftIO $ modifyIORef sem $ \n' -> n + n' Nothing -> do sem <- liftIO (newIORef n) modify $ \ s -> s{maxThread= Just sem} return $ Just () -- | assure that at least there are n threads available
339
addThreads' n= Transient $ do msem <- gets maxThread case msem of Just sem -> liftIO $ modifyIORef sem $ \n' -> n + n' Nothing -> do sem <- liftIO (newIORef n) modify $ \ s -> s{maxThread= Just sem} return $ Just () -- | assure that at least there are n threads available
306
false
true
0
18
96
132
62
70
null
null
dvolk/hoodie
Main.hs
gpl-3.0
belowleft (x, y) = (x - 1, y + 1)
34
belowleft (x, y) = (x - 1, y + 1)
34
belowleft (x, y) = (x - 1, y + 1)
34
false
false
0
6
10
30
16
14
null
null
DanielSchuessler/hstri
graph-layout-interactive.hs
gpl-3.0
texfile = fileBase ++ ".tex"
28
texfile = fileBase ++ ".tex"
28
texfile = fileBase ++ ".tex"
28
false
false
0
5
4
10
5
5
null
null
deech/stack
src/Stack/Types/Config.hs
bsd-3-clause
buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool) buildOptsMonoidBenchmarksL = lens (getFirst . buildMonoidBenchmarks) (\buildMonoid t -> buildMonoid {buildMonoidBenchmarks = First t})
227
buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool) buildOptsMonoidBenchmarksL = lens (getFirst . buildMonoidBenchmarks) (\buildMonoid t -> buildMonoid {buildMonoidBenchmarks = First t})
227
buildOptsMonoidBenchmarksL = lens (getFirst . buildMonoidBenchmarks) (\buildMonoid t -> buildMonoid {buildMonoidBenchmarks = First t})
162
false
true
0
10
47
55
29
26
null
null
blanu/arbre-go
Arbre/NewNative.hs
gpl-2.0
applyNative :: NativeType -> Native applyNative IntegerAdd = add
64
applyNative :: NativeType -> Native applyNative IntegerAdd = add
64
applyNative IntegerAdd = add
28
false
true
0
5
8
18
9
9
null
null
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/picture/Boids/KDTree2d.hs
mit
-- | An empty KDTree newKDTree :: KDTreeNode a newKDTree = Empty
64
newKDTree :: KDTreeNode a newKDTree = Empty
43
newKDTree = Empty
17
true
true
0
5
11
15
8
7
null
null
martinvlk/cis194-homeworks
src/HW11/SExpr.hs
gpl-3.0
ident :: Parser Ident ident = (:) <$> satisfy isAlpha <*> zeroOrMore (satisfy isAlphaNum)
89
ident :: Parser Ident ident = (:) <$> satisfy isAlpha <*> zeroOrMore (satisfy isAlphaNum)
89
ident = (:) <$> satisfy isAlpha <*> zeroOrMore (satisfy isAlphaNum)
67
false
true
0
8
13
36
18
18
null
null
nushio3/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
addTickCmdStmt :: Stmt Id (LHsCmd Id) -> TM (Stmt Id (LHsCmd Id)) addTickCmdStmt (BindStmt pat c bind fail ty) = do liftM5 BindStmt (addTickLPat pat) (addTickLHsCmd c) (return bind) (return fail) (return ty)
295
addTickCmdStmt :: Stmt Id (LHsCmd Id) -> TM (Stmt Id (LHsCmd Id)) addTickCmdStmt (BindStmt pat c bind fail ty) = do liftM5 BindStmt (addTickLPat pat) (addTickLHsCmd c) (return bind) (return fail) (return ty)
295
addTickCmdStmt (BindStmt pat c bind fail ty) = do liftM5 BindStmt (addTickLPat pat) (addTickLHsCmd c) (return bind) (return fail) (return ty)
229
false
true
0
10
120
106
51
55
null
null
Batev/Vienna-University-of-Technology
Functional Programming/Algebraic data type/AlgebraicDataType.hs
mit
toBase3 :: Integer -> Digits toBase3 0 = [Zero]
48
toBase3 :: Integer -> Digits toBase3 0 = [Zero]
47
toBase3 0 = [Zero]
18
false
true
0
5
9
21
11
10
null
null
danr/hipspec
testsuite/prod/zeno_version/PropT17.hs
gpl-3.0
S x <= S y = x <= y
19
S x <= S y = x <= y
19
S x <= S y = x <= y
19
false
false
3
5
8
25
10
15
null
null
pairyo/elm-compiler
src/Parse/Helpers.hs
bsd-3-clause
-- ODD COMBINATORS failure msg = do inp <- getInput setInput ('x':inp) anyToken fail msg
97
failure msg = do inp <- getInput setInput ('x':inp) anyToken fail msg
77
failure msg = do inp <- getInput setInput ('x':inp) anyToken fail msg
77
true
false
1
10
23
43
17
26
null
null
rahulmutt/ghcvm
compiler/Eta/Main/InteractiveEvalTypes.hs
bsd-3-clause
isStep _ = True
15
isStep _ = True
15
isStep _ = True
15
false
false
0
5
3
9
4
5
null
null
Mokosha/HsTetrisAttack
TetrisAttack/Cursor.hs
mit
renderCursor :: L.RenderObject -> Cursor -> L.GameMonad () renderCursor ro ((curx, cury), _) = L.addRenderAction xf ro where szx = blockSizeN * 16 / 7 szy = blockSizeN * 4 / 3 offx = blockSizeN / 7 offy = blockSizeN / 6 (V2 trx try) = blockOriginf (curx, cury) ^-^ (V2 offx offy) xf :: L.Transform xf = L.translate (V3 trx try $ renderDepth RenderLayer'Cursor) $ L.nonuniformScale (V3 szx szy 1) $ L.identity
459
renderCursor :: L.RenderObject -> Cursor -> L.GameMonad () renderCursor ro ((curx, cury), _) = L.addRenderAction xf ro where szx = blockSizeN * 16 / 7 szy = blockSizeN * 4 / 3 offx = blockSizeN / 7 offy = blockSizeN / 6 (V2 trx try) = blockOriginf (curx, cury) ^-^ (V2 offx offy) xf :: L.Transform xf = L.translate (V3 trx try $ renderDepth RenderLayer'Cursor) $ L.nonuniformScale (V3 szx szy 1) $ L.identity
459
renderCursor ro ((curx, cury), _) = L.addRenderAction xf ro where szx = blockSizeN * 16 / 7 szy = blockSizeN * 4 / 3 offx = blockSizeN / 7 offy = blockSizeN / 6 (V2 trx try) = blockOriginf (curx, cury) ^-^ (V2 offx offy) xf :: L.Transform xf = L.translate (V3 trx try $ renderDepth RenderLayer'Cursor) $ L.nonuniformScale (V3 szx szy 1) $ L.identity
400
false
true
0
10
123
198
99
99
null
null
fmapfmapfmap/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/DescribeClusterVersions.hs
mpl-2.0
-- | Creates a value of 'DescribeClusterVersions' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dcvClusterParameterGroupFamily' -- -- * 'dcvMarker' -- -- * 'dcvMaxRecords' -- -- * 'dcvClusterVersion' describeClusterVersions :: DescribeClusterVersions describeClusterVersions = DescribeClusterVersions' { _dcvClusterParameterGroupFamily = Nothing , _dcvMarker = Nothing , _dcvMaxRecords = Nothing , _dcvClusterVersion = Nothing }
544
describeClusterVersions :: DescribeClusterVersions describeClusterVersions = DescribeClusterVersions' { _dcvClusterParameterGroupFamily = Nothing , _dcvMarker = Nothing , _dcvMaxRecords = Nothing , _dcvClusterVersion = Nothing }
256
describeClusterVersions = DescribeClusterVersions' { _dcvClusterParameterGroupFamily = Nothing , _dcvMarker = Nothing , _dcvMaxRecords = Nothing , _dcvClusterVersion = Nothing }
201
true
true
1
7
96
55
35
20
null
null
ben-schulz/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
eqDoc = fmap (const (Left $ Msg "")) . parseDocstring . T.pack $ "The propositional equality type. A proof that `x` = `y`." ++ "\n\n" ++ "To use such a proof, pattern-match on it, and the two equal things will " ++ "then need to be the _same_ pattern." ++ "\n\n" ++ "**Note**: Idris's equality type is potentially _heterogeneous_, which means that it " ++ "is possible to state equalities between values of potentially different " ++ "types. However, Idris will attempt the homogeneous case unless it fails to typecheck." ++ "\n\n" ++ "You may need to use `(~=~)` to explicitly request heterogeneous equality."
710
eqDoc = fmap (const (Left $ Msg "")) . parseDocstring . T.pack $ "The propositional equality type. A proof that `x` = `y`." ++ "\n\n" ++ "To use such a proof, pattern-match on it, and the two equal things will " ++ "then need to be the _same_ pattern." ++ "\n\n" ++ "**Note**: Idris's equality type is potentially _heterogeneous_, which means that it " ++ "is possible to state equalities between values of potentially different " ++ "types. However, Idris will attempt the homogeneous case unless it fails to typecheck." ++ "\n\n" ++ "You may need to use `(~=~)` to explicitly request heterogeneous equality."
710
eqDoc = fmap (const (Left $ Msg "")) . parseDocstring . T.pack $ "The propositional equality type. A proof that `x` = `y`." ++ "\n\n" ++ "To use such a proof, pattern-match on it, and the two equal things will " ++ "then need to be the _same_ pattern." ++ "\n\n" ++ "**Note**: Idris's equality type is potentially _heterogeneous_, which means that it " ++ "is possible to state equalities between values of potentially different " ++ "types. However, Idris will attempt the homogeneous case unless it fails to typecheck." ++ "\n\n" ++ "You may need to use `(~=~)` to explicitly request heterogeneous equality."
710
false
false
7
13
203
82
37
45
null
null
bitemyapp/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * Disk access mode diskRdonly :: String diskRdonly = Types.diskModeToRaw DiskRdOnly
87
diskRdonly :: String diskRdonly = Types.diskModeToRaw DiskRdOnly
64
diskRdonly = Types.diskModeToRaw DiskRdOnly
43
true
true
0
6
12
23
10
13
null
null
forste/haReFork
refactorer/RefacGenFold.hs
bsd-3-clause
parseComment' (x:xs) = x : (parseComment' xs)
45
parseComment' (x:xs) = x : (parseComment' xs)
45
parseComment' (x:xs) = x : (parseComment' xs)
45
false
false
0
7
6
26
13
13
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Resource/Genomics/Variants/Patch.hs
mpl-2.0
-- | OAuth access token. vpAccessToken :: Lens' VariantsPatch (Maybe Text) vpAccessToken = lens _vpAccessToken (\ s a -> s{_vpAccessToken = a})
151
vpAccessToken :: Lens' VariantsPatch (Maybe Text) vpAccessToken = lens _vpAccessToken (\ s a -> s{_vpAccessToken = a})
126
vpAccessToken = lens _vpAccessToken (\ s a -> s{_vpAccessToken = a})
76
true
true
0
9
29
48
25
23
null
null
izimbra/PLT2014
Lab2/TypeCheckerA.hs
gpl-2.0
checkDefs :: EnvT -> [Def] -> Err ([Def],()) checkDefs env [] = return ([],())
82
checkDefs :: EnvT -> [Def] -> Err ([Def],()) checkDefs env [] = return ([],())
82
checkDefs env [] = return ([],())
37
false
true
0
9
17
56
30
26
null
null