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
ttuegel/loops
src/Control/Monad/Loop/Internal.hs
bsd-3-clause
continue = return
17
continue = return
17
continue = return
17
false
false
1
5
2
10
3
7
null
null
teleshoes/taffybar
src/System/Taffybar/Widget/WttrIn.hs
bsd-3-clause
logException :: HttpException -> IO (Bool, ByteString) logException e = do let errmsg = show e logM "System.Taffybar.Widget.WttrIn" ERROR $ ("Warning: Couldn't call wttr.in. \n" ++ errmsg) return $ (False, "✨")
220
logException :: HttpException -> IO (Bool, ByteString) logException e = do let errmsg = show e logM "System.Taffybar.Widget.WttrIn" ERROR $ ("Warning: Couldn't call wttr.in. \n" ++ errmsg) return $ (False, "✨")
220
logException e = do let errmsg = show e logM "System.Taffybar.Widget.WttrIn" ERROR $ ("Warning: Couldn't call wttr.in. \n" ++ errmsg) return $ (False, "✨")
165
false
true
0
10
40
71
35
36
null
null
mrakgr/futhark
src/Futhark/CodeGen/ImpGen/Kernels.hs
bsd-3-clause
compileKernelResult constants dest (ThreadsReturn AllThreads what) = ImpGen.copyDWIMDest dest [ImpGen.varIndex $ kernelGlobalThreadId constants] what []
154
compileKernelResult constants dest (ThreadsReturn AllThreads what) = ImpGen.copyDWIMDest dest [ImpGen.varIndex $ kernelGlobalThreadId constants] what []
154
compileKernelResult constants dest (ThreadsReturn AllThreads what) = ImpGen.copyDWIMDest dest [ImpGen.varIndex $ kernelGlobalThreadId constants] what []
154
false
false
0
8
16
51
22
29
null
null
ihc/futhark
src/Futhark/Analysis/ScalExp.hs
isc
scalExpType (SQuot e _) = scalExpType e
39
scalExpType (SQuot e _) = scalExpType e
39
scalExpType (SQuot e _) = scalExpType e
39
false
false
0
6
6
21
9
12
null
null
hvr/lens
examples/Pong.hs
bsd-3-clause
-- The main program action main = do v:vs <- startingSpeeds let world = ballSpeed .~ v $ vectors .~ vs $ initial play display backColor fps world draw handle update where display = InWindow "Pong!" (windowWidth, windowHeight) (200, 200) backColor = white fps = 120 -- Generate the random list of starting speeds
342
main = do v:vs <- startingSpeeds let world = ballSpeed .~ v $ vectors .~ vs $ initial play display backColor fps world draw handle update where display = InWindow "Pong!" (windowWidth, windowHeight) (200, 200) backColor = white fps = 120 -- Generate the random list of starting speeds
314
main = do v:vs <- startingSpeeds let world = ballSpeed .~ v $ vectors .~ vs $ initial play display backColor fps world draw handle update where display = InWindow "Pong!" (windowWidth, windowHeight) (200, 200) backColor = white fps = 120 -- Generate the random list of starting speeds
314
true
false
3
13
84
109
51
58
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | All of the following values are quite arbitrary - there are no -- "good" defaults, these must be customised per-site ispecsMinmaxDefaults :: Map String (Map String Int) ispecsMinmaxDefaults = Map.fromList [(ispecsMin, Map.fromList [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMinISpec), (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec), (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMinISpec), (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec), (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec), (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMinISpec)]), (ispecsMax, Map.fromList [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMaxISpec), (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec), (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMaxISpec), (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec), (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec), (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMaxISpec)])]
1,193
ispecsMinmaxDefaults :: Map String (Map String Int) ispecsMinmaxDefaults = Map.fromList [(ispecsMin, Map.fromList [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMinISpec), (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec), (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMinISpec), (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec), (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec), (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMinISpec)]), (ispecsMax, Map.fromList [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMaxISpec), (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec), (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMaxISpec), (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec), (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec), (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMaxISpec)])]
1,071
ispecsMinmaxDefaults = Map.fromList [(ispecsMin, Map.fromList [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMinISpec), (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec), (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMinISpec), (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec), (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec), (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMinISpec)]), (ispecsMax, Map.fromList [(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMaxISpec), (ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec), (ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMaxISpec), (ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec), (ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec), (ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMaxISpec)])]
1,019
true
true
1
12
144
280
152
128
null
null
gridaphobe/ghc
compiler/deSugar/DsUtils.hs
bsd-3-clause
mkCoLetMatchResult :: CoreBind -> MatchResult -> MatchResult mkCoLetMatchResult bind = adjustMatchResult (mkCoreLet bind)
121
mkCoLetMatchResult :: CoreBind -> MatchResult -> MatchResult mkCoLetMatchResult bind = adjustMatchResult (mkCoreLet bind)
121
mkCoLetMatchResult bind = adjustMatchResult (mkCoreLet bind)
60
false
true
0
8
12
37
16
21
null
null
rrnewton/accelerate
Data/Array/Accelerate/Interpreter.hs
bsd-3-clause
evalSub :: NumType a -> ((a, a) -> a) evalSub (IntegralNumType ty) | IntegralDict <- integralDict ty = uncurry (-)
114
evalSub :: NumType a -> ((a, a) -> a) evalSub (IntegralNumType ty) | IntegralDict <- integralDict ty = uncurry (-)
114
evalSub (IntegralNumType ty) | IntegralDict <- integralDict ty = uncurry (-)
76
false
true
0
9
19
62
30
32
null
null
sdiehl/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
genMachOp_slow _ (MO_VF_Extract l w) [val, idx] = runExprData $ do vval <- exprToVarW val vidx <- exprToVarW idx vval' <- singletonPanic "genMachOp_slow" <$> castVarsW Signed [(vval, LMVector l ty)] doExprW ty $ Extract vval' vidx where ty = widthToLlvmFloat w -- Element insertion
317
genMachOp_slow _ (MO_VF_Extract l w) [val, idx] = runExprData $ do vval <- exprToVarW val vidx <- exprToVarW idx vval' <- singletonPanic "genMachOp_slow" <$> castVarsW Signed [(vval, LMVector l ty)] doExprW ty $ Extract vval' vidx where ty = widthToLlvmFloat w -- Element insertion
317
genMachOp_slow _ (MO_VF_Extract l w) [val, idx] = runExprData $ do vval <- exprToVarW val vidx <- exprToVarW idx vval' <- singletonPanic "genMachOp_slow" <$> castVarsW Signed [(vval, LMVector l ty)] doExprW ty $ Extract vval' vidx where ty = widthToLlvmFloat w -- Element insertion
317
false
false
0
13
79
111
52
59
null
null
fatho/ninja
src/Graphics/Ninja/GL/VertexAttrib.hs
mit
storableVertexLayout :: Storable a => GLenum -> Int -> Int -> a -> VertexLayout storableVertexLayout dataType width num x = VertexLayout (sizeOf x) [ VertexAttribInfo "" width $ VertexAttribLayout num dataType False (sizeOf x) 0 ]
232
storableVertexLayout :: Storable a => GLenum -> Int -> Int -> a -> VertexLayout storableVertexLayout dataType width num x = VertexLayout (sizeOf x) [ VertexAttribInfo "" width $ VertexAttribLayout num dataType False (sizeOf x) 0 ]
232
storableVertexLayout dataType width num x = VertexLayout (sizeOf x) [ VertexAttribInfo "" width $ VertexAttribLayout num dataType False (sizeOf x) 0 ]
152
false
true
0
9
37
84
40
44
null
null
tamarin-prover/tamarin-prover
lib/theory/src/Theory/Text/Parser/Sapic.hs
gpl-3.0
-- used for debugging -- println :: String -> ParsecT String u Identity () -- println str = traceShowM str -- parse a process definition (let block) processDef :: OpenTheory -> Parser ProcessDef processDef thy= do letIdentifier i <- BC.pack <$> identifier equalSign p <- process thy return (ProcessDef (BC.unpack i) p ) -- | Parse a single sapic action, i.e., a thing that can appear before the ";" -- (This includes almost all items that are followed by one instead of two -- processes, the exception is replication)
599
processDef :: OpenTheory -> Parser ProcessDef processDef thy= do letIdentifier i <- BC.pack <$> identifier equalSign p <- process thy return (ProcessDef (BC.unpack i) p ) -- | Parse a single sapic action, i.e., a thing that can appear before the ";" -- (This includes almost all items that are followed by one instead of two -- processes, the exception is replication)
449
processDef thy= do letIdentifier i <- BC.pack <$> identifier equalSign p <- process thy return (ProcessDef (BC.unpack i) p ) -- | Parse a single sapic action, i.e., a thing that can appear before the ";" -- (This includes almost all items that are followed by one instead of two -- processes, the exception is replication)
403
true
true
0
12
170
79
39
40
null
null
lspitzner/brittany
data/Test397.hs
agpl-3.0
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } func = f where {-# INLINE f #-} f = id
157
func = f where {-# INLINE f #-} f = id
43
func = f where {-# INLINE f #-} f = id
43
true
false
2
5
26
23
9
14
null
null
rethab/habi
test/TestUtil.hs
mit
mock_decr_async = BS.map safePred
33
mock_decr_async = BS.map safePred
33
mock_decr_async = BS.map safePred
33
false
false
0
6
3
11
5
6
null
null
anton-k/sharc-timbre
src/Sharc/Instruments/TromboneMuted.hs
bsd-3-clause
note6 :: Note note6 = Note (Pitch 116.541 34 "a#2") 7 (Range (NoteRange (NoteRangeAmplitude 7342.08 63 4.0e-2) (NoteRangeHarmonicFreq 1 116.54)) (NoteRange (NoteRangeAmplitude 582.7 5 4128.0) (NoteRangeHarmonicFreq 85 9905.98))) [Harmonic 1 2.964 184.67 ,Harmonic 2 1.288 566.19 ,Harmonic 3 (-2.528) 419.35 ,Harmonic 4 0.258 1409.26 ,Harmonic 5 1.483 4128.0 ,Harmonic 6 2.074 799.45 ,Harmonic 7 (-2.479) 30.85 ,Harmonic 8 1.328 274.97 ,Harmonic 9 (-2.895) 184.79 ,Harmonic 10 0.794 509.93 ,Harmonic 11 (-1.346) 157.6 ,Harmonic 12 (-0.895) 190.46 ,Harmonic 13 2.082 146.94 ,Harmonic 14 2.116 651.79 ,Harmonic 15 (-2.785) 286.46 ,Harmonic 16 (-0.248) 108.15 ,Harmonic 17 2.011 202.48 ,Harmonic 18 (-2.645) 99.05 ,Harmonic 19 (-7.9e-2) 64.05 ,Harmonic 20 1.729 71.04 ,Harmonic 21 (-2.867) 26.91 ,Harmonic 22 0.138 29.34 ,Harmonic 23 1.764 26.12 ,Harmonic 24 2.747 11.4 ,Harmonic 25 1.515 7.15 ,Harmonic 26 0.639 7.76 ,Harmonic 27 1.064 12.41 ,Harmonic 28 3.097 22.15 ,Harmonic 29 (-1.998) 26.8 ,Harmonic 30 (-0.801) 16.53 ,Harmonic 31 2.053 13.6 ,Harmonic 32 (-2.545) 4.46 ,Harmonic 33 6.9e-2 5.49 ,Harmonic 34 (-1.239) 4.04 ,Harmonic 35 (-2.056) 3.14 ,Harmonic 36 2.399 10.29 ,Harmonic 37 (-3.057) 9.85 ,Harmonic 38 (-1.432) 5.92 ,Harmonic 39 (-0.271) 4.94 ,Harmonic 40 2.591 2.29 ,Harmonic 41 (-0.956) 1.49 ,Harmonic 42 2.891 0.62 ,Harmonic 43 0.731 0.82 ,Harmonic 44 1.493 1.36 ,Harmonic 45 (-0.838) 1.88 ,Harmonic 46 0.335 2.36 ,Harmonic 47 1.972 1.68 ,Harmonic 48 (-2.615) 1.99 ,Harmonic 49 (-2.234) 0.97 ,Harmonic 50 2.362 1.55 ,Harmonic 51 (-2.931) 1.79 ,Harmonic 52 (-1.866) 1.91 ,Harmonic 53 0.641 1.45 ,Harmonic 54 (-2.656) 0.37 ,Harmonic 55 (-0.74) 1.66 ,Harmonic 56 1.41 0.5 ,Harmonic 57 (-2.535) 1.21 ,Harmonic 58 (-2.272) 0.66 ,Harmonic 59 (-2.333) 0.62 ,Harmonic 60 (-2.082) 0.34 ,Harmonic 61 1.5 0.3 ,Harmonic 62 (-2.483) 0.37 ,Harmonic 63 2.682 4.0e-2 ,Harmonic 64 (-1.815) 0.36 ,Harmonic 65 (-1.439) 0.46 ,Harmonic 66 0.673 0.23 ,Harmonic 67 2.561 0.39 ,Harmonic 68 0.42 0.1 ,Harmonic 69 (-1.62) 0.22 ,Harmonic 70 1.624 0.72 ,Harmonic 71 2.973 0.35 ,Harmonic 72 (-1.781) 0.1 ,Harmonic 73 (-1.43) 0.39 ,Harmonic 74 2.693 0.24 ,Harmonic 75 2.314 0.78 ,Harmonic 76 (-2.772) 0.59 ,Harmonic 77 1.577 0.36 ,Harmonic 78 3.03 0.76 ,Harmonic 79 (-1.111) 0.61 ,Harmonic 80 0.835 0.58 ,Harmonic 81 3.039 0.33 ,Harmonic 82 (-1.643) 0.24 ,Harmonic 83 1.703 0.2 ,Harmonic 84 (-2.861) 0.44 ,Harmonic 85 (-1.746) 0.36]
2,833
note6 :: Note note6 = Note (Pitch 116.541 34 "a#2") 7 (Range (NoteRange (NoteRangeAmplitude 7342.08 63 4.0e-2) (NoteRangeHarmonicFreq 1 116.54)) (NoteRange (NoteRangeAmplitude 582.7 5 4128.0) (NoteRangeHarmonicFreq 85 9905.98))) [Harmonic 1 2.964 184.67 ,Harmonic 2 1.288 566.19 ,Harmonic 3 (-2.528) 419.35 ,Harmonic 4 0.258 1409.26 ,Harmonic 5 1.483 4128.0 ,Harmonic 6 2.074 799.45 ,Harmonic 7 (-2.479) 30.85 ,Harmonic 8 1.328 274.97 ,Harmonic 9 (-2.895) 184.79 ,Harmonic 10 0.794 509.93 ,Harmonic 11 (-1.346) 157.6 ,Harmonic 12 (-0.895) 190.46 ,Harmonic 13 2.082 146.94 ,Harmonic 14 2.116 651.79 ,Harmonic 15 (-2.785) 286.46 ,Harmonic 16 (-0.248) 108.15 ,Harmonic 17 2.011 202.48 ,Harmonic 18 (-2.645) 99.05 ,Harmonic 19 (-7.9e-2) 64.05 ,Harmonic 20 1.729 71.04 ,Harmonic 21 (-2.867) 26.91 ,Harmonic 22 0.138 29.34 ,Harmonic 23 1.764 26.12 ,Harmonic 24 2.747 11.4 ,Harmonic 25 1.515 7.15 ,Harmonic 26 0.639 7.76 ,Harmonic 27 1.064 12.41 ,Harmonic 28 3.097 22.15 ,Harmonic 29 (-1.998) 26.8 ,Harmonic 30 (-0.801) 16.53 ,Harmonic 31 2.053 13.6 ,Harmonic 32 (-2.545) 4.46 ,Harmonic 33 6.9e-2 5.49 ,Harmonic 34 (-1.239) 4.04 ,Harmonic 35 (-2.056) 3.14 ,Harmonic 36 2.399 10.29 ,Harmonic 37 (-3.057) 9.85 ,Harmonic 38 (-1.432) 5.92 ,Harmonic 39 (-0.271) 4.94 ,Harmonic 40 2.591 2.29 ,Harmonic 41 (-0.956) 1.49 ,Harmonic 42 2.891 0.62 ,Harmonic 43 0.731 0.82 ,Harmonic 44 1.493 1.36 ,Harmonic 45 (-0.838) 1.88 ,Harmonic 46 0.335 2.36 ,Harmonic 47 1.972 1.68 ,Harmonic 48 (-2.615) 1.99 ,Harmonic 49 (-2.234) 0.97 ,Harmonic 50 2.362 1.55 ,Harmonic 51 (-2.931) 1.79 ,Harmonic 52 (-1.866) 1.91 ,Harmonic 53 0.641 1.45 ,Harmonic 54 (-2.656) 0.37 ,Harmonic 55 (-0.74) 1.66 ,Harmonic 56 1.41 0.5 ,Harmonic 57 (-2.535) 1.21 ,Harmonic 58 (-2.272) 0.66 ,Harmonic 59 (-2.333) 0.62 ,Harmonic 60 (-2.082) 0.34 ,Harmonic 61 1.5 0.3 ,Harmonic 62 (-2.483) 0.37 ,Harmonic 63 2.682 4.0e-2 ,Harmonic 64 (-1.815) 0.36 ,Harmonic 65 (-1.439) 0.46 ,Harmonic 66 0.673 0.23 ,Harmonic 67 2.561 0.39 ,Harmonic 68 0.42 0.1 ,Harmonic 69 (-1.62) 0.22 ,Harmonic 70 1.624 0.72 ,Harmonic 71 2.973 0.35 ,Harmonic 72 (-1.781) 0.1 ,Harmonic 73 (-1.43) 0.39 ,Harmonic 74 2.693 0.24 ,Harmonic 75 2.314 0.78 ,Harmonic 76 (-2.772) 0.59 ,Harmonic 77 1.577 0.36 ,Harmonic 78 3.03 0.76 ,Harmonic 79 (-1.111) 0.61 ,Harmonic 80 0.835 0.58 ,Harmonic 81 3.039 0.33 ,Harmonic 82 (-1.643) 0.24 ,Harmonic 83 1.703 0.2 ,Harmonic 84 (-2.861) 0.44 ,Harmonic 85 (-1.746) 0.36]
2,833
note6 = Note (Pitch 116.541 34 "a#2") 7 (Range (NoteRange (NoteRangeAmplitude 7342.08 63 4.0e-2) (NoteRangeHarmonicFreq 1 116.54)) (NoteRange (NoteRangeAmplitude 582.7 5 4128.0) (NoteRangeHarmonicFreq 85 9905.98))) [Harmonic 1 2.964 184.67 ,Harmonic 2 1.288 566.19 ,Harmonic 3 (-2.528) 419.35 ,Harmonic 4 0.258 1409.26 ,Harmonic 5 1.483 4128.0 ,Harmonic 6 2.074 799.45 ,Harmonic 7 (-2.479) 30.85 ,Harmonic 8 1.328 274.97 ,Harmonic 9 (-2.895) 184.79 ,Harmonic 10 0.794 509.93 ,Harmonic 11 (-1.346) 157.6 ,Harmonic 12 (-0.895) 190.46 ,Harmonic 13 2.082 146.94 ,Harmonic 14 2.116 651.79 ,Harmonic 15 (-2.785) 286.46 ,Harmonic 16 (-0.248) 108.15 ,Harmonic 17 2.011 202.48 ,Harmonic 18 (-2.645) 99.05 ,Harmonic 19 (-7.9e-2) 64.05 ,Harmonic 20 1.729 71.04 ,Harmonic 21 (-2.867) 26.91 ,Harmonic 22 0.138 29.34 ,Harmonic 23 1.764 26.12 ,Harmonic 24 2.747 11.4 ,Harmonic 25 1.515 7.15 ,Harmonic 26 0.639 7.76 ,Harmonic 27 1.064 12.41 ,Harmonic 28 3.097 22.15 ,Harmonic 29 (-1.998) 26.8 ,Harmonic 30 (-0.801) 16.53 ,Harmonic 31 2.053 13.6 ,Harmonic 32 (-2.545) 4.46 ,Harmonic 33 6.9e-2 5.49 ,Harmonic 34 (-1.239) 4.04 ,Harmonic 35 (-2.056) 3.14 ,Harmonic 36 2.399 10.29 ,Harmonic 37 (-3.057) 9.85 ,Harmonic 38 (-1.432) 5.92 ,Harmonic 39 (-0.271) 4.94 ,Harmonic 40 2.591 2.29 ,Harmonic 41 (-0.956) 1.49 ,Harmonic 42 2.891 0.62 ,Harmonic 43 0.731 0.82 ,Harmonic 44 1.493 1.36 ,Harmonic 45 (-0.838) 1.88 ,Harmonic 46 0.335 2.36 ,Harmonic 47 1.972 1.68 ,Harmonic 48 (-2.615) 1.99 ,Harmonic 49 (-2.234) 0.97 ,Harmonic 50 2.362 1.55 ,Harmonic 51 (-2.931) 1.79 ,Harmonic 52 (-1.866) 1.91 ,Harmonic 53 0.641 1.45 ,Harmonic 54 (-2.656) 0.37 ,Harmonic 55 (-0.74) 1.66 ,Harmonic 56 1.41 0.5 ,Harmonic 57 (-2.535) 1.21 ,Harmonic 58 (-2.272) 0.66 ,Harmonic 59 (-2.333) 0.62 ,Harmonic 60 (-2.082) 0.34 ,Harmonic 61 1.5 0.3 ,Harmonic 62 (-2.483) 0.37 ,Harmonic 63 2.682 4.0e-2 ,Harmonic 64 (-1.815) 0.36 ,Harmonic 65 (-1.439) 0.46 ,Harmonic 66 0.673 0.23 ,Harmonic 67 2.561 0.39 ,Harmonic 68 0.42 0.1 ,Harmonic 69 (-1.62) 0.22 ,Harmonic 70 1.624 0.72 ,Harmonic 71 2.973 0.35 ,Harmonic 72 (-1.781) 0.1 ,Harmonic 73 (-1.43) 0.39 ,Harmonic 74 2.693 0.24 ,Harmonic 75 2.314 0.78 ,Harmonic 76 (-2.772) 0.59 ,Harmonic 77 1.577 0.36 ,Harmonic 78 3.03 0.76 ,Harmonic 79 (-1.111) 0.61 ,Harmonic 80 0.835 0.58 ,Harmonic 81 3.039 0.33 ,Harmonic 82 (-1.643) 0.24 ,Harmonic 83 1.703 0.2 ,Harmonic 84 (-2.861) 0.44 ,Harmonic 85 (-1.746) 0.36]
2,819
false
true
0
11
783
1,145
593
552
null
null
eunmin/fpis-hs
src/Ch4.hs
bsd-3-clause
optionFilter f (Some x) = if (f x) then Some x else None
112
optionFilter f (Some x) = if (f x) then Some x else None
112
optionFilter f (Some x) = if (f x) then Some x else None
112
false
false
0
7
68
34
17
17
null
null
anuraags/hs2048
src/Game.hs
bsd-3-clause
getColumnTile :: [Tile] -> ColType -> Maybe Tile getColumnTile (x:xs) 0 = Just x
82
getColumnTile :: [Tile] -> ColType -> Maybe Tile getColumnTile (x:xs) 0 = Just x
82
getColumnTile (x:xs) 0 = Just x
33
false
true
0
10
15
45
21
24
null
null
glguy/ssh-hans
src/Network/SSH/State.hs
bsd-3-clause
-- | Select our value from client and server values according to 'Role'. -- -- Mnemonic: argument order is the same as the function name: client -- and then server. clientAndServer2usAndThem :: Role -> a {- ^ client value -} -> a {- ^ server value -} -> (a, a) clientAndServer2usAndThem ClientRole c s = (c, s)
312
clientAndServer2usAndThem :: Role -> a {- ^ client value -} -> a {- ^ server value -} -> (a, a) clientAndServer2usAndThem ClientRole c s = (c, s)
147
clientAndServer2usAndThem ClientRole c s = (c, s)
49
true
true
0
10
58
54
30
24
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
predQTyConKey = mkPreludeTyConUnique 224
50
predQTyConKey = mkPreludeTyConUnique 224
50
predQTyConKey = mkPreludeTyConUnique 224
50
false
false
0
5
13
9
4
5
null
null
dcreager/cabal
Distribution/Simple/Utils.hs
bsd-3-clause
readUTF8File :: FilePath -> IO String readUTF8File f = fmap fromUTF8 . hGetContents =<< openBinaryFile f ReadMode
113
readUTF8File :: FilePath -> IO String readUTF8File f = fmap fromUTF8 . hGetContents =<< openBinaryFile f ReadMode
113
readUTF8File f = fmap fromUTF8 . hGetContents =<< openBinaryFile f ReadMode
75
false
true
0
7
16
37
17
20
null
null
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
stRados :: String stRados = Types.storageTypeToRaw StorageRados
63
stRados :: String stRados = Types.storageTypeToRaw StorageRados
63
stRados = Types.storageTypeToRaw StorageRados
45
false
true
0
6
6
16
8
8
null
null
np/ling
Ling/Norm.hs
bsd-3-clause
int0, int1 :: Term int0 = Lit (LInteger 0)
42
int0, int1 :: Term int0 = Lit (LInteger 0)
42
int0 = Lit (LInteger 0)
23
false
true
0
7
8
22
12
10
null
null
mightymoose/liquidhaskell
docs/slides/NEU14/00_Refinements.hs
bsd-3-clause
foldr f acc N = acc
26
foldr f acc N = acc
26
foldr f acc N = acc
26
false
false
1
5
12
19
6
13
null
null
seckcoder/vector
Data/Vector/Unboxed.hs
bsd-3-clause
elemIndex = G.elemIndex
23
elemIndex = G.elemIndex
23
elemIndex = G.elemIndex
23
false
false
0
5
2
8
4
4
null
null
Cahu/krpc-hs
src/KRPCHS/KerbalAlarmClock.hs
gpl-3.0
{- - The vessel that the alarm is attached to. -} getAlarmVessel :: KRPCHS.KerbalAlarmClock.Alarm -> RPCContext (KRPCHS.SpaceCenter.Vessel) getAlarmVessel thisArg = do let r = makeRequest "KerbalAlarmClock" "Alarm_get_Vessel" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
305
getAlarmVessel :: KRPCHS.KerbalAlarmClock.Alarm -> RPCContext (KRPCHS.SpaceCenter.Vessel) getAlarmVessel thisArg = do let r = makeRequest "KerbalAlarmClock" "Alarm_get_Vessel" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
253
getAlarmVessel thisArg = do let r = makeRequest "KerbalAlarmClock" "Alarm_get_Vessel" [makeArgument 0 thisArg] res <- sendRequest r processResponse res
163
true
true
0
13
49
76
35
41
null
null
ezyang/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
diffExpr top env (Lam b1 e1) (Lam b2 e2) | eqTypeX env (varType b1) (varType b2) -- False for Id/TyVar combination = diffExpr top (rnBndr2 env b1 b2) e1 e2
162
diffExpr top env (Lam b1 e1) (Lam b2 e2) | eqTypeX env (varType b1) (varType b2) -- False for Id/TyVar combination = diffExpr top (rnBndr2 env b1 b2) e1 e2
162
diffExpr top env (Lam b1 e1) (Lam b2 e2) | eqTypeX env (varType b1) (varType b2) -- False for Id/TyVar combination = diffExpr top (rnBndr2 env b1 b2) e1 e2
162
false
false
0
10
36
76
36
40
null
null
paolino/book-a-visit
common/Status.hs
bsd-3-clause
{- type ModTP (f :: Presence Role -> * -> * ) (g :: Role -> * -> * ) a = forall u. f (Present u) a -> g u a onBothP :: ModTP f g a -> PresenceRoled f a -> Roled g a onBothP s = bimap s s -} throughP :: (forall u . SummaryC u a => Transaction s u a -> b) -> PresenceRoled (Transaction s) a -> b throughP f (EGiver x) = f x
334
throughP :: (forall u . SummaryC u a => Transaction s u a -> b) -> PresenceRoled (Transaction s) a -> b throughP f (EGiver x) = f x
144
throughP f (EGiver x) = f x
27
true
true
0
10
94
73
36
37
null
null
demhydraz/waffle
src/Backend/Lua/Lua.hs
bsd-3-clause
makeOp e "or" x = Op e Or x
28
makeOp e "or" x = Op e Or x
28
makeOp e "or" x = Op e Or x
28
false
false
0
5
9
20
9
11
null
null
DATX02-17-26/DATX02-17-26
libsrc/Norm/SumsOfProducts.hs
gpl-2.0
stage :: Int stage = 5
22
stage :: Int stage = 5
22
stage = 5
9
false
true
0
6
5
18
7
11
null
null
sdiehl/ghc
compiler/main/DynFlags.hs
bsd-3-clause
addWay' :: Way -> DynFlags -> DynFlags addWay' w dflags0 = let platform = targetPlatform dflags0 dflags1 = dflags0 { ways = w : ways dflags0 } dflags2 = foldr setGeneralFlag' dflags1 (wayGeneralFlags platform w) dflags3 = foldr unSetGeneralFlag' dflags2 (wayUnsetGeneralFlags platform w) in dflags3
470
addWay' :: Way -> DynFlags -> DynFlags addWay' w dflags0 = let platform = targetPlatform dflags0 dflags1 = dflags0 { ways = w : ways dflags0 } dflags2 = foldr setGeneralFlag' dflags1 (wayGeneralFlags platform w) dflags3 = foldr unSetGeneralFlag' dflags2 (wayUnsetGeneralFlags platform w) in dflags3
470
addWay' w dflags0 = let platform = targetPlatform dflags0 dflags1 = dflags0 { ways = w : ways dflags0 } dflags2 = foldr setGeneralFlag' dflags1 (wayGeneralFlags platform w) dflags3 = foldr unSetGeneralFlag' dflags2 (wayUnsetGeneralFlags platform w) in dflags3
431
false
true
0
12
216
103
50
53
null
null
thoughtpolice/vacuum
src/GHC/Vacuum/Q.hs
lgpl-3.0
getQContents :: Q a -> IO [a] getQContents q = do a <- takeQ q as <- unsafeInterleaveIO (getQContents q) return (a:as)
124
getQContents :: Q a -> IO [a] getQContents q = do a <- takeQ q as <- unsafeInterleaveIO (getQContents q) return (a:as)
124
getQContents q = do a <- takeQ q as <- unsafeInterleaveIO (getQContents q) return (a:as)
94
false
true
0
10
27
66
30
36
null
null
maggy96/haskell
cis194/06-Lazy_Evaluation/HW06.hs
mit
sInterleave :: Stream a -> Stream a -> Stream a sInterleave (Cons x xs) b = Cons x $ sInterleave b xs
101
sInterleave :: Stream a -> Stream a -> Stream a sInterleave (Cons x xs) b = Cons x $ sInterleave b xs
101
sInterleave (Cons x xs) b = Cons x $ sInterleave b xs
53
false
true
0
7
21
53
24
29
null
null
ideas-edu/ideas
src/Ideas/Main/CGI.hs
apache-2.0
cleanupVarName "SCRIPT_NAME" = "CGI-Script-Name"
48
cleanupVarName "SCRIPT_NAME" = "CGI-Script-Name"
48
cleanupVarName "SCRIPT_NAME" = "CGI-Script-Name"
48
false
false
0
5
3
9
4
5
null
null
8l/beri
cherilibs/trunk/tools/debug/CheriCTL.hs
apache-2.0
pc :: TestIO Integer pc = do (ec,s1,s2) <- lift $ readProcessWithExitCode "./cherictl" ["pc"] "" let pPC = do string "DEBUG MIPS PC 0x" (l, b) <- number 4 16 hexDigit return b case (ec == ExitSuccess, runIdentity $ runPT (pPC) () "PC" s1) of (True, Right rv) -> return $ rv (True, Left err) -> throwError $ "can't parse PC:\n" ++ show err ++ "\n" ++ s1 (_ ) -> throwError $ "can't parse PC:\n" ++ s1
459
pc :: TestIO Integer pc = do (ec,s1,s2) <- lift $ readProcessWithExitCode "./cherictl" ["pc"] "" let pPC = do string "DEBUG MIPS PC 0x" (l, b) <- number 4 16 hexDigit return b case (ec == ExitSuccess, runIdentity $ runPT (pPC) () "PC" s1) of (True, Right rv) -> return $ rv (True, Left err) -> throwError $ "can't parse PC:\n" ++ show err ++ "\n" ++ s1 (_ ) -> throwError $ "can't parse PC:\n" ++ s1
459
pc = do (ec,s1,s2) <- lift $ readProcessWithExitCode "./cherictl" ["pc"] "" let pPC = do string "DEBUG MIPS PC 0x" (l, b) <- number 4 16 hexDigit return b case (ec == ExitSuccess, runIdentity $ runPT (pPC) () "PC" s1) of (True, Right rv) -> return $ rv (True, Left err) -> throwError $ "can't parse PC:\n" ++ show err ++ "\n" ++ s1 (_ ) -> throwError $ "can't parse PC:\n" ++ s1
438
false
true
0
14
137
197
96
101
null
null
isomorphism/webgl
src/Graphics/Rendering/WebGL/Constants.hs
mit
gl_RED :: GLenum gl_RED = 0x1903
32
gl_RED :: GLenum gl_RED = 0x1903
32
gl_RED = 0x1903
15
false
true
0
4
5
11
6
5
null
null
FranklinChen/hugs98-plus-Sep2006
packages/OpenAL/Sound/OpenAL/Constants.hs
bsd-3-clause
al_EXPONENT_DISTANCE = CONST_AL_EXPONENT_DISTANCE
64
al_EXPONENT_DISTANCE = CONST_AL_EXPONENT_DISTANCE
64
al_EXPONENT_DISTANCE = CONST_AL_EXPONENT_DISTANCE
64
false
false
0
4
17
6
3
3
null
null
sdiehl/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
isLocalRule :: CoreRule -> Bool isLocalRule = ru_local
54
isLocalRule :: CoreRule -> Bool isLocalRule = ru_local
54
isLocalRule = ru_local
22
false
true
0
7
7
22
9
13
null
null
jstolarek/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
caseE :: ExpQ -> [MatchQ] -> ExpQ caseE e ms = do { e1 <- e; ms1 <- sequence ms; return (CaseE e1 ms1) }
104
caseE :: ExpQ -> [MatchQ] -> ExpQ caseE e ms = do { e1 <- e; ms1 <- sequence ms; return (CaseE e1 ms1) }
104
caseE e ms = do { e1 <- e; ms1 <- sequence ms; return (CaseE e1 ms1) }
70
false
true
0
10
24
67
32
35
null
null
chjp2046/fbthrift
thrift/lib/hs/tests/PrettyJSONTests.hs
apache-2.0
main :: IO Counts main = runTestTT tests
40
main :: IO Counts main = runTestTT tests
40
main = runTestTT tests
22
false
true
0
5
7
17
8
9
null
null
brendanhay/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Asps/List.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). alUploadType :: Lens' AspsList (Maybe Text) alUploadType = lens _alUploadType (\ s a -> s{_alUploadType = a})
182
alUploadType :: Lens' AspsList (Maybe Text) alUploadType = lens _alUploadType (\ s a -> s{_alUploadType = a})
111
alUploadType = lens _alUploadType (\ s a -> s{_alUploadType = a})
67
true
true
0
9
28
48
25
23
null
null
haskell-works/conduit-succinct-json
src/Data/Succinct.hs
bsd-3-clause
stringToBits :: String -> [Bool] stringToBits [] = []
53
stringToBits :: String -> [Bool] stringToBits [] = []
53
stringToBits [] = []
20
false
true
0
6
8
25
13
12
null
null
NorfairKing/the-notes
src/Computability/RegularExpressions.hs
gpl-2.0
regularExpressionsOverAlphabet :: Note regularExpressionsOverAlphabet = de $ do s [the, set, " of ", regularExpression, "s over an ", alphabet, " ", m alph_, " is denoted as ", m reoa_]
191
regularExpressionsOverAlphabet :: Note regularExpressionsOverAlphabet = de $ do s [the, set, " of ", regularExpression, "s over an ", alphabet, " ", m alph_, " is denoted as ", m reoa_]
191
regularExpressionsOverAlphabet = de $ do s [the, set, " of ", regularExpression, "s over an ", alphabet, " ", m alph_, " is denoted as ", m reoa_]
152
false
true
0
10
36
57
32
25
null
null
pliosoft/toml-parse
src/Text/Toml/Query.hs
bsd-3-clause
-- | Index a path at current path indexArray :: Int -> TomlPath indexArray i = TomlPath [ArrayLookup i]
103
indexArray :: Int -> TomlPath indexArray i = TomlPath [ArrayLookup i]
69
indexArray i = TomlPath [ArrayLookup i]
39
true
true
0
7
18
28
14
14
null
null
cchalmers/geometry
src/Geometry/ThreeD/Combinators.hs
bsd-3-clause
-- | Translate the object along @unitX@ so that all points have -- positive x-values. alignXMin :: (InSpace v n a, R1 v, Enveloped a, HasOrigin a) => a -> a alignXMin = align unit_X
183
alignXMin :: (InSpace v n a, R1 v, Enveloped a, HasOrigin a) => a -> a alignXMin = align unit_X
95
alignXMin = align unit_X
24
true
true
0
6
36
51
27
24
null
null
kairuku/stack
src/Stack/Types/Config.hs
bsd-3-clause
-- | Directory containing the project's stack.yaml file bcRoot :: BuildConfig -> Path Abs Dir bcRoot = parent . bcStackYaml
123
bcRoot :: BuildConfig -> Path Abs Dir bcRoot = parent . bcStackYaml
67
bcRoot = parent . bcStackYaml
29
true
true
1
7
19
32
14
18
null
null
petertseng/adventofcode-hs
lib/AdventOfCode/Password.hs
apache-2.0
nextPair s = error ("not enough chars in password " ++ s)
57
nextPair s = error ("not enough chars in password " ++ s)
57
nextPair s = error ("not enough chars in password " ++ s)
57
false
false
0
7
11
19
9
10
null
null
brendanhay/gogol
gogol-pubsub/gen/Network/Google/PubSub/Types/Product.hs
mpl-2.0
-- | Creates a value of 'Empty' with the minimum fields required to make a request. -- empty :: Empty empty = Empty'
120
empty :: Empty empty = Empty'
33
empty = Empty'
14
true
true
0
4
26
13
8
5
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
fromFlag NoFlag = error "fromFlag NoFlag. Use fromFlagOrDefault"
66
fromFlag NoFlag = error "fromFlag NoFlag. Use fromFlagOrDefault"
66
fromFlag NoFlag = error "fromFlag NoFlag. Use fromFlagOrDefault"
66
false
false
0
5
9
12
5
7
null
null
el-devo/SAT
SAT.hs
bsd-3-clause
isUIP :: State -> Bool isUIP = (== 1) . cNum . conflict
55
isUIP :: State -> Bool isUIP = (== 1) . cNum . conflict
55
isUIP = (== 1) . cNum . conflict
32
false
true
0
7
12
34
16
18
null
null
msullivan/advent-of-code
2016/A20a.hs
mit
-------- matches k (lo,hi) = k >= lo && k <= hi
48
matches k (lo,hi) = k >= lo && k <= hi
38
matches k (lo,hi) = k >= lo && k <= hi
38
true
false
0
7
12
30
16
14
null
null
matthewscottgordon/funk
test/Test/Scope.hs
apache-2.0
bar2 = UnresolvedName "bar"
27
bar2 = UnresolvedName "bar"
27
bar2 = UnresolvedName "bar"
27
false
false
0
5
3
9
4
5
null
null
tensor5/tensor
src/Data/Tensor.hs
bsd-3-clause
-- | Transform a one-row matrix into a vector. rowVector2Vector ∷ IsTensor t ⇒ t '[ 'One, i] e → t '[i] e rowVector2Vector = unT1
129
rowVector2Vector ∷ IsTensor t ⇒ t '[ 'One, i] e → t '[i] e rowVector2Vector = unT1
82
rowVector2Vector = unT1
23
true
true
0
10
25
48
25
23
null
null
nbloomf/carl
test/Tests/Lib/Struct/Matrix.hs
gpl-3.0
testDagBipRingoidMat :: (Ringoid t, Arbitrary t, Show t, RingoidArb t) => t -> TestTree testDagBipRingoidMat t = testDagBipRingoid (mCell t)
140
testDagBipRingoidMat :: (Ringoid t, Arbitrary t, Show t, RingoidArb t) => t -> TestTree testDagBipRingoidMat t = testDagBipRingoid (mCell t)
140
testDagBipRingoidMat t = testDagBipRingoid (mCell t)
52
false
true
0
7
19
54
27
27
null
null
phischu/fragnix
builtins/integer-gmp/GHC.Integer.Type.hs
bsd-3-clause
remInteger (Jn# n) (Jn# d) = bigNatToNegInteger (remBigNat n d)
65
remInteger (Jn# n) (Jn# d) = bigNatToNegInteger (remBigNat n d)
65
remInteger (Jn# n) (Jn# d) = bigNatToNegInteger (remBigNat n d)
65
false
false
0
7
11
34
16
18
null
null
keera-studios/hsQt
Qtc/Enums/Network/QFtp.hs
bsd-2-clause
ePassive :: TransferMode ePassive = ieTransferMode $ 1
56
ePassive :: TransferMode ePassive = ieTransferMode $ 1
56
ePassive = ieTransferMode $ 1
31
false
true
0
6
9
18
8
10
null
null
christiaanb/cabal
cabal-install/Distribution/Client/Init.hs
bsd-3-clause
getLibOrExec :: InitFlags -> IO InitFlags getLibOrExec flags = do isLib <- return (flagToMaybe $ packageType flags) ?>> maybePrompt flags (either (const Library) id `fmap` promptList "What does the package build" [Library, Executable] Nothing display False) ?>> return (Just Library) mainFile <- if isLib /= Just Executable then return Nothing else getMainFile flags return $ flags { packageType = maybeToFlag isLib , mainIs = maybeToFlag mainFile } -- | Try to guess the main file of the executable, and prompt the user to choose -- one of them. Top-level modules including the word 'Main' in the file name -- will be candidates, and shorter filenames will be preferred.
864
getLibOrExec :: InitFlags -> IO InitFlags getLibOrExec flags = do isLib <- return (flagToMaybe $ packageType flags) ?>> maybePrompt flags (either (const Library) id `fmap` promptList "What does the package build" [Library, Executable] Nothing display False) ?>> return (Just Library) mainFile <- if isLib /= Just Executable then return Nothing else getMainFile flags return $ flags { packageType = maybeToFlag isLib , mainIs = maybeToFlag mainFile } -- | Try to guess the main file of the executable, and prompt the user to choose -- one of them. Top-level modules including the word 'Main' in the file name -- will be candidates, and shorter filenames will be preferred.
864
getLibOrExec flags = do isLib <- return (flagToMaybe $ packageType flags) ?>> maybePrompt flags (either (const Library) id `fmap` promptList "What does the package build" [Library, Executable] Nothing display False) ?>> return (Just Library) mainFile <- if isLib /= Just Executable then return Nothing else getMainFile flags return $ flags { packageType = maybeToFlag isLib , mainIs = maybeToFlag mainFile } -- | Try to guess the main file of the executable, and prompt the user to choose -- one of them. Top-level modules including the word 'Main' in the file name -- will be candidates, and shorter filenames will be preferred.
822
false
true
0
15
300
158
79
79
null
null
olorin/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | The supplied value is not a valid DB cluster snapshot state. _InvalidDBClusterSnapshotStateFault :: AsError a => Getting (First ServiceError) a ServiceError _InvalidDBClusterSnapshotStateFault = _ServiceError . hasStatus 400 . hasCode "InvalidDBClusterSnapshotStateFault"
284
_InvalidDBClusterSnapshotStateFault :: AsError a => Getting (First ServiceError) a ServiceError _InvalidDBClusterSnapshotStateFault = _ServiceError . hasStatus 400 . hasCode "InvalidDBClusterSnapshotStateFault"
218
_InvalidDBClusterSnapshotStateFault = _ServiceError . hasStatus 400 . hasCode "InvalidDBClusterSnapshotStateFault"
122
true
true
0
8
39
46
22
24
null
null
jgm/blaze-html
Text/Blaze/Renderer/String.hs
bsd-3-clause
fromChoiceString :: ChoiceString -- ^ String to render -> String -- ^ String to append -> String -- ^ Resulting string fromChoiceString (Static s) = getString s
213
fromChoiceString :: ChoiceString -- ^ String to render -> String -- ^ String to append -> String fromChoiceString (Static s) = getString s
184
fromChoiceString (Static s) = getString s
45
true
true
0
7
79
34
18
16
null
null
Kheldar/hw-koans
solution/Koan/Start.hs
bsd-3-clause
enrolled :: Bool enrolled = True
32
enrolled :: Bool enrolled = True
32
enrolled = True
15
false
true
0
4
5
11
6
5
null
null
jstolarek/slicer
lib/Language/Slicer/Parser.hs
gpl-3.0
strDouble = "double"
27
strDouble = "double"
27
strDouble = "double"
27
false
false
1
5
9
10
3
7
null
null
dorchard/gram_lang
frontend/src/Language/Granule/Context.hs
bsd-3-clause
replace (x : ctxt) name v = x : replace ctxt name v
53
replace (x : ctxt) name v = x : replace ctxt name v
53
replace (x : ctxt) name v = x : replace ctxt name v
53
false
false
0
7
14
31
15
16
null
null
tanimoto/iteratee
tests/bench_strings.hs
bsd-3-clause
main :: IO () main = defaultMain [ bench "Vanilla String" bench_string , bench "Vanilla ByteString" bench_byte , bench "Vanilla Lazy ByteString" bench_byte_lazy , bench "Iteratee String" bench_iter_string , bench "Iteratee ByteString" bench_iter_byte ]
290
main :: IO () main = defaultMain [ bench "Vanilla String" bench_string , bench "Vanilla ByteString" bench_byte , bench "Vanilla Lazy ByteString" bench_byte_lazy , bench "Iteratee String" bench_iter_string , bench "Iteratee ByteString" bench_iter_byte ]
290
main = defaultMain [ bench "Vanilla String" bench_string , bench "Vanilla ByteString" bench_byte , bench "Vanilla Lazy ByteString" bench_byte_lazy , bench "Iteratee String" bench_iter_string , bench "Iteratee ByteString" bench_iter_byte ]
276
false
true
0
6
71
59
29
30
null
null
SKA-ScienceDataProcessor/RC
MS3/Sketches/GPU_Gridders/GPUGridder.hs
apache-2.0
normalizeAndExtractPolarization :: Int -> CUDA.CxDoubleDevPtr -> Grid -> IO () normalizeAndExtractPolarization pol polp (Grid _ gridp) = -- 128 * 32 = 4096 CUDA.launchKernel normalizeAndExtractPolarization_c (128, 128, 1) (32, 32, 1) 0 Nothing $ mapArgs polp gridp (fromIntegral pol :: Int32)
296
normalizeAndExtractPolarization :: Int -> CUDA.CxDoubleDevPtr -> Grid -> IO () normalizeAndExtractPolarization pol polp (Grid _ gridp) = -- 128 * 32 = 4096 CUDA.launchKernel normalizeAndExtractPolarization_c (128, 128, 1) (32, 32, 1) 0 Nothing $ mapArgs polp gridp (fromIntegral pol :: Int32)
296
normalizeAndExtractPolarization pol polp (Grid _ gridp) = -- 128 * 32 = 4096 CUDA.launchKernel normalizeAndExtractPolarization_c (128, 128, 1) (32, 32, 1) 0 Nothing $ mapArgs polp gridp (fromIntegral pol :: Int32)
217
false
true
0
9
44
97
51
46
null
null
apyrgio/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
inicParams :: FrozenSet String inicParams = ConstantUtils.mkSet (Map.keys inicParamsTypes)
90
inicParams :: FrozenSet String inicParams = ConstantUtils.mkSet (Map.keys inicParamsTypes)
90
inicParams = ConstantUtils.mkSet (Map.keys inicParamsTypes)
59
false
true
0
8
8
27
13
14
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionBackendServices/Update.hs
mpl-2.0
-- | Name of the region scoping this request. rbsuRegion :: Lens' RegionBackendServicesUpdate Text rbsuRegion = lens _rbsuRegion (\ s a -> s{_rbsuRegion = a})
160
rbsuRegion :: Lens' RegionBackendServicesUpdate Text rbsuRegion = lens _rbsuRegion (\ s a -> s{_rbsuRegion = a})
114
rbsuRegion = lens _rbsuRegion (\ s a -> s{_rbsuRegion = a})
61
true
true
1
9
26
46
22
24
null
null
energyflowanalysis/efa-2.1
src/EFA/Flow/Draw.hs
bsd-3-clause
dotFromPartGraph :: (Part part, Node.C node) => part -> (String, Graph node Graph.EitherEdge Unicode TopologyEdgeLabel) -> DotSubGraph T.Text dotFromPartGraph current (subtitle, gr) = DotSG True (Just $ Str $ T.pack $ dotIdentFromPart current) $ let (nodes, edges) = dotNodesEdgesFromPartGraph gr in DotStmts [GraphAttrs [labelFromString subtitle]] [] (map (dotNodeInPart current) nodes) (map (dotEdgeInPart current) edges)
489
dotFromPartGraph :: (Part part, Node.C node) => part -> (String, Graph node Graph.EitherEdge Unicode TopologyEdgeLabel) -> DotSubGraph T.Text dotFromPartGraph current (subtitle, gr) = DotSG True (Just $ Str $ T.pack $ dotIdentFromPart current) $ let (nodes, edges) = dotNodesEdgesFromPartGraph gr in DotStmts [GraphAttrs [labelFromString subtitle]] [] (map (dotNodeInPart current) nodes) (map (dotEdgeInPart current) edges)
489
dotFromPartGraph current (subtitle, gr) = DotSG True (Just $ Str $ T.pack $ dotIdentFromPart current) $ let (nodes, edges) = dotNodesEdgesFromPartGraph gr in DotStmts [GraphAttrs [labelFromString subtitle]] [] (map (dotNodeInPart current) nodes) (map (dotEdgeInPart current) edges)
331
false
true
0
12
119
170
85
85
null
null
brendanhay/gogol
gogol-digitalassetlinks/gen/Network/Google/Resource/DigitalAssetLinks/Statements/List.hs
mpl-2.0
-- | Web assets are identified by a URL that contains only the scheme, -- hostname and port parts. The format is http[s]:\/\/[:] Hostnames must be -- fully qualified: they must end in a single period (\"\`.\`\"). Only the -- schemes \"http\" and \"https\" are currently allowed. Port numbers are -- given as a decimal number, and they must be omitted if the standard port -- numbers are used: 80 for http and 443 for https. We call this limited -- URL the \"site\". All URLs that share the same scheme, hostname and port -- are considered to be a part of the site and thus belong to the web -- asset. Example: the asset with the site \`https:\/\/www.google.com\` -- contains all these URLs: * \`https:\/\/www.google.com\/\` * -- \`https:\/\/www.google.com:443\/\` * \`https:\/\/www.google.com\/foo\` * -- \`https:\/\/www.google.com\/foo?bar\` * -- \`https:\/\/www.google.com\/foo#bar\` * -- \`https:\/\/user\'password:www.google.com\/\` But it does not contain -- these URLs: * \`http:\/\/www.google.com\/\` (wrong scheme) * -- \`https:\/\/google.com\/\` (hostname does not match) * -- \`https:\/\/www.google.com:444\/\` (port does not match) REQUIRED slSourceWebSite :: Lens' StatementsList (Maybe Text) slSourceWebSite = lens _slSourceWebSite (\ s a -> s{_slSourceWebSite = a})
1,287
slSourceWebSite :: Lens' StatementsList (Maybe Text) slSourceWebSite = lens _slSourceWebSite (\ s a -> s{_slSourceWebSite = a})
135
slSourceWebSite = lens _slSourceWebSite (\ s a -> s{_slSourceWebSite = a})
82
true
true
1
9
191
67
41
26
null
null
joranvar/GoogleCodeJam
Y2015/Q/DTest.hs
gpl-3.0
runsolve = unlines . showSolutions . map (show . solve) . parse . tail . lines where showSolutions = zipWith (++) ["Case #" ++ show i ++ ": " | i <- [1::Int ..]]
165
runsolve = unlines . showSolutions . map (show . solve) . parse . tail . lines where showSolutions = zipWith (++) ["Case #" ++ show i ++ ": " | i <- [1::Int ..]]
165
runsolve = unlines . showSolutions . map (show . solve) . parse . tail . lines where showSolutions = zipWith (++) ["Case #" ++ show i ++ ": " | i <- [1::Int ..]]
165
false
false
0
11
37
79
42
37
null
null
philopon/best-haskell
src/best-haskell.hs
mit
rankingFilter :: Day -> [T.Text] -> [T.Text] -> Maybe T.Text -> [T.Text] -> Bool -> Bool -> Maybe CabalType -> M.Document rankingFilter end cats ms lcs pkg actv new typ = (if null cats then id else (:) ("$and" M.=: map (\c -> ["category" M.=: c]) cats)) $ (if null ms then id else (:) ("maintainers" M.=: ["$in" M.=: ms])) $ (case lcs of {Nothing -> id; Just l -> (("license" M.=: l):)}) $ (if null pkg then id else (:) ("$and" M.=: map (\p -> ["name" M.=: M.Regex p "i"]) pkg)) $ (if not new then id else (:) ("initialRelease" M.=: ["$gt" M.=: UTCTime (addDays (-31) end) 0])) $ (if not actv then id else (:) ("lastRelease" M.=: ["$gt" M.=: UTCTime (addDays (-31) end) 0])) $ case typ of Nothing -> [] Just Library -> ["hasLibrary" M.=: True] Just Executable -> ["executables" M.=: ["$ne" M.=: ([] :: [T.Text])]]
886
rankingFilter :: Day -> [T.Text] -> [T.Text] -> Maybe T.Text -> [T.Text] -> Bool -> Bool -> Maybe CabalType -> M.Document rankingFilter end cats ms lcs pkg actv new typ = (if null cats then id else (:) ("$and" M.=: map (\c -> ["category" M.=: c]) cats)) $ (if null ms then id else (:) ("maintainers" M.=: ["$in" M.=: ms])) $ (case lcs of {Nothing -> id; Just l -> (("license" M.=: l):)}) $ (if null pkg then id else (:) ("$and" M.=: map (\p -> ["name" M.=: M.Regex p "i"]) pkg)) $ (if not new then id else (:) ("initialRelease" M.=: ["$gt" M.=: UTCTime (addDays (-31) end) 0])) $ (if not actv then id else (:) ("lastRelease" M.=: ["$gt" M.=: UTCTime (addDays (-31) end) 0])) $ case typ of Nothing -> [] Just Library -> ["hasLibrary" M.=: True] Just Executable -> ["executables" M.=: ["$ne" M.=: ([] :: [T.Text])]]
886
rankingFilter end cats ms lcs pkg actv new typ = (if null cats then id else (:) ("$and" M.=: map (\c -> ["category" M.=: c]) cats)) $ (if null ms then id else (:) ("maintainers" M.=: ["$in" M.=: ms])) $ (case lcs of {Nothing -> id; Just l -> (("license" M.=: l):)}) $ (if null pkg then id else (:) ("$and" M.=: map (\p -> ["name" M.=: M.Regex p "i"]) pkg)) $ (if not new then id else (:) ("initialRelease" M.=: ["$gt" M.=: UTCTime (addDays (-31) end) 0])) $ (if not actv then id else (:) ("lastRelease" M.=: ["$gt" M.=: UTCTime (addDays (-31) end) 0])) $ case typ of Nothing -> [] Just Library -> ["hasLibrary" M.=: True] Just Executable -> ["executables" M.=: ["$ne" M.=: ([] :: [T.Text])]]
764
false
true
0
20
221
471
254
217
null
null
HIPERFIT/futhark
src/Futhark/CodeGen/ImpGen.hs
isc
compileAlloc pat _ _ = error $ "compileAlloc: Invalid pattern: " ++ pretty pat
80
compileAlloc pat _ _ = error $ "compileAlloc: Invalid pattern: " ++ pretty pat
80
compileAlloc pat _ _ = error $ "compileAlloc: Invalid pattern: " ++ pretty pat
80
false
false
0
6
15
24
11
13
null
null
mdsteele/fallback
src/Fallback/State/Action.hs
gpl-3.0
coneTarget :: Double -> Int -> TargetKind (Position, [Position]) coneTarget degrees maxRange = AreaTarget fn maxRange where fn :: (AreaState a) => a -> CharacterNumber -> Position -> [Position] fn ars charNum target = if target == origin then [] else let fov = arsVisibleForCharacter charNum ars vecTo pos = fmap fromIntegral $ pos `pSub` origin canHit pos = pos /= origin && Set.member pos fov && pVectorAngle (vecTo target) (vecTo pos) <= semiAngle in filter canHit $ circleArea origin (ofRadius maxRange) where origin = arsCharacterPosition charNum ars semiAngle = pi * degrees / 360
641
coneTarget :: Double -> Int -> TargetKind (Position, [Position]) coneTarget degrees maxRange = AreaTarget fn maxRange where fn :: (AreaState a) => a -> CharacterNumber -> Position -> [Position] fn ars charNum target = if target == origin then [] else let fov = arsVisibleForCharacter charNum ars vecTo pos = fmap fromIntegral $ pos `pSub` origin canHit pos = pos /= origin && Set.member pos fov && pVectorAngle (vecTo target) (vecTo pos) <= semiAngle in filter canHit $ circleArea origin (ofRadius maxRange) where origin = arsCharacterPosition charNum ars semiAngle = pi * degrees / 360
641
coneTarget degrees maxRange = AreaTarget fn maxRange where fn :: (AreaState a) => a -> CharacterNumber -> Position -> [Position] fn ars charNum target = if target == origin then [] else let fov = arsVisibleForCharacter charNum ars vecTo pos = fmap fromIntegral $ pos `pSub` origin canHit pos = pos /= origin && Set.member pos fov && pVectorAngle (vecTo target) (vecTo pos) <= semiAngle in filter canHit $ circleArea origin (ofRadius maxRange) where origin = arsCharacterPosition charNum ars semiAngle = pi * degrees / 360
576
false
true
0
16
149
226
114
112
null
null
trskop/cabal
Cabal/Distribution/Simple/GHC.hs
bsd-3-clause
buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO () buildLib = buildOrReplLib False
231
buildLib, replLib :: Verbosity -> Cabal.Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO () buildLib = buildOrReplLib False
231
buildLib = buildOrReplLib False
31
false
true
0
12
78
56
28
28
null
null
merc1031/haskell-sonos-http-api
externals/test-preproc/Main.hs
bsd-3-clause
noExts :: String -> String noExts = dropExtension
49
noExts :: String -> String noExts = dropExtension
49
noExts = dropExtension
22
false
true
0
5
7
15
8
7
null
null
diku-dk/futhark
src/Futhark/Pass/ExpandAllocations.hs
isc
transformStm :: Stm GPUMem -> ExpandM (Stms GPUMem) -- It is possible that we are unable to expand allocations in some -- code versions. If so, we can remove the offending branch. Only if -- both versions fail do we propagate the error. transformStm (Let pat aux (If cond tbranch fbranch (IfDec ts IfEquiv))) = do tbranch' <- (Right <$> transformBody tbranch) `catchError` (pure . Left) fbranch' <- (Right <$> transformBody fbranch) `catchError` (pure . Left) case (tbranch', fbranch') of (Left _, Right fbranch'') -> pure $ useBranch fbranch'' (Right tbranch'', Left _) -> pure $ useBranch tbranch'' (Right tbranch'', Right fbranch'') -> pure $ oneStm $ Let pat aux $ If cond tbranch'' fbranch'' (IfDec ts IfEquiv) (Left e, _) -> throwError e where bindRes pe (SubExpRes cs se) = certify cs $ Let (Pat [pe]) (defAux ()) $ BasicOp $ SubExp se useBranch b = bodyStms b <> stmsFromList (zipWith bindRes (patElems pat) (bodyResult b))
1,010
transformStm :: Stm GPUMem -> ExpandM (Stms GPUMem) transformStm (Let pat aux (If cond tbranch fbranch (IfDec ts IfEquiv))) = do tbranch' <- (Right <$> transformBody tbranch) `catchError` (pure . Left) fbranch' <- (Right <$> transformBody fbranch) `catchError` (pure . Left) case (tbranch', fbranch') of (Left _, Right fbranch'') -> pure $ useBranch fbranch'' (Right tbranch'', Left _) -> pure $ useBranch tbranch'' (Right tbranch'', Right fbranch'') -> pure $ oneStm $ Let pat aux $ If cond tbranch'' fbranch'' (IfDec ts IfEquiv) (Left e, _) -> throwError e where bindRes pe (SubExpRes cs se) = certify cs $ Let (Pat [pe]) (defAux ()) $ BasicOp $ SubExp se useBranch b = bodyStms b <> stmsFromList (zipWith bindRes (patElems pat) (bodyResult b))
823
transformStm (Let pat aux (If cond tbranch fbranch (IfDec ts IfEquiv))) = do tbranch' <- (Right <$> transformBody tbranch) `catchError` (pure . Left) fbranch' <- (Right <$> transformBody fbranch) `catchError` (pure . Left) case (tbranch', fbranch') of (Left _, Right fbranch'') -> pure $ useBranch fbranch'' (Right tbranch'', Left _) -> pure $ useBranch tbranch'' (Right tbranch'', Right fbranch'') -> pure $ oneStm $ Let pat aux $ If cond tbranch'' fbranch'' (IfDec ts IfEquiv) (Left e, _) -> throwError e where bindRes pe (SubExpRes cs se) = certify cs $ Let (Pat [pe]) (defAux ()) $ BasicOp $ SubExp se useBranch b = bodyStms b <> stmsFromList (zipWith bindRes (patElems pat) (bodyResult b))
771
true
true
5
13
235
370
178
192
null
null
ekmett/containers
Data/Set/Base.hs
bsd-3-clause
trim (JustS lx) (JustS hx) t = middle lx hx t where middle lo hi (Bin _ x _ r) | x <= lo = middle lo hi r middle lo hi (Bin _ x l _) | x >= hi = middle lo hi l middle _ _ t' = t' #if __GLASGOW_HASKELL__ >= 700
319
trim (JustS lx) (JustS hx) t = middle lx hx t where middle lo hi (Bin _ x _ r) | x <= lo = middle lo hi r middle lo hi (Bin _ x l _) | x >= hi = middle lo hi l middle _ _ t' = t' #if __GLASGOW_HASKELL__ >= 700
319
trim (JustS lx) (JustS hx) t = middle lx hx t where middle lo hi (Bin _ x _ r) | x <= lo = middle lo hi r middle lo hi (Bin _ x l _) | x >= hi = middle lo hi l middle _ _ t' = t' #if __GLASGOW_HASKELL__ >= 700
319
false
false
6
9
165
128
61
67
null
null
Charlesetc/haskell-parsing
src/Pear/Operator/Concrete.hs
bsd-3-clause
parseAlgebra :: (PAlgebra a) -> Parser a parseAlgebra alg = evalTree <$> (shuntingYard alg)
91
parseAlgebra :: (PAlgebra a) -> Parser a parseAlgebra alg = evalTree <$> (shuntingYard alg)
91
parseAlgebra alg = evalTree <$> (shuntingYard alg)
50
false
true
0
7
13
37
18
19
null
null
rueshyna/gogol
gogol-plus-domains/gen/Network/Google/Resource/PlusDomains/Activities/Insert.hs
mpl-2.0
-- | Multipart request metadata. aiPayload :: Lens' ActivitiesInsert Activity aiPayload = lens _aiPayload (\ s a -> s{_aiPayload = a})
136
aiPayload :: Lens' ActivitiesInsert Activity aiPayload = lens _aiPayload (\ s a -> s{_aiPayload = a})
103
aiPayload = lens _aiPayload (\ s a -> s{_aiPayload = a})
58
true
true
0
9
22
47
23
24
null
null
geocurnoff/nikki
src/Physics/Chipmunk/Types.hs
lgpl-3.0
initChipmunk space as@BodyAttributes{} shapeTypes baryCenterOffset = do body <- mkBody as spaceAdd space body let chip = Chipmunk space body [] [] baryCenterOffset addInitShape chip shapeTypes
208
initChipmunk space as@BodyAttributes{} shapeTypes baryCenterOffset = do body <- mkBody as spaceAdd space body let chip = Chipmunk space body [] [] baryCenterOffset addInitShape chip shapeTypes
208
initChipmunk space as@BodyAttributes{} shapeTypes baryCenterOffset = do body <- mkBody as spaceAdd space body let chip = Chipmunk space body [] [] baryCenterOffset addInitShape chip shapeTypes
208
false
false
1
12
41
79
33
46
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
recklessly = id
15
recklessly = id
15
recklessly = id
15
false
false
0
4
2
6
3
3
null
null
rueshyna/gogol
gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Subscriptions/SetIAMPolicy.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). pssipUploadProtocol :: Lens' ProjectsSubscriptionsSetIAMPolicy (Maybe Text) pssipUploadProtocol = lens _pssipUploadProtocol (\ s a -> s{_pssipUploadProtocol = a})
232
pssipUploadProtocol :: Lens' ProjectsSubscriptionsSetIAMPolicy (Maybe Text) pssipUploadProtocol = lens _pssipUploadProtocol (\ s a -> s{_pssipUploadProtocol = a})
170
pssipUploadProtocol = lens _pssipUploadProtocol (\ s a -> s{_pssipUploadProtocol = a})
94
true
true
0
9
33
48
25
23
null
null
fmapfmapfmap/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeTapeArchives.hs
mpl-2.0
-- | Creates a value of 'DescribeTapeArchivesResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dtarsTapeArchives' -- -- * 'dtarsMarker' -- -- * 'dtarsResponseStatus' describeTapeArchivesResponse :: Int -- ^ 'dtarsResponseStatus' -> DescribeTapeArchivesResponse describeTapeArchivesResponse pResponseStatus_ = DescribeTapeArchivesResponse' { _dtarsTapeArchives = Nothing , _dtarsMarker = Nothing , _dtarsResponseStatus = pResponseStatus_ }
560
describeTapeArchivesResponse :: Int -- ^ 'dtarsResponseStatus' -> DescribeTapeArchivesResponse describeTapeArchivesResponse pResponseStatus_ = DescribeTapeArchivesResponse' { _dtarsTapeArchives = Nothing , _dtarsMarker = Nothing , _dtarsResponseStatus = pResponseStatus_ }
300
describeTapeArchivesResponse pResponseStatus_ = DescribeTapeArchivesResponse' { _dtarsTapeArchives = Nothing , _dtarsMarker = Nothing , _dtarsResponseStatus = pResponseStatus_ }
197
true
true
0
7
94
57
34
23
null
null
acowley/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
traversableClassKey = mkPreludeClassUnique 36
49
traversableClassKey = mkPreludeClassUnique 36
49
traversableClassKey = mkPreludeClassUnique 36
49
false
false
0
5
7
9
4
5
null
null
nevrenato/Hets_Fork
LF/Analysis.hs
gpl-2.0
gen :: String gen = "gen_"
26
gen :: String gen = "gen_"
26
gen = "gen_"
12
false
true
0
6
5
18
7
11
null
null
gsdlab/clafer
src/Language/Clafer/Generator/Html.hs
mit
printPosIdentRef (PosIdent (_, "ref")) _ html = printDeprecated "ref" "Use `dref` instead." html
98
printPosIdentRef (PosIdent (_, "ref")) _ html = printDeprecated "ref" "Use `dref` instead." html
98
printPosIdentRef (PosIdent (_, "ref")) _ html = printDeprecated "ref" "Use `dref` instead." html
98
false
false
0
8
14
32
16
16
null
null
sigrlami/pollock
app-reflex/app/Main.hs
mit
-------------------------------------------------------------------------- rmdups :: Ord a => [a] -> [a] rmdups = rmdups' Set.empty where rmdups' _ [] = [] rmdups' a (b : c) = if Set.member b a then rmdups' a c else b : rmdups' (Set.insert b a) c
258
rmdups :: Ord a => [a] -> [a] rmdups = rmdups' Set.empty where rmdups' _ [] = [] rmdups' a (b : c) = if Set.member b a then rmdups' a c else b : rmdups' (Set.insert b a) c
183
rmdups = rmdups' Set.empty where rmdups' _ [] = [] rmdups' a (b : c) = if Set.member b a then rmdups' a c else b : rmdups' (Set.insert b a) c
153
true
true
2
9
52
119
56
63
null
null
icyfork/shellcheck
ShellCheck/AST.hs
gpl-3.0
analyze :: Monad m => (Token -> m ()) -> (Token -> m ()) -> (Token -> Token) -> Token -> m Token analyze f g i = round where round t = do f t newT <- delve t g t return . i $ newT roundAll = mapM round roundMaybe Nothing = return Nothing roundMaybe (Just v) = do s <- round v return (Just s) dl l v = do x <- roundAll l return $ v x dll l m v = do x <- roundAll l y <- roundAll m return $ v x m d1 t v = do x <- round t return $ v x d2 t1 t2 v = do x <- round t1 y <- round t2 return $ v x y delve (T_NormalWord id list) = dl list $ T_NormalWord id delve (T_DoubleQuoted id list) = dl list $ T_DoubleQuoted id delve (T_DollarDoubleQuoted id list) = dl list $ T_DollarDoubleQuoted id delve (T_DollarExpansion id list) = dl list $ T_DollarExpansion id delve (T_BraceExpansion id list) = dl list $ T_BraceExpansion id delve (T_Backticked id list) = dl list $ T_Backticked id delve (T_DollarArithmetic id c) = d1 c $ T_DollarArithmetic id delve (T_DollarBracket id c) = d1 c $ T_DollarBracket id delve (T_IoFile id op file) = d2 op file $ T_IoFile id delve (T_HereString id word) = d1 word $ T_HereString id delve (T_FdRedirect id v t) = d1 t $ T_FdRedirect id v delve (T_Assignment id mode var index value) = do a <- roundMaybe index b <- round value return $ T_Assignment id mode var a b delve (T_Array id t) = dl t $ T_Array id delve (T_IndexedElement id t1 t2) = d2 t1 t2 $ T_IndexedElement id delve (T_Redirecting id redirs cmd) = do a <- roundAll redirs b <- round cmd return $ T_Redirecting id a b delve (T_SimpleCommand id vars cmds) = dll vars cmds $ T_SimpleCommand id delve (T_Pipeline id l1 l2) = dll l1 l2 $ T_Pipeline id delve (T_Banged id l) = d1 l $ T_Banged id delve (T_AndIf id t u) = d2 t u $ T_AndIf id delve (T_OrIf id t u) = d2 t u $ T_OrIf id delve (T_Backgrounded id l) = d1 l $ T_Backgrounded id delve (T_Subshell id l) = dl l $ T_Subshell id delve (T_ProcSub id typ l) = dl l $ T_ProcSub id typ delve (T_Arithmetic id c) = d1 c $ T_Arithmetic id delve (T_IfExpression id conditions elses) = do newConds <- mapM (\(c, t) -> do x <- mapM round c y <- mapM round t return (x,y) ) conditions newElses <- roundAll elses return $ T_IfExpression id newConds newElses delve (T_BraceGroup id l) = dl l $ T_BraceGroup id delve (T_WhileExpression id c l) = dll c l $ T_WhileExpression id delve (T_UntilExpression id c l) = dll c l $ T_UntilExpression id delve (T_ForIn id v w l) = dll w l $ T_ForIn id v delve (T_SelectIn id v w l) = dll w l $ T_SelectIn id v delve (T_CaseExpression id word cases) = do newWord <- round word newCases <- mapM (\(o, c, t) -> do x <- mapM round c y <- mapM round t return (o, x,y) ) cases return $ T_CaseExpression id newWord newCases delve (T_ForArithmetic id a b c group) = do x <- round a y <- round b z <- round c list <- mapM round group return $ T_ForArithmetic id x y z list delve (T_Script id s l) = dl l $ T_Script id s delve (T_Function id a b name body) = d1 body $ T_Function id a b name delve (T_Condition id typ token) = d1 token $ T_Condition id typ delve (T_Extglob id str l) = dl l $ T_Extglob id str delve (T_DollarBraced id op) = d1 op $ T_DollarBraced id delve (T_HereDoc id d q str l) = dl l $ T_HereDoc id d q str delve (TC_And id typ str t1 t2) = d2 t1 t2 $ TC_And id typ str delve (TC_Or id typ str t1 t2) = d2 t1 t2 $ TC_Or id typ str delve (TC_Group id typ token) = d1 token $ TC_Group id typ delve (TC_Binary id typ op lhs rhs) = d2 lhs rhs $ TC_Binary id typ op delve (TC_Unary id typ op token) = d1 token $ TC_Unary id typ op delve (TC_Noary id typ token) = d1 token $ TC_Noary id typ delve (TA_Binary id op t1 t2) = d2 t1 t2 $ TA_Binary id op delve (TA_Unary id op t1) = d1 t1 $ TA_Unary id op delve (TA_Sequence id l) = dl l $ TA_Sequence id delve (TA_Trinary id t1 t2 t3) = do a <- round t1 b <- round t2 c <- round t3 return $ TA_Trinary id a b c delve (TA_Expansion id t) = dl t $ TA_Expansion id delve (TA_Index id t) = d1 t $ TA_Index id delve (T_Annotation id anns t) = d1 t $ T_Annotation id anns delve (T_CoProc id var body) = d1 body $ T_CoProc id var delve (T_CoProcBody id t) = d1 t $ T_CoProcBody id delve t = return t
4,873
analyze :: Monad m => (Token -> m ()) -> (Token -> m ()) -> (Token -> Token) -> Token -> m Token analyze f g i = round where round t = do f t newT <- delve t g t return . i $ newT roundAll = mapM round roundMaybe Nothing = return Nothing roundMaybe (Just v) = do s <- round v return (Just s) dl l v = do x <- roundAll l return $ v x dll l m v = do x <- roundAll l y <- roundAll m return $ v x m d1 t v = do x <- round t return $ v x d2 t1 t2 v = do x <- round t1 y <- round t2 return $ v x y delve (T_NormalWord id list) = dl list $ T_NormalWord id delve (T_DoubleQuoted id list) = dl list $ T_DoubleQuoted id delve (T_DollarDoubleQuoted id list) = dl list $ T_DollarDoubleQuoted id delve (T_DollarExpansion id list) = dl list $ T_DollarExpansion id delve (T_BraceExpansion id list) = dl list $ T_BraceExpansion id delve (T_Backticked id list) = dl list $ T_Backticked id delve (T_DollarArithmetic id c) = d1 c $ T_DollarArithmetic id delve (T_DollarBracket id c) = d1 c $ T_DollarBracket id delve (T_IoFile id op file) = d2 op file $ T_IoFile id delve (T_HereString id word) = d1 word $ T_HereString id delve (T_FdRedirect id v t) = d1 t $ T_FdRedirect id v delve (T_Assignment id mode var index value) = do a <- roundMaybe index b <- round value return $ T_Assignment id mode var a b delve (T_Array id t) = dl t $ T_Array id delve (T_IndexedElement id t1 t2) = d2 t1 t2 $ T_IndexedElement id delve (T_Redirecting id redirs cmd) = do a <- roundAll redirs b <- round cmd return $ T_Redirecting id a b delve (T_SimpleCommand id vars cmds) = dll vars cmds $ T_SimpleCommand id delve (T_Pipeline id l1 l2) = dll l1 l2 $ T_Pipeline id delve (T_Banged id l) = d1 l $ T_Banged id delve (T_AndIf id t u) = d2 t u $ T_AndIf id delve (T_OrIf id t u) = d2 t u $ T_OrIf id delve (T_Backgrounded id l) = d1 l $ T_Backgrounded id delve (T_Subshell id l) = dl l $ T_Subshell id delve (T_ProcSub id typ l) = dl l $ T_ProcSub id typ delve (T_Arithmetic id c) = d1 c $ T_Arithmetic id delve (T_IfExpression id conditions elses) = do newConds <- mapM (\(c, t) -> do x <- mapM round c y <- mapM round t return (x,y) ) conditions newElses <- roundAll elses return $ T_IfExpression id newConds newElses delve (T_BraceGroup id l) = dl l $ T_BraceGroup id delve (T_WhileExpression id c l) = dll c l $ T_WhileExpression id delve (T_UntilExpression id c l) = dll c l $ T_UntilExpression id delve (T_ForIn id v w l) = dll w l $ T_ForIn id v delve (T_SelectIn id v w l) = dll w l $ T_SelectIn id v delve (T_CaseExpression id word cases) = do newWord <- round word newCases <- mapM (\(o, c, t) -> do x <- mapM round c y <- mapM round t return (o, x,y) ) cases return $ T_CaseExpression id newWord newCases delve (T_ForArithmetic id a b c group) = do x <- round a y <- round b z <- round c list <- mapM round group return $ T_ForArithmetic id x y z list delve (T_Script id s l) = dl l $ T_Script id s delve (T_Function id a b name body) = d1 body $ T_Function id a b name delve (T_Condition id typ token) = d1 token $ T_Condition id typ delve (T_Extglob id str l) = dl l $ T_Extglob id str delve (T_DollarBraced id op) = d1 op $ T_DollarBraced id delve (T_HereDoc id d q str l) = dl l $ T_HereDoc id d q str delve (TC_And id typ str t1 t2) = d2 t1 t2 $ TC_And id typ str delve (TC_Or id typ str t1 t2) = d2 t1 t2 $ TC_Or id typ str delve (TC_Group id typ token) = d1 token $ TC_Group id typ delve (TC_Binary id typ op lhs rhs) = d2 lhs rhs $ TC_Binary id typ op delve (TC_Unary id typ op token) = d1 token $ TC_Unary id typ op delve (TC_Noary id typ token) = d1 token $ TC_Noary id typ delve (TA_Binary id op t1 t2) = d2 t1 t2 $ TA_Binary id op delve (TA_Unary id op t1) = d1 t1 $ TA_Unary id op delve (TA_Sequence id l) = dl l $ TA_Sequence id delve (TA_Trinary id t1 t2 t3) = do a <- round t1 b <- round t2 c <- round t3 return $ TA_Trinary id a b c delve (TA_Expansion id t) = dl t $ TA_Expansion id delve (TA_Index id t) = d1 t $ TA_Index id delve (T_Annotation id anns t) = d1 t $ T_Annotation id anns delve (T_CoProc id var body) = d1 body $ T_CoProc id var delve (T_CoProcBody id t) = d1 t $ T_CoProcBody id delve t = return t
4,873
analyze f g i = round where round t = do f t newT <- delve t g t return . i $ newT roundAll = mapM round roundMaybe Nothing = return Nothing roundMaybe (Just v) = do s <- round v return (Just s) dl l v = do x <- roundAll l return $ v x dll l m v = do x <- roundAll l y <- roundAll m return $ v x m d1 t v = do x <- round t return $ v x d2 t1 t2 v = do x <- round t1 y <- round t2 return $ v x y delve (T_NormalWord id list) = dl list $ T_NormalWord id delve (T_DoubleQuoted id list) = dl list $ T_DoubleQuoted id delve (T_DollarDoubleQuoted id list) = dl list $ T_DollarDoubleQuoted id delve (T_DollarExpansion id list) = dl list $ T_DollarExpansion id delve (T_BraceExpansion id list) = dl list $ T_BraceExpansion id delve (T_Backticked id list) = dl list $ T_Backticked id delve (T_DollarArithmetic id c) = d1 c $ T_DollarArithmetic id delve (T_DollarBracket id c) = d1 c $ T_DollarBracket id delve (T_IoFile id op file) = d2 op file $ T_IoFile id delve (T_HereString id word) = d1 word $ T_HereString id delve (T_FdRedirect id v t) = d1 t $ T_FdRedirect id v delve (T_Assignment id mode var index value) = do a <- roundMaybe index b <- round value return $ T_Assignment id mode var a b delve (T_Array id t) = dl t $ T_Array id delve (T_IndexedElement id t1 t2) = d2 t1 t2 $ T_IndexedElement id delve (T_Redirecting id redirs cmd) = do a <- roundAll redirs b <- round cmd return $ T_Redirecting id a b delve (T_SimpleCommand id vars cmds) = dll vars cmds $ T_SimpleCommand id delve (T_Pipeline id l1 l2) = dll l1 l2 $ T_Pipeline id delve (T_Banged id l) = d1 l $ T_Banged id delve (T_AndIf id t u) = d2 t u $ T_AndIf id delve (T_OrIf id t u) = d2 t u $ T_OrIf id delve (T_Backgrounded id l) = d1 l $ T_Backgrounded id delve (T_Subshell id l) = dl l $ T_Subshell id delve (T_ProcSub id typ l) = dl l $ T_ProcSub id typ delve (T_Arithmetic id c) = d1 c $ T_Arithmetic id delve (T_IfExpression id conditions elses) = do newConds <- mapM (\(c, t) -> do x <- mapM round c y <- mapM round t return (x,y) ) conditions newElses <- roundAll elses return $ T_IfExpression id newConds newElses delve (T_BraceGroup id l) = dl l $ T_BraceGroup id delve (T_WhileExpression id c l) = dll c l $ T_WhileExpression id delve (T_UntilExpression id c l) = dll c l $ T_UntilExpression id delve (T_ForIn id v w l) = dll w l $ T_ForIn id v delve (T_SelectIn id v w l) = dll w l $ T_SelectIn id v delve (T_CaseExpression id word cases) = do newWord <- round word newCases <- mapM (\(o, c, t) -> do x <- mapM round c y <- mapM round t return (o, x,y) ) cases return $ T_CaseExpression id newWord newCases delve (T_ForArithmetic id a b c group) = do x <- round a y <- round b z <- round c list <- mapM round group return $ T_ForArithmetic id x y z list delve (T_Script id s l) = dl l $ T_Script id s delve (T_Function id a b name body) = d1 body $ T_Function id a b name delve (T_Condition id typ token) = d1 token $ T_Condition id typ delve (T_Extglob id str l) = dl l $ T_Extglob id str delve (T_DollarBraced id op) = d1 op $ T_DollarBraced id delve (T_HereDoc id d q str l) = dl l $ T_HereDoc id d q str delve (TC_And id typ str t1 t2) = d2 t1 t2 $ TC_And id typ str delve (TC_Or id typ str t1 t2) = d2 t1 t2 $ TC_Or id typ str delve (TC_Group id typ token) = d1 token $ TC_Group id typ delve (TC_Binary id typ op lhs rhs) = d2 lhs rhs $ TC_Binary id typ op delve (TC_Unary id typ op token) = d1 token $ TC_Unary id typ op delve (TC_Noary id typ token) = d1 token $ TC_Noary id typ delve (TA_Binary id op t1 t2) = d2 t1 t2 $ TA_Binary id op delve (TA_Unary id op t1) = d1 t1 $ TA_Unary id op delve (TA_Sequence id l) = dl l $ TA_Sequence id delve (TA_Trinary id t1 t2 t3) = do a <- round t1 b <- round t2 c <- round t3 return $ TA_Trinary id a b c delve (TA_Expansion id t) = dl t $ TA_Expansion id delve (TA_Index id t) = d1 t $ TA_Index id delve (T_Annotation id anns t) = d1 t $ T_Annotation id anns delve (T_CoProc id var body) = d1 body $ T_CoProc id var delve (T_CoProcBody id t) = d1 t $ T_CoProcBody id delve t = return t
4,776
false
true
61
57
1,642
2,144
1,012
1,132
null
null
sgillespie/ghc
compiler/types/CoAxiom.hs
bsd-3-clause
coAxiomName :: CoAxiom br -> Name coAxiomName = co_ax_name
58
coAxiomName :: CoAxiom br -> Name coAxiomName = co_ax_name
58
coAxiomName = co_ax_name
24
false
true
0
6
8
18
9
9
null
null
shicks/shsh
System/Console/ShSh/Builtins/Diff.hs
bsd-3-clause
prune_matches (_:cs) ([]:ms) = prune_matches cs ms
50
prune_matches (_:cs) ([]:ms) = prune_matches cs ms
50
prune_matches (_:cs) ([]:ms) = prune_matches cs ms
50
false
false
0
8
6
32
16
16
null
null
rueshyna/gogol
gogol-drive/gen/Network/Google/Drive/Types/Product.hs
mpl-2.0
-- | The white balance mode used to create the photo. fimmWhiteBalance :: Lens' FileImageMediaMetadata (Maybe Text) fimmWhiteBalance = lens _fimmWhiteBalance (\ s a -> s{_fimmWhiteBalance = a})
201
fimmWhiteBalance :: Lens' FileImageMediaMetadata (Maybe Text) fimmWhiteBalance = lens _fimmWhiteBalance (\ s a -> s{_fimmWhiteBalance = a})
147
fimmWhiteBalance = lens _fimmWhiteBalance (\ s a -> s{_fimmWhiteBalance = a})
85
true
true
0
8
35
49
25
24
null
null
nevrenato/Hets_Fork
Isabelle/MarkSimp.hs
gpl-2.0
includePrefixes :: [String] includePrefixes = [ "ga_comm_" , "ga_assoc_" , "ga_left_comm_"]
103
includePrefixes :: [String] includePrefixes = [ "ga_comm_" , "ga_assoc_" , "ga_left_comm_"]
103
includePrefixes = [ "ga_comm_" , "ga_assoc_" , "ga_left_comm_"]
75
false
true
0
7
22
30
15
15
null
null
scolobb/fgl
test/Data/Graph/Inductive/Graph/Properties.hs
bsd-3-clause
-- | Check that having an edge in a graph is equivalent to -- 'hasNeighbor' reporting that the edge is there. test_hasNeighbor :: (Graph gr, Eq b) => gr a b -> Node -> Node -> Bool test_hasNeighbor gr v w = ( any (`elem` [ (v,w), (w,v) ]) $ edges gr ) == (hasNeighbor gr v w && hasNeighbor gr w v)
299
test_hasNeighbor :: (Graph gr, Eq b) => gr a b -> Node -> Node -> Bool test_hasNeighbor gr v w = ( any (`elem` [ (v,w), (w,v) ]) $ edges gr ) == (hasNeighbor gr v w && hasNeighbor gr w v)
189
test_hasNeighbor gr v w = ( any (`elem` [ (v,w), (w,v) ]) $ edges gr ) == (hasNeighbor gr v w && hasNeighbor gr w v)
118
true
true
0
11
64
114
62
52
null
null
ndmitchell/extra
src/Control/Monad/Extra.hs
bsd-3-clause
-- | A version of 'all' lifted to a monad. Retains the short-circuiting behaviour. -- -- > allM Just [True,False,undefined] == Just False -- > allM Just [True,True ,undefined] == undefined -- > \(f :: Int -> Maybe Bool) xs -> anyM f xs == orM (map f xs) allM :: Monad m => (a -> m Bool) -> [a] -> m Bool allM p = foldr ((&&^) . p) (pure True)
342
allM :: Monad m => (a -> m Bool) -> [a] -> m Bool allM p = foldr ((&&^) . p) (pure True)
88
allM p = foldr ((&&^) . p) (pure True)
38
true
true
0
9
71
70
38
32
null
null
michalt/ghc-comparisons-plugin
GhcPlugins/Comparisons/Pass.hs
bsd-3-clause
evalVarLit :: NumEnv -> Var -> RelOp -> Literal -> Maybe Bool evalVarLit env var relop lit | Just i <- litToInteger lit = do intr <- lookupIntr env var cmpIntrWith relop intr (BetweenEq i i) | Just r <- litToRational lit = do intr <- lookupIntr env var cmpIntrWith relop intr (BetweenEq r r) | otherwise = Nothing
337
evalVarLit :: NumEnv -> Var -> RelOp -> Literal -> Maybe Bool evalVarLit env var relop lit | Just i <- litToInteger lit = do intr <- lookupIntr env var cmpIntrWith relop intr (BetweenEq i i) | Just r <- litToRational lit = do intr <- lookupIntr env var cmpIntrWith relop intr (BetweenEq r r) | otherwise = Nothing
337
evalVarLit env var relop lit | Just i <- litToInteger lit = do intr <- lookupIntr env var cmpIntrWith relop intr (BetweenEq i i) | Just r <- litToRational lit = do intr <- lookupIntr env var cmpIntrWith relop intr (BetweenEq r r) | otherwise = Nothing
275
false
true
0
11
82
154
66
88
null
null
olorin/amazonka
gen/src/Gen/AST/Data/Syntax.hs
mpl-2.0
fromJSOND :: Protocol -> Id -> [Field] -> Decl fromJSOND p n fs = instD1 "FromJSON" n with where with = funD "parseJSON" $ app (app (var "withObject") (str (typeId n))) (lamE noLoc [pvar "x"] es) es = ctorE n $ map (parseJSONE p pJ pJMay pJDef) fs
278
fromJSOND :: Protocol -> Id -> [Field] -> Decl fromJSOND p n fs = instD1 "FromJSON" n with where with = funD "parseJSON" $ app (app (var "withObject") (str (typeId n))) (lamE noLoc [pvar "x"] es) es = ctorE n $ map (parseJSONE p pJ pJMay pJDef) fs
278
fromJSOND p n fs = instD1 "FromJSON" n with where with = funD "parseJSON" $ app (app (var "withObject") (str (typeId n))) (lamE noLoc [pvar "x"] es) es = ctorE n $ map (parseJSONE p pJ pJMay pJDef) fs
231
false
true
2
12
78
141
65
76
null
null
ghcjs/ghcjs
lib/ghc/includes/GHCConstantsHaskellWrappers.hs
mit
oFFSET_StgRegTable_rCurrentNursery :: DynFlags -> Int oFFSET_StgRegTable_rCurrentNursery dflags = pc_OFFSET_StgRegTable_rCurrentNursery (sPlatformConstants (settings dflags))
174
oFFSET_StgRegTable_rCurrentNursery :: DynFlags -> Int oFFSET_StgRegTable_rCurrentNursery dflags = pc_OFFSET_StgRegTable_rCurrentNursery (sPlatformConstants (settings dflags))
174
oFFSET_StgRegTable_rCurrentNursery dflags = pc_OFFSET_StgRegTable_rCurrentNursery (sPlatformConstants (settings dflags))
120
false
true
0
9
11
33
16
17
null
null
snoyberg/ghc
compiler/nativeGen/PPC/Ppr.hs
bsd-3-clause
pprFFormat _ = panic "PPC.Ppr.pprFFormat: no match"
58
pprFFormat _ = panic "PPC.Ppr.pprFFormat: no match"
58
pprFFormat _ = panic "PPC.Ppr.pprFFormat: no match"
58
false
false
0
5
13
13
5
8
null
null
seckcoder/lang-learn
haskell/lambda-calculus/src/MT/Cont.hs
unlicense
cont :: ((a -> r) -> r) -> Cont r a cont f = ContT $ \k -> Identity (f (runIdentity . k ))
94
cont :: ((a -> r) -> r) -> Cont r a cont f = ContT $ \k -> Identity (f (runIdentity . k ))
90
cont f = ContT $ \k -> Identity (f (runIdentity . k ))
54
false
true
0
11
27
63
32
31
null
null
reiddraper/cauterize
src/Cauterize/Dynamic/Pretty.hs
bsd-3-clause
prettyBuiltIn (BDbool v) = bool v
33
prettyBuiltIn (BDbool v) = bool v
33
prettyBuiltIn (BDbool v) = bool v
33
false
false
0
7
5
18
8
10
null
null
rueshyna/sdl2-examples
src/Lesson11.hs
mit
lesson11 :: IO () lesson11 = do -- initialize SDL SDL.initialize [SDL.InitVideo] -- create window window <- SDL.createWindow "Lesson11" Config.winConfig renderer <- SDL.createRenderer window (-1) Config.rdrConfig SDL.HintRenderScaleQuality SDL.$= SDL.ScaleLinear SDL.rendererDrawColor renderer SDL.$= V4 maxBound maxBound minBound maxBound gSpriteSheetTexture <- loadFromFile renderer "./img/11/sprite.bmp" let loop = do events <- SDL.pollEvents let quit = any (== SDL.QuitEvent) $ map SDL.eventPayload events -- *** beginning of drawing region *** SDL.rendererDrawColor renderer SDL.$= V4 minBound minBound maxBound maxBound SDL.clear renderer -- render with our own function render renderer gSpriteSheetTexture (gSpriteClips !! 0) -- LU $ V2 0 0 render renderer gSpriteSheetTexture (gSpriteClips !! 1) -- RU $ V2 (Config.winW - (getClipsW gSpriteClips 1) ) 0 -- $ V2 (Config.winW - (getClipsW gSpriteClips 1) ) 0 render renderer gSpriteSheetTexture (gSpriteClips !! 2) -- LD $ V2 0 (Config.winH - (getClipsH gSpriteClips 2)) render renderer gSpriteSheetTexture (gSpriteClips !! 3) -- RD $ V2 (Config.winW - (getClipsW gSpriteClips 3)) (Config.winH - (getClipsH gSpriteClips 3)) -- SDL.present renderer -- *** end of drawing region *** unless quit loop loop free gSpriteSheetTexture SDL.destroyRenderer renderer SDL.destroyWindow window SDL.quit
1,618
lesson11 :: IO () lesson11 = do -- initialize SDL SDL.initialize [SDL.InitVideo] -- create window window <- SDL.createWindow "Lesson11" Config.winConfig renderer <- SDL.createRenderer window (-1) Config.rdrConfig SDL.HintRenderScaleQuality SDL.$= SDL.ScaleLinear SDL.rendererDrawColor renderer SDL.$= V4 maxBound maxBound minBound maxBound gSpriteSheetTexture <- loadFromFile renderer "./img/11/sprite.bmp" let loop = do events <- SDL.pollEvents let quit = any (== SDL.QuitEvent) $ map SDL.eventPayload events -- *** beginning of drawing region *** SDL.rendererDrawColor renderer SDL.$= V4 minBound minBound maxBound maxBound SDL.clear renderer -- render with our own function render renderer gSpriteSheetTexture (gSpriteClips !! 0) -- LU $ V2 0 0 render renderer gSpriteSheetTexture (gSpriteClips !! 1) -- RU $ V2 (Config.winW - (getClipsW gSpriteClips 1) ) 0 -- $ V2 (Config.winW - (getClipsW gSpriteClips 1) ) 0 render renderer gSpriteSheetTexture (gSpriteClips !! 2) -- LD $ V2 0 (Config.winH - (getClipsH gSpriteClips 2)) render renderer gSpriteSheetTexture (gSpriteClips !! 3) -- RD $ V2 (Config.winW - (getClipsW gSpriteClips 3)) (Config.winH - (getClipsH gSpriteClips 3)) -- SDL.present renderer -- *** end of drawing region *** unless quit loop loop free gSpriteSheetTexture SDL.destroyRenderer renderer SDL.destroyWindow window SDL.quit
1,618
lesson11 = do -- initialize SDL SDL.initialize [SDL.InitVideo] -- create window window <- SDL.createWindow "Lesson11" Config.winConfig renderer <- SDL.createRenderer window (-1) Config.rdrConfig SDL.HintRenderScaleQuality SDL.$= SDL.ScaleLinear SDL.rendererDrawColor renderer SDL.$= V4 maxBound maxBound minBound maxBound gSpriteSheetTexture <- loadFromFile renderer "./img/11/sprite.bmp" let loop = do events <- SDL.pollEvents let quit = any (== SDL.QuitEvent) $ map SDL.eventPayload events -- *** beginning of drawing region *** SDL.rendererDrawColor renderer SDL.$= V4 minBound minBound maxBound maxBound SDL.clear renderer -- render with our own function render renderer gSpriteSheetTexture (gSpriteClips !! 0) -- LU $ V2 0 0 render renderer gSpriteSheetTexture (gSpriteClips !! 1) -- RU $ V2 (Config.winW - (getClipsW gSpriteClips 1) ) 0 -- $ V2 (Config.winW - (getClipsW gSpriteClips 1) ) 0 render renderer gSpriteSheetTexture (gSpriteClips !! 2) -- LD $ V2 0 (Config.winH - (getClipsH gSpriteClips 2)) render renderer gSpriteSheetTexture (gSpriteClips !! 3) -- RD $ V2 (Config.winW - (getClipsW gSpriteClips 3)) (Config.winH - (getClipsH gSpriteClips 3)) -- SDL.present renderer -- *** end of drawing region *** unless quit loop loop free gSpriteSheetTexture SDL.destroyRenderer renderer SDL.destroyWindow window SDL.quit
1,600
false
true
0
18
449
423
200
223
null
null
5outh/BeFun
src/FunctionProcesses.hs
mit
dup, swap, strMode :: BefungeState -> Either String BefungeState dup (BefungeState is (x:xs) loc dir m r) = Right $ BefungeState is (x:x:xs) loc dir m r
152
dup, swap, strMode :: BefungeState -> Either String BefungeState dup (BefungeState is (x:xs) loc dir m r) = Right $ BefungeState is (x:x:xs) loc dir m r
152
dup (BefungeState is (x:xs) loc dir m r) = Right $ BefungeState is (x:x:xs) loc dir m r
87
false
true
0
9
26
78
41
37
null
null
jonathanknowles/haskell-calculator
source/library/Reflex/Dom/Extras.hs
bsd-3-clause
tr = el "tr"
16
tr = el "tr"
16
tr = el "tr"
16
false
false
0
5
7
9
4
5
null
null