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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ezyang/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange")
| 63
|
inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange")
| 63
|
inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange")
| 63
| false
| false
| 1
| 7
| 17
| 20
| 8
| 12
| null | null |
futufeld/eclogues
|
eclogues-impl/gen-hs/AuroraSchedulerManager.hs
|
bsd-3-clause
|
encode_PauseJobUpdate_result :: (T.Protocol p, T.Transport t) => p t -> PauseJobUpdate_result -> LBS.ByteString
encode_PauseJobUpdate_result oprot record = T.serializeVal oprot $ from_PauseJobUpdate_result record
| 212
|
encode_PauseJobUpdate_result :: (T.Protocol p, T.Transport t) => p t -> PauseJobUpdate_result -> LBS.ByteString
encode_PauseJobUpdate_result oprot record = T.serializeVal oprot $ from_PauseJobUpdate_result record
| 212
|
encode_PauseJobUpdate_result oprot record = T.serializeVal oprot $ from_PauseJobUpdate_result record
| 100
| false
| true
| 0
| 8
| 21
| 60
| 29
| 31
| null | null |
fhaust/dtw
|
src/Data/DTW.hs
|
mit
|
dtwMemo :: (Ord c, Fractional c, DataSet a, DataSet b)
=> (Item a -> Item b -> c) -> a -> b -> Result c
dtwMemo δ = dtwMemoWindowed δ (\_ _ -> True)
| 156
|
dtwMemo :: (Ord c, Fractional c, DataSet a, DataSet b)
=> (Item a -> Item b -> c) -> a -> b -> Result c
dtwMemo δ = dtwMemoWindowed δ (\_ _ -> True)
| 156
|
dtwMemo δ = dtwMemoWindowed δ (\_ _ -> True)
| 44
| false
| true
| 0
| 10
| 41
| 88
| 44
| 44
| null | null |
Noeda/adeonbot
|
terminal-emulator/src/Terminal/Screen.hs
|
mit
|
backgroundCode Magenta = "45"
| 29
|
backgroundCode Magenta = "45"
| 29
|
backgroundCode Magenta = "45"
| 29
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
termite2/debug
|
Debug/GraphView.hs
|
bsd-3-clause
|
labelStyle = GC {gcFG = (0, 0, 0), gcLW=0, gcLS=True}
| 76
|
labelStyle = GC {gcFG = (0, 0, 0), gcLW=0, gcLS=True}
| 76
|
labelStyle = GC {gcFG = (0, 0, 0), gcLW=0, gcLS=True}
| 76
| false
| false
| 0
| 7
| 32
| 35
| 22
| 13
| null | null |
Super-Fluid/heqet
|
Heqet/Meters.hs
|
gpl-3.0
|
m4_4 :: MMeter
m4_4 = (concat [measure,beat,beat2,beat3,beat4], 4/4)
| 68
|
m4_4 :: MMeter
m4_4 = (concat [measure,beat,beat2,beat3,beat4], 4/4)
| 68
|
m4_4 = (concat [measure,beat,beat2,beat3,beat4], 4/4)
| 53
| false
| true
| 0
| 7
| 7
| 39
| 23
| 16
| null | null |
alekar/hugs
|
packages/base/Data/Map.hs
|
bsd-3-clause
|
-- basic rotations
singleL k1 x1 t1 (Bin _ k2 x2 t2 t3) = bin k2 x2 (bin k1 x1 t1 t2) t3
| 89
|
singleL k1 x1 t1 (Bin _ k2 x2 t2 t3) = bin k2 x2 (bin k1 x1 t1 t2) t3
| 70
|
singleL k1 x1 t1 (Bin _ k2 x2 t2 t3) = bin k2 x2 (bin k1 x1 t1 t2) t3
| 70
| true
| false
| 0
| 7
| 23
| 51
| 25
| 26
| null | null |
gergoerdi/tecs
|
src/Language/TECS/Deck/Parser.hs
|
bsd-3-clause
|
offset :: DeckParser Offset
offset = value <?> "offset"
| 57
|
offset :: DeckParser Offset
offset = value <?> "offset"
| 55
|
offset = value <?> "offset"
| 27
| false
| true
| 0
| 5
| 10
| 18
| 9
| 9
| null | null |
ndmitchell/qed
|
v1/Core.hs
|
bsd-3-clause
|
defineData :: [(String,Int)] -> IO Equal
defineData ctrs = do
withState $ \s -> s{proved = proved s ++ [(prf, Defined)]}
return prf
where
v1:vs = fresh []
prf = Lam v1 (Var v1) :=: Lam v1 (Case (Var v1) alts)
alts = [(PCon (C a) vs', Con (C a) `apps` map Var vs') | (a,b) <- ctrs, let vs' = take b vs]
-- using the proof (which must be True, or inductively True) apply to produce this subgoal
| 430
|
defineData :: [(String,Int)] -> IO Equal
defineData ctrs = do
withState $ \s -> s{proved = proved s ++ [(prf, Defined)]}
return prf
where
v1:vs = fresh []
prf = Lam v1 (Var v1) :=: Lam v1 (Case (Var v1) alts)
alts = [(PCon (C a) vs', Con (C a) `apps` map Var vs') | (a,b) <- ctrs, let vs' = take b vs]
-- using the proof (which must be True, or inductively True) apply to produce this subgoal
| 430
|
defineData ctrs = do
withState $ \s -> s{proved = proved s ++ [(prf, Defined)]}
return prf
where
v1:vs = fresh []
prf = Lam v1 (Var v1) :=: Lam v1 (Case (Var v1) alts)
alts = [(PCon (C a) vs', Con (C a) `apps` map Var vs') | (a,b) <- ctrs, let vs' = take b vs]
-- using the proof (which must be True, or inductively True) apply to produce this subgoal
| 389
| false
| true
| 3
| 13
| 117
| 206
| 105
| 101
| null | null |
danpalmer/trac-to-phabricator
|
src/Phabricator.hs
|
bsd-3-clause
|
getAction :: Action -> IO ()
getAction (Action _ _ io) = io
| 59
|
getAction :: Action -> IO ()
getAction (Action _ _ io) = io
| 59
|
getAction (Action _ _ io) = io
| 30
| false
| true
| 0
| 9
| 12
| 38
| 17
| 21
| null | null |
qpliu/esolang
|
DGOL/hs/interp/StdLib.hs
|
gpl-3.0
|
iolib_writebyte :: Scope.Scope -> [Scope.Var] -> IO Scope.Scope
iolib_writebyte scope vars = do
putChar (Char.chr (bit1 + bit2 + bit4 + bit8 + bit10 + bit20 + bit40 + bit80))
return scope
where
bit1 | length vars >= 2 && Scope.hasEdge scope (vars !! 0) (vars !! 1) = 1
| otherwise = 0
bit2 | length vars >= 3 && Scope.hasEdge scope (vars !! 0) (vars !! 2) = 2
| otherwise = 0
bit4 | length vars >= 4 && Scope.hasEdge scope (vars !! 0) (vars !! 3) = 4
| otherwise = 0
bit8 | length vars >= 5 && Scope.hasEdge scope (vars !! 0) (vars !! 4) = 8
| otherwise = 0
bit10 | length vars >= 6 && Scope.hasEdge scope (vars !! 0) (vars !! 5) = 16
| otherwise = 0
bit20 | length vars >= 7 && Scope.hasEdge scope (vars !! 0) (vars !! 6) = 32
| otherwise = 0
bit40 | length vars >= 8 && Scope.hasEdge scope (vars !! 0) (vars !! 7) = 64
| otherwise = 0
bit80 | length vars >= 9 && Scope.hasEdge scope (vars !! 0) (vars !! 8) = 128
| otherwise = 0
| 1,048
|
iolib_writebyte :: Scope.Scope -> [Scope.Var] -> IO Scope.Scope
iolib_writebyte scope vars = do
putChar (Char.chr (bit1 + bit2 + bit4 + bit8 + bit10 + bit20 + bit40 + bit80))
return scope
where
bit1 | length vars >= 2 && Scope.hasEdge scope (vars !! 0) (vars !! 1) = 1
| otherwise = 0
bit2 | length vars >= 3 && Scope.hasEdge scope (vars !! 0) (vars !! 2) = 2
| otherwise = 0
bit4 | length vars >= 4 && Scope.hasEdge scope (vars !! 0) (vars !! 3) = 4
| otherwise = 0
bit8 | length vars >= 5 && Scope.hasEdge scope (vars !! 0) (vars !! 4) = 8
| otherwise = 0
bit10 | length vars >= 6 && Scope.hasEdge scope (vars !! 0) (vars !! 5) = 16
| otherwise = 0
bit20 | length vars >= 7 && Scope.hasEdge scope (vars !! 0) (vars !! 6) = 32
| otherwise = 0
bit40 | length vars >= 8 && Scope.hasEdge scope (vars !! 0) (vars !! 7) = 64
| otherwise = 0
bit80 | length vars >= 9 && Scope.hasEdge scope (vars !! 0) (vars !! 8) = 128
| otherwise = 0
| 1,048
|
iolib_writebyte scope vars = do
putChar (Char.chr (bit1 + bit2 + bit4 + bit8 + bit10 + bit20 + bit40 + bit80))
return scope
where
bit1 | length vars >= 2 && Scope.hasEdge scope (vars !! 0) (vars !! 1) = 1
| otherwise = 0
bit2 | length vars >= 3 && Scope.hasEdge scope (vars !! 0) (vars !! 2) = 2
| otherwise = 0
bit4 | length vars >= 4 && Scope.hasEdge scope (vars !! 0) (vars !! 3) = 4
| otherwise = 0
bit8 | length vars >= 5 && Scope.hasEdge scope (vars !! 0) (vars !! 4) = 8
| otherwise = 0
bit10 | length vars >= 6 && Scope.hasEdge scope (vars !! 0) (vars !! 5) = 16
| otherwise = 0
bit20 | length vars >= 7 && Scope.hasEdge scope (vars !! 0) (vars !! 6) = 32
| otherwise = 0
bit40 | length vars >= 8 && Scope.hasEdge scope (vars !! 0) (vars !! 7) = 64
| otherwise = 0
bit80 | length vars >= 9 && Scope.hasEdge scope (vars !! 0) (vars !! 8) = 128
| otherwise = 0
| 984
| false
| true
| 8
| 17
| 318
| 535
| 260
| 275
| null | null |
themoritz/cabal
|
Cabal/Distribution/Simple/Setup.hs
|
bsd-3-clause
|
-- | For each known program @PROG@ in 'progDb', produce a @with-PROG@
-- 'OptionField'.
programDbPaths
:: ProgramDb
-> ShowOrParseArgs
-> (flags -> [(String, FilePath)])
-> ([(String, FilePath)] -> (flags -> flags))
-> [OptionField flags]
programDbPaths progDb showOrParseArgs get set =
programDbPaths' ("with-" ++) progDb showOrParseArgs get set
| 358
|
programDbPaths
:: ProgramDb
-> ShowOrParseArgs
-> (flags -> [(String, FilePath)])
-> ([(String, FilePath)] -> (flags -> flags))
-> [OptionField flags]
programDbPaths progDb showOrParseArgs get set =
programDbPaths' ("with-" ++) progDb showOrParseArgs get set
| 270
|
programDbPaths progDb showOrParseArgs get set =
programDbPaths' ("with-" ++) progDb showOrParseArgs get set
| 109
| true
| true
| 0
| 13
| 58
| 103
| 56
| 47
| null | null |
bgaster/blocks
|
Blocks.hs
|
mit
|
-- As we only want to print the minimum number of digits we
-- generate verts least digit first and then we simply draw the required
-- number of triangles. Score limited to 5 digits!!
scoreText :: GLfloat ->
GLfloat ->
CharInfo ->
[Char] ->
IO (BufferedVertices [VPos,Tex])
scoreText x y offsets digits = bufferVertices $ scoreText' x y offsets digits
| 408
|
scoreText :: GLfloat ->
GLfloat ->
CharInfo ->
[Char] ->
IO (BufferedVertices [VPos,Tex])
scoreText x y offsets digits = bufferVertices $ scoreText' x y offsets digits
| 223
|
scoreText x y offsets digits = bufferVertices $ scoreText' x y offsets digits
| 77
| true
| true
| 0
| 12
| 116
| 70
| 37
| 33
| null | null |
nulldatamap/bastet
|
src/Tokenizer.hs
|
bsd-3-clause
|
isReservedOperatorToken x (Token (TReservedOperator o) _) = x == o
| 66
|
isReservedOperatorToken x (Token (TReservedOperator o) _) = x == o
| 66
|
isReservedOperatorToken x (Token (TReservedOperator o) _) = x == o
| 66
| false
| false
| 0
| 9
| 9
| 29
| 14
| 15
| null | null |
frontrowed/stratosphere
|
library-gen/Stratosphere/ResourceProperties/EC2SpotFleetInstanceNetworkInterfaceSpecification.hs
|
mit
|
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata-launchspecifications-networkinterfaces.html#cfn-ec2-spotfleet-instancenetworkinterfacespecification-deleteontermination
ecsfinisDeleteOnTermination :: Lens' EC2SpotFleetInstanceNetworkInterfaceSpecification (Maybe (Val Bool))
ecsfinisDeleteOnTermination = lens _eC2SpotFleetInstanceNetworkInterfaceSpecificationDeleteOnTermination (\s a -> s { _eC2SpotFleetInstanceNetworkInterfaceSpecificationDeleteOnTermination = a })
| 543
|
ecsfinisDeleteOnTermination :: Lens' EC2SpotFleetInstanceNetworkInterfaceSpecification (Maybe (Val Bool))
ecsfinisDeleteOnTermination = lens _eC2SpotFleetInstanceNetworkInterfaceSpecificationDeleteOnTermination (\s a -> s { _eC2SpotFleetInstanceNetworkInterfaceSpecificationDeleteOnTermination = a })
| 300
|
ecsfinisDeleteOnTermination = lens _eC2SpotFleetInstanceNetworkInterfaceSpecificationDeleteOnTermination (\s a -> s { _eC2SpotFleetInstanceNetworkInterfaceSpecificationDeleteOnTermination = a })
| 194
| true
| true
| 0
| 9
| 22
| 52
| 28
| 24
| null | null |
BirdseyeSoftware/dp-system-process
|
src/Control/Distributed/Process/SystemProcess.hs
|
mit
|
sendToPid :: Process.ProcessId -> Transport
sendToPid = SendMessage
| 67
|
sendToPid :: Process.ProcessId -> Transport
sendToPid = SendMessage
| 67
|
sendToPid = SendMessage
| 23
| false
| true
| 0
| 7
| 7
| 24
| 10
| 14
| null | null |
peti/funcmp
|
FMP/Resolve.hs
|
gpl-3.0
|
resolveBoolean :: (Int, Symbols) -> Boolean -> Maybe Boolean
resolveBoolean _ (Boolean a) = Just (Boolean a)
| 125
|
resolveBoolean :: (Int, Symbols) -> Boolean -> Maybe Boolean
resolveBoolean _ (Boolean a) = Just (Boolean a)
| 125
|
resolveBoolean _ (Boolean a) = Just (Boolean a)
| 49
| false
| true
| 0
| 7
| 33
| 48
| 24
| 24
| null | null |
dmort27/WebComparator
|
Query.hs
|
bsd-3-clause
|
withDbConnection :: (Connection -> IO a) -> IO a
withDbConnection action = handleSqlError $ do
conn <- connectDB
result <- action conn
disconnect conn
return result
| 188
|
withDbConnection :: (Connection -> IO a) -> IO a
withDbConnection action = handleSqlError $ do
conn <- connectDB
result <- action conn
disconnect conn
return result
| 188
|
withDbConnection action = handleSqlError $ do
conn <- connectDB
result <- action conn
disconnect conn
return result
| 139
| false
| true
| 0
| 9
| 49
| 64
| 28
| 36
| null | null |
tensorflow/haskell
|
tensorflow/src/TensorFlow/Build.hs
|
apache-2.0
|
lookupNode :: NodeName -> Build NodeDef
lookupNode n = uses renderedNodeDefs (Map.lookup n) >>= \case
Just n' -> return n'
Nothing -> error $ "lookupNode: unknown node name " ++ show n
-- | Add a new node for a given 'OpDef'. This is used for making "stateful" ops
-- which are not safe to dedup (e.g, "variable" and "assign").
| 337
|
lookupNode :: NodeName -> Build NodeDef
lookupNode n = uses renderedNodeDefs (Map.lookup n) >>= \case
Just n' -> return n'
Nothing -> error $ "lookupNode: unknown node name " ++ show n
-- | Add a new node for a given 'OpDef'. This is used for making "stateful" ops
-- which are not safe to dedup (e.g, "variable" and "assign").
| 337
|
lookupNode n = uses renderedNodeDefs (Map.lookup n) >>= \case
Just n' -> return n'
Nothing -> error $ "lookupNode: unknown node name " ++ show n
-- | Add a new node for a given 'OpDef'. This is used for making "stateful" ops
-- which are not safe to dedup (e.g, "variable" and "assign").
| 297
| false
| true
| 0
| 11
| 69
| 77
| 35
| 42
| null | null |
ezyang/ghc
|
testsuite/tests/indexed-types/should_compile/T11187.hs
|
bsd-3-clause
|
coercionXX2 :: Coercion X X
coercionXX2 = c where c = Coercion
| 62
|
coercionXX2 :: Coercion X X
coercionXX2 = c where c = Coercion
| 62
|
coercionXX2 = c where c = Coercion
| 34
| false
| true
| 0
| 6
| 11
| 23
| 12
| 11
| null | null |
oldmanmike/ghc
|
compiler/types/CoAxiom.hs
|
bsd-3-clause
|
toUnbranchedAxiom :: CoAxiom br -> CoAxiom Unbranched
toUnbranchedAxiom (CoAxiom unique name role tc branches implicit)
= CoAxiom unique name role tc (toUnbranched branches) implicit
| 184
|
toUnbranchedAxiom :: CoAxiom br -> CoAxiom Unbranched
toUnbranchedAxiom (CoAxiom unique name role tc branches implicit)
= CoAxiom unique name role tc (toUnbranched branches) implicit
| 184
|
toUnbranchedAxiom (CoAxiom unique name role tc branches implicit)
= CoAxiom unique name role tc (toUnbranched branches) implicit
| 130
| false
| true
| 0
| 7
| 25
| 59
| 28
| 31
| null | null |
AlexeyRaga/eta
|
compiler/ETA/Prelude/PrelNames.hs
|
bsd-3-clause
|
objClassOpKey = mkPreludeMiscIdUnique 510
| 48
|
objClassOpKey = mkPreludeMiscIdUnique 510
| 48
|
objClassOpKey = mkPreludeMiscIdUnique 510
| 48
| false
| false
| 0
| 5
| 10
| 9
| 4
| 5
| null | null |
sherwoodwang/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/Events.hs
|
lgpl-2.1
|
windowGetOnMouse :: Window a -> IO (EventMouse -> IO ())
windowGetOnMouse window
= unsafeWindowGetHandlerState window wxEVT_ENTER_WINDOW (\_ev -> skipCurrentEvent)
| 165
|
windowGetOnMouse :: Window a -> IO (EventMouse -> IO ())
windowGetOnMouse window
= unsafeWindowGetHandlerState window wxEVT_ENTER_WINDOW (\_ev -> skipCurrentEvent)
| 165
|
windowGetOnMouse window
= unsafeWindowGetHandlerState window wxEVT_ENTER_WINDOW (\_ev -> skipCurrentEvent)
| 108
| false
| true
| 0
| 10
| 20
| 51
| 25
| 26
| null | null |
Teaspot-Studio/arhelk-armenian
|
src/Arhelk/Armenian/Lemma/Particle.hs
|
bsd-3-clause
|
particles :: [Text]
particles = unsafePerformIO $ do
ts <- T.readFile "config/particles.txt"
return $ T.strip <$> T.lines ts
| 131
|
particles :: [Text]
particles = unsafePerformIO $ do
ts <- T.readFile "config/particles.txt"
return $ T.strip <$> T.lines ts
| 131
|
particles = unsafePerformIO $ do
ts <- T.readFile "config/particles.txt"
return $ T.strip <$> T.lines ts
| 111
| false
| true
| 0
| 10
| 24
| 54
| 24
| 30
| null | null |
LambdaHack/LambdaHack
|
engine-src/Game/LambdaHack/Client/UI/Frontend/ANSI.hs
|
bsd-3-clause
|
colorTranslate Color.Magenta = (ANSI.Dull, ANSI.Magenta)
| 58
|
colorTranslate Color.Magenta = (ANSI.Dull, ANSI.Magenta)
| 58
|
colorTranslate Color.Magenta = (ANSI.Dull, ANSI.Magenta)
| 58
| false
| false
| 0
| 6
| 6
| 21
| 11
| 10
| null | null |
vikraman/ghc
|
compiler/basicTypes/Literal.hs
|
bsd-3-clause
|
literalType (MachWord _) = wordPrimTy
| 40
|
literalType (MachWord _) = wordPrimTy
| 40
|
literalType (MachWord _) = wordPrimTy
| 40
| false
| false
| 0
| 6
| 7
| 16
| 7
| 9
| null | null |
ekmett/ghc
|
compiler/nativeGen/PIC.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- Generate code to calculate the address that should be put in the
-- PIC base register.
-- This is called by MachCodeGen for every CmmProc that accessed the
-- PIC base register. It adds the appropriate instructions to the
-- top of the CmmProc.
-- It is assumed that the first NatCmmDecl in the input list is a Proc
-- and the rest are CmmDatas.
-- Darwin is simple: just fetch the address of a local label.
-- The FETCHPC pseudo-instruction is expanded to multiple instructions
-- during pretty-printing so that we don't have to deal with the
-- local label:
-- PowerPC version:
-- bcl 20,31,1f.
-- 1: mflr picReg
-- i386 version:
-- call 1f
-- 1: popl %picReg
-- Get a pointer to our own fake GOT, which is defined on a per-module basis.
-- This is exactly how GCC does it, and it's quite horrible:
-- We first fetch the address of a local label (mkPicBaseLabel).
-- Then we add a 16-bit offset to that to get the address of a .long that we
-- define in .text space right next to the proc. This .long literal contains
-- the (32-bit) offset from our local label to our global offset table
-- (.LCTOC1 aka gotOffLabel).
initializePicBase_ppc
:: Arch -> OS -> Reg
-> [NatCmmDecl CmmStatics PPC.Instr]
-> NatM [NatCmmDecl CmmStatics PPC.Instr]
initializePicBase_ppc ArchPPC os picReg
(CmmProc info lab live (ListGraph blocks) : statics)
| osElfTarget os
= do
dflags <- getDynFlags
gotOffLabel <- getNewLabelNat
tmp <- getNewRegNat $ intSize (wordWidth dflags)
let
gotOffset = CmmData Text $ Statics gotOffLabel [
CmmStaticLit (CmmLabelDiffOff gotLabel
mkPicBaseLabel
0)
]
offsetToOffset
= PPC.ImmConstantDiff
(PPC.ImmCLbl gotOffLabel)
(PPC.ImmCLbl mkPicBaseLabel)
blocks' = case blocks of
[] -> []
(b:bs) -> fetchPC b : map maybeFetchPC bs
maybeFetchPC b@(BasicBlock bID _)
| bID `mapMember` info = fetchPC b
| otherwise = b
fetchPC (BasicBlock bID insns) =
BasicBlock bID (PPC.FETCHPC picReg
: PPC.LD PPC.archWordSize tmp
(PPC.AddrRegImm picReg offsetToOffset)
: PPC.ADD picReg picReg (PPC.RIReg tmp)
: insns)
return (CmmProc info lab live (ListGraph blocks') : gotOffset : statics)
| 2,825
|
initializePicBase_ppc
:: Arch -> OS -> Reg
-> [NatCmmDecl CmmStatics PPC.Instr]
-> NatM [NatCmmDecl CmmStatics PPC.Instr]
initializePicBase_ppc ArchPPC os picReg
(CmmProc info lab live (ListGraph blocks) : statics)
| osElfTarget os
= do
dflags <- getDynFlags
gotOffLabel <- getNewLabelNat
tmp <- getNewRegNat $ intSize (wordWidth dflags)
let
gotOffset = CmmData Text $ Statics gotOffLabel [
CmmStaticLit (CmmLabelDiffOff gotLabel
mkPicBaseLabel
0)
]
offsetToOffset
= PPC.ImmConstantDiff
(PPC.ImmCLbl gotOffLabel)
(PPC.ImmCLbl mkPicBaseLabel)
blocks' = case blocks of
[] -> []
(b:bs) -> fetchPC b : map maybeFetchPC bs
maybeFetchPC b@(BasicBlock bID _)
| bID `mapMember` info = fetchPC b
| otherwise = b
fetchPC (BasicBlock bID insns) =
BasicBlock bID (PPC.FETCHPC picReg
: PPC.LD PPC.archWordSize tmp
(PPC.AddrRegImm picReg offsetToOffset)
: PPC.ADD picReg picReg (PPC.RIReg tmp)
: insns)
return (CmmProc info lab live (ListGraph blocks') : gotOffset : statics)
| 1,581
|
initializePicBase_ppc ArchPPC os picReg
(CmmProc info lab live (ListGraph blocks) : statics)
| osElfTarget os
= do
dflags <- getDynFlags
gotOffLabel <- getNewLabelNat
tmp <- getNewRegNat $ intSize (wordWidth dflags)
let
gotOffset = CmmData Text $ Statics gotOffLabel [
CmmStaticLit (CmmLabelDiffOff gotLabel
mkPicBaseLabel
0)
]
offsetToOffset
= PPC.ImmConstantDiff
(PPC.ImmCLbl gotOffLabel)
(PPC.ImmCLbl mkPicBaseLabel)
blocks' = case blocks of
[] -> []
(b:bs) -> fetchPC b : map maybeFetchPC bs
maybeFetchPC b@(BasicBlock bID _)
| bID `mapMember` info = fetchPC b
| otherwise = b
fetchPC (BasicBlock bID insns) =
BasicBlock bID (PPC.FETCHPC picReg
: PPC.LD PPC.archWordSize tmp
(PPC.AddrRegImm picReg offsetToOffset)
: PPC.ADD picReg picReg (PPC.RIReg tmp)
: insns)
return (CmmProc info lab live (ListGraph blocks') : gotOffset : statics)
| 1,435
| true
| true
| 0
| 20
| 1,003
| 417
| 211
| 206
| null | null |
nomeata/ghc
|
compiler/nativeGen/RegAlloc/Graph/Main.hs
|
bsd-3-clause
|
seqRegClass :: RegClass -> ()
seqRegClass c = c `seq` ()
| 56
|
seqRegClass :: RegClass -> ()
seqRegClass c = c `seq` ()
| 56
|
seqRegClass c = c `seq` ()
| 26
| false
| true
| 0
| 8
| 10
| 36
| 17
| 19
| null | null |
4ZP6Capstone2015/ampersand
|
src/Database/Design/Ampersand/ADL1/Disambiguate.hs
|
gpl-3.0
|
-- Here, deriving Show serves debugging purposes only.
performUpdate :: ((t, DisambPrim),
Constraints)
-> Change (t, DisambPrim)
performUpdate ((t,unkn), Cnstr srcs' tgts')
= case unkn of
Known _ -> pure (t,unkn)
Rel xs -> determineBySize (\x -> if length x == length xs then pure (Rel xs) else impure (Rel x))
((findMatch' (mustBeSrc,mustBeTgt) xs `orWhenEmpty` findMatch' (mayBeSrc,mayBeTgt) xs)
`orWhenEmpty` xs)
Ident -> determineBySize suggest (map EDcI (Set.toList possibleConcs))
Mp1 x -> determineBySize suggest (map (EMp1 x) (Set.toList possibleConcs))
Vee -> determineBySize (const (pure unkn))
[EDcV (Sign a b) | a<-Set.toList mustBeSrc, b<-Set.toList mustBeTgt]
where
suggest [] = pure unkn
suggest lst = impure (Rel lst) -- TODO: find out whether it is equivalent to put "pure" here (which could be faster).
possibleConcs = (mustBeSrc `isc` mustBeTgt) `orWhenEmptyS`
(mustBeSrc `uni` mustBeTgt) `orWhenEmptyS`
(mayBeSrc `isc` mayBeTgt ) `orWhenEmptyS`
(mayBeSrc `uni` mayBeTgt )
findMatch' (a,b) = findMatch (Set.toList a,Set.toList b)
findMatch ([],[]) _ = []
findMatch ([],tgts) lst
= [x | x<-lst, target x `elem` tgts]
findMatch (srcs,[]) lst
= [x | x<-lst, source x `elem` srcs]
findMatch (srcs,tgts) lst
= [x | x<-lst, source x `elem` srcs, target x `elem` tgts]
mustBeSrc = mustBe srcs'
mustBeTgt = mustBe tgts'
mayBeSrc = mayBe srcs'
mayBeTgt = mayBe tgts'
mustBe xs = Set.fromList [x | (MustBe x) <- xs]
mayBe xs = Set.fromList [x | (MayBe x) <- xs]
orWhenEmptyS a b = if (Set.null a) then b else a
determineBySize _ [a] = impure (t,Known a)
determineBySize err lst = fmap ((,) t) (err lst)
impure x = Change x False
isc = Set.intersection
uni = Set.union
| 1,944
|
performUpdate :: ((t, DisambPrim),
Constraints)
-> Change (t, DisambPrim)
performUpdate ((t,unkn), Cnstr srcs' tgts')
= case unkn of
Known _ -> pure (t,unkn)
Rel xs -> determineBySize (\x -> if length x == length xs then pure (Rel xs) else impure (Rel x))
((findMatch' (mustBeSrc,mustBeTgt) xs `orWhenEmpty` findMatch' (mayBeSrc,mayBeTgt) xs)
`orWhenEmpty` xs)
Ident -> determineBySize suggest (map EDcI (Set.toList possibleConcs))
Mp1 x -> determineBySize suggest (map (EMp1 x) (Set.toList possibleConcs))
Vee -> determineBySize (const (pure unkn))
[EDcV (Sign a b) | a<-Set.toList mustBeSrc, b<-Set.toList mustBeTgt]
where
suggest [] = pure unkn
suggest lst = impure (Rel lst) -- TODO: find out whether it is equivalent to put "pure" here (which could be faster).
possibleConcs = (mustBeSrc `isc` mustBeTgt) `orWhenEmptyS`
(mustBeSrc `uni` mustBeTgt) `orWhenEmptyS`
(mayBeSrc `isc` mayBeTgt ) `orWhenEmptyS`
(mayBeSrc `uni` mayBeTgt )
findMatch' (a,b) = findMatch (Set.toList a,Set.toList b)
findMatch ([],[]) _ = []
findMatch ([],tgts) lst
= [x | x<-lst, target x `elem` tgts]
findMatch (srcs,[]) lst
= [x | x<-lst, source x `elem` srcs]
findMatch (srcs,tgts) lst
= [x | x<-lst, source x `elem` srcs, target x `elem` tgts]
mustBeSrc = mustBe srcs'
mustBeTgt = mustBe tgts'
mayBeSrc = mayBe srcs'
mayBeTgt = mayBe tgts'
mustBe xs = Set.fromList [x | (MustBe x) <- xs]
mayBe xs = Set.fromList [x | (MayBe x) <- xs]
orWhenEmptyS a b = if (Set.null a) then b else a
determineBySize _ [a] = impure (t,Known a)
determineBySize err lst = fmap ((,) t) (err lst)
impure x = Change x False
isc = Set.intersection
uni = Set.union
| 1,888
|
performUpdate ((t,unkn), Cnstr srcs' tgts')
= case unkn of
Known _ -> pure (t,unkn)
Rel xs -> determineBySize (\x -> if length x == length xs then pure (Rel xs) else impure (Rel x))
((findMatch' (mustBeSrc,mustBeTgt) xs `orWhenEmpty` findMatch' (mayBeSrc,mayBeTgt) xs)
`orWhenEmpty` xs)
Ident -> determineBySize suggest (map EDcI (Set.toList possibleConcs))
Mp1 x -> determineBySize suggest (map (EMp1 x) (Set.toList possibleConcs))
Vee -> determineBySize (const (pure unkn))
[EDcV (Sign a b) | a<-Set.toList mustBeSrc, b<-Set.toList mustBeTgt]
where
suggest [] = pure unkn
suggest lst = impure (Rel lst) -- TODO: find out whether it is equivalent to put "pure" here (which could be faster).
possibleConcs = (mustBeSrc `isc` mustBeTgt) `orWhenEmptyS`
(mustBeSrc `uni` mustBeTgt) `orWhenEmptyS`
(mayBeSrc `isc` mayBeTgt ) `orWhenEmptyS`
(mayBeSrc `uni` mayBeTgt )
findMatch' (a,b) = findMatch (Set.toList a,Set.toList b)
findMatch ([],[]) _ = []
findMatch ([],tgts) lst
= [x | x<-lst, target x `elem` tgts]
findMatch (srcs,[]) lst
= [x | x<-lst, source x `elem` srcs]
findMatch (srcs,tgts) lst
= [x | x<-lst, source x `elem` srcs, target x `elem` tgts]
mustBeSrc = mustBe srcs'
mustBeTgt = mustBe tgts'
mayBeSrc = mayBe srcs'
mayBeTgt = mayBe tgts'
mustBe xs = Set.fromList [x | (MustBe x) <- xs]
mayBe xs = Set.fromList [x | (MayBe x) <- xs]
orWhenEmptyS a b = if (Set.null a) then b else a
determineBySize _ [a] = impure (t,Known a)
determineBySize err lst = fmap ((,) t) (err lst)
impure x = Change x False
isc = Set.intersection
uni = Set.union
| 1,772
| true
| true
| 19
| 14
| 531
| 785
| 417
| 368
| null | null |
laughedelic/sparse-lin-alg
|
Math/LinearAlgebra/Sparse/Matrix.hs
|
bsd-3-clause
|
-- | Unicode alias for `mulVM`
(·×) :: (Num α, Eq α) => SparseVector α -> SparseMatrix α -> SparseVector α
v ·× m = (trans m) ×· v
| 131
|
(·×) :: (Num α, Eq α) => SparseVector α -> SparseMatrix α -> SparseVector α
v ·× m = (trans m) ×· v
| 100
|
v ·× m = (trans m) ×· v
| 23
| true
| true
| 0
| 10
| 29
| 62
| 31
| 31
| null | null |
CindyLinz/Haskell-HVG
|
src/HVG/Context2D.hs
|
bsd-3-clause
|
lineJoin :: LineJoin -> IO ()
lineJoin val = putStrLn $ "ctx.lineJoin = " ++ show (strValue val) ++ ";"
| 103
|
lineJoin :: LineJoin -> IO ()
lineJoin val = putStrLn $ "ctx.lineJoin = " ++ show (strValue val) ++ ";"
| 103
|
lineJoin val = putStrLn $ "ctx.lineJoin = " ++ show (strValue val) ++ ";"
| 73
| false
| true
| 0
| 9
| 19
| 49
| 22
| 27
| null | null |
abakst/liquidhaskell
|
benchmarks/vector-0.10.0.1/Data/Vector/Fusion/Stream/Monadic.hs
|
bsd-3-clause
|
findM f (Stream step s _) = find_loop SPEC s
where
find_loop !sPEC s
= do
r <- step s
case r of
Yield x s' -> do
b <- f x
if b then return $ Just x
else find_loop SPEC s'
Skip s' -> find_loop SPEC s'
Done -> return Nothing
-- | Yield 'Just' the index of the first element that satisfies the predicate
-- or 'Nothing' if no such element exists.
| 510
|
findM f (Stream step s _) = find_loop SPEC s
where
find_loop !sPEC s
= do
r <- step s
case r of
Yield x s' -> do
b <- f x
if b then return $ Just x
else find_loop SPEC s'
Skip s' -> find_loop SPEC s'
Done -> return Nothing
-- | Yield 'Just' the index of the first element that satisfies the predicate
-- or 'Nothing' if no such element exists.
| 510
|
findM f (Stream step s _) = find_loop SPEC s
where
find_loop !sPEC s
= do
r <- step s
case r of
Yield x s' -> do
b <- f x
if b then return $ Just x
else find_loop SPEC s'
Skip s' -> find_loop SPEC s'
Done -> return Nothing
-- | Yield 'Just' the index of the first element that satisfies the predicate
-- or 'Nothing' if no such element exists.
| 510
| false
| false
| 0
| 14
| 241
| 126
| 57
| 69
| null | null |
timtylin/scholdoc-citeproc
|
tests/test-citeproc.hs
|
bsd-3-clause
|
-- this is designed to mimic the test suite's output:
inlinesToString :: [Inline] -> String
inlinesToString ils =
writeHtmlString def{ writerWrapText = False }
$ bottomUp (concatMap adjustSpans)
$ Pandoc nullMeta [Plain ils]
| 236
|
inlinesToString :: [Inline] -> String
inlinesToString ils =
writeHtmlString def{ writerWrapText = False }
$ bottomUp (concatMap adjustSpans)
$ Pandoc nullMeta [Plain ils]
| 182
|
inlinesToString ils =
writeHtmlString def{ writerWrapText = False }
$ bottomUp (concatMap adjustSpans)
$ Pandoc nullMeta [Plain ils]
| 142
| true
| true
| 4
| 7
| 44
| 63
| 31
| 32
| null | null |
mettekou/ghc
|
compiler/basicTypes/BasicTypes.hs
|
bsd-3-clause
|
fIRST_TAG :: ConTag
-- ^ Tags are allocated from here for real constructors
-- or for superclass selectors
fIRST_TAG = 1
| 123
|
fIRST_TAG :: ConTag
fIRST_TAG = 1
| 34
|
fIRST_TAG = 1
| 14
| true
| true
| 0
| 4
| 23
| 13
| 8
| 5
| null | null |
rvion/lamdu
|
Lamdu/Expr/IRef.hs
|
gpl-3.0
|
readValBody :: MonadA m => ValI m -> T m (ValBody m)
readValBody = Transaction.readIRef . unValI
| 96
|
readValBody :: MonadA m => ValI m -> T m (ValBody m)
readValBody = Transaction.readIRef . unValI
| 96
|
readValBody = Transaction.readIRef . unValI
| 43
| false
| true
| 0
| 9
| 16
| 42
| 20
| 22
| null | null |
ivan-m/jbi
|
lib/System/JBI/Commands/Tool.hs
|
mit
|
allSuccess :: (Monad m, Foldable t) => t (m ExitCode) -> m ExitCode
allSuccess = foldr (.&&.) (return ExitSuccess)
| 114
|
allSuccess :: (Monad m, Foldable t) => t (m ExitCode) -> m ExitCode
allSuccess = foldr (.&&.) (return ExitSuccess)
| 114
|
allSuccess = foldr (.&&.) (return ExitSuccess)
| 46
| false
| true
| 0
| 10
| 18
| 62
| 29
| 33
| null | null |
hnfmr/test-hedis
|
Setup.hs
|
mit
|
main = defaultMainWithHooks hooks
where hooks = simpleUserHooks { preBuild = preBuild' }
| 90
|
main = defaultMainWithHooks hooks
where hooks = simpleUserHooks { preBuild = preBuild' }
| 90
|
main = defaultMainWithHooks hooks
where hooks = simpleUserHooks { preBuild = preBuild' }
| 90
| false
| false
| 2
| 7
| 14
| 35
| 14
| 21
| null | null |
apyrgio/snf-ganeti
|
src/Ganeti/OpParams.hs
|
bsd-2-clause
|
pCandidatePoolSize :: Field
pCandidatePoolSize =
withDoc "Master candidate pool size" .
optionalField $ simpleField "candidate_pool_size" [t| Positive Int |]
| 161
|
pCandidatePoolSize :: Field
pCandidatePoolSize =
withDoc "Master candidate pool size" .
optionalField $ simpleField "candidate_pool_size" [t| Positive Int |]
| 161
|
pCandidatePoolSize =
withDoc "Master candidate pool size" .
optionalField $ simpleField "candidate_pool_size" [t| Positive Int |]
| 133
| false
| true
| 0
| 7
| 22
| 31
| 17
| 14
| null | null |
m4lvin/robbed
|
src/Data/ROBDD/BooleanFunctions.hs
|
bsd-3-clause
|
False `boolImpl` True = True
| 28
|
False `boolImpl` True = True
| 28
|
False `boolImpl` True = True
| 28
| false
| false
| 0
| 5
| 4
| 14
| 7
| 7
| null | null |
bgold-cosmos/Tidal
|
src/Sound/Tidal/Stream.hs
|
gpl-3.0
|
resolve :: String -> String -> IO N.AddrInfo
resolve host port = do let hints = N.defaultHints { N.addrSocketType = N.Stream }
addr:_ <- N.getAddrInfo (Just hints) (Just host) (Just port)
return addr
| 245
|
resolve :: String -> String -> IO N.AddrInfo
resolve host port = do let hints = N.defaultHints { N.addrSocketType = N.Stream }
addr:_ <- N.getAddrInfo (Just hints) (Just host) (Just port)
return addr
| 245
|
resolve host port = do let hints = N.defaultHints { N.addrSocketType = N.Stream }
addr:_ <- N.getAddrInfo (Just hints) (Just host) (Just port)
return addr
| 200
| false
| true
| 0
| 13
| 78
| 101
| 47
| 54
| null | null |
leichunfeng/learnyouahaskell
|
baby.hs
|
mit
|
flip'' :: (a -> b -> c) -> b -> a -> c
flip'' f y x = f x y
| 59
|
flip'' :: (a -> b -> c) -> b -> a -> c
flip'' f y x = f x y
| 59
|
flip'' f y x = f x y
| 20
| false
| true
| 0
| 9
| 20
| 53
| 24
| 29
| null | null |
hpacheco/HAAP
|
examples/xterm/Haskassonne.hs
|
mit
|
validFollower (Tile E _ _ p) = profession (fromJust p) == Knight || profession (fromJust p) == Farmer
| 101
|
validFollower (Tile E _ _ p) = profession (fromJust p) == Knight || profession (fromJust p) == Farmer
| 101
|
validFollower (Tile E _ _ p) = profession (fromJust p) == Knight || profession (fromJust p) == Farmer
| 101
| false
| false
| 0
| 10
| 17
| 52
| 24
| 28
| null | null |
vincenthz/hs-crypto-random
|
Crypto/Random/Entropy/Unix.hs
|
bsd-3-clause
|
closeDev :: H -> IO ()
closeDev h = closeFd h
| 45
|
closeDev :: H -> IO ()
closeDev h = closeFd h
| 45
|
closeDev h = closeFd h
| 22
| false
| true
| 0
| 7
| 10
| 26
| 12
| 14
| null | null |
aelyasov/Haslog
|
src/Eu/Fittest/Logging/XML/Value.hs
|
bsd-3-clause
|
isUndefined _ = False
| 24
|
isUndefined _ = False
| 24
|
isUndefined _ = False
| 24
| false
| false
| 0
| 5
| 6
| 9
| 4
| 5
| null | null |
GaloisInc/sk-dev-platform
|
libs/lobster/src/Lobster/Common.hs
|
bsd-3-clause
|
defaultOptions :: Options
defaultOptions = Options
{ includeFiles = []
, outputFile = "module"
}
| 102
|
defaultOptions :: Options
defaultOptions = Options
{ includeFiles = []
, outputFile = "module"
}
| 102
|
defaultOptions = Options
{ includeFiles = []
, outputFile = "module"
}
| 76
| false
| true
| 0
| 8
| 20
| 31
| 17
| 14
| null | null |
mnick/hsparse
|
src/Numeric/Sparse/Vector.hs
|
bsd-3-clause
|
(<>) :: (Eq a, Num a, DIM n) => SparseVector n a -> SparseVector n a -> a
x <> y = dot x y
| 90
|
(<>) :: (Eq a, Num a, DIM n) => SparseVector n a -> SparseVector n a -> a
x <> y = dot x y
| 90
|
x <> y = dot x y
| 16
| false
| true
| 0
| 10
| 24
| 64
| 31
| 33
| null | null |
dterei/Scraps
|
haskell/parsers/P1.hs
|
bsd-3-clause
|
-- we can define 'seq' in terms of 'bind', but not vice-versa
seq2 :: Parser a -> Parser b -> Parser (a,b)
seq2 pa pb = pa `bind` \a -> pb `bind` \b -> result (a,b)
| 164
|
seq2 :: Parser a -> Parser b -> Parser (a,b)
seq2 pa pb = pa `bind` \a -> pb `bind` \b -> result (a,b)
| 102
|
seq2 pa pb = pa `bind` \a -> pb `bind` \b -> result (a,b)
| 57
| true
| true
| 0
| 10
| 35
| 78
| 41
| 37
| null | null |
apyrgio/snf-ganeti
|
test/hs/Test/Ganeti/TestHTools.hs
|
bsd-2-clause
|
-- | Default group, as a (singleton) 'Group.List'.
defGroupList :: Group.List
defGroupList = Container.fromList [(Group.idx defGroup, defGroup)]
| 144
|
defGroupList :: Group.List
defGroupList = Container.fromList [(Group.idx defGroup, defGroup)]
| 93
|
defGroupList = Container.fromList [(Group.idx defGroup, defGroup)]
| 66
| true
| true
| 0
| 9
| 16
| 39
| 19
| 20
| null | null |
Persi/shellcheck
|
ShellCheck/Parser.hs
|
gpl-3.0
|
prop_readSelectClause1 = isOk readSelectClause "select foo in *; do echo $foo; done"
| 84
|
prop_readSelectClause1 = isOk readSelectClause "select foo in *; do echo $foo; done"
| 84
|
prop_readSelectClause1 = isOk readSelectClause "select foo in *; do echo $foo; done"
| 84
| false
| false
| 0
| 5
| 11
| 11
| 5
| 6
| null | null |
alphaHeavy/hlint
|
data/Default.hs
|
gpl-2.0
|
error "Evaluate" = init [x] ==> []
| 34
|
error "Evaluate" = init [x] ==> []
| 34
|
error "Evaluate" = init [x] ==> []
| 34
| false
| false
| 2
| 6
| 6
| 25
| 10
| 15
| null | null |
FranklinChen/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
txt :: String -> T.Text
txt = T.pack
| 36
|
txt :: String -> T.Text
txt = T.pack
| 36
|
txt = T.pack
| 12
| false
| true
| 0
| 8
| 7
| 26
| 11
| 15
| null | null |
Happy0/haskellscrabble
|
src/Wordify/Rules/Square.hs
|
gpl-3.0
|
applyWordBonus (DoubleLetter (Just tile)) = (+ tileValue tile)
| 62
|
applyWordBonus (DoubleLetter (Just tile)) = (+ tileValue tile)
| 62
|
applyWordBonus (DoubleLetter (Just tile)) = (+ tileValue tile)
| 62
| false
| false
| 0
| 8
| 7
| 29
| 14
| 15
| null | null |
torchhound/projects
|
haskell/startingOut.hs
|
gpl-3.0
|
--fizzBuzz = [if x `mod` 3 = 0 && x `mod` 5 == 0 then "fizzbuzz" else if x `mod` 3 = 0 then "fizz" else if x `mod` 5 == 0 then "buzz" else x | x <- [1..100]]
filterTwo xs ys = [x * y | x <- xs, y <- ys]
| 202
|
filterTwo xs ys = [x * y | x <- xs, y <- ys]
| 44
|
filterTwo xs ys = [x * y | x <- xs, y <- ys]
| 44
| true
| false
| 1
| 8
| 53
| 40
| 18
| 22
| null | null |
bgamari/pandoc
|
src/Text/Pandoc/Readers/Org.hs
|
gpl-2.0
|
indentWith :: Int -> OrgParser String
indentWith num = do
tabStop <- getOption readerTabStop
if num < tabStop
then count num (char ' ')
else choice [ try (count num (char ' '))
, try (char '\t' >> count (num - tabStop) (char ' ')) ]
| 263
|
indentWith :: Int -> OrgParser String
indentWith num = do
tabStop <- getOption readerTabStop
if num < tabStop
then count num (char ' ')
else choice [ try (count num (char ' '))
, try (char '\t' >> count (num - tabStop) (char ' ')) ]
| 263
|
indentWith num = do
tabStop <- getOption readerTabStop
if num < tabStop
then count num (char ' ')
else choice [ try (count num (char ' '))
, try (char '\t' >> count (num - tabStop) (char ' ')) ]
| 225
| false
| true
| 0
| 15
| 76
| 114
| 55
| 59
| null | null |
bergmark/purescript
|
src/Language/PureScript/Sugar/CaseDeclarations.hs
|
mit
|
toDecls :: [Declaration] -> SupplyT (Either ErrorStack) [Declaration]
toDecls [ValueDeclaration ident nameKind bs Nothing val] | all isVarBinder bs = do
let args = map (\(VarBinder arg) -> arg) bs
body = foldr (Abs . Left) val args
return [ValueDeclaration ident nameKind [] Nothing body]
| 298
|
toDecls :: [Declaration] -> SupplyT (Either ErrorStack) [Declaration]
toDecls [ValueDeclaration ident nameKind bs Nothing val] | all isVarBinder bs = do
let args = map (\(VarBinder arg) -> arg) bs
body = foldr (Abs . Left) val args
return [ValueDeclaration ident nameKind [] Nothing body]
| 298
|
toDecls [ValueDeclaration ident nameKind bs Nothing val] | all isVarBinder bs = do
let args = map (\(VarBinder arg) -> arg) bs
body = foldr (Abs . Left) val args
return [ValueDeclaration ident nameKind [] Nothing body]
| 228
| false
| true
| 0
| 16
| 54
| 134
| 64
| 70
| null | null |
mcschroeder/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
-- Note that the TyConApp could be an
-- under-saturated type synonym. GHC allows that; e.g.
-- type Foo k = k a -> k a
-- type Id x = x
-- foo :: Foo Id -> Foo Id
--
-- Here Id is partially applied in the type sig for Foo,
-- but once the type synonyms are expanded all is well
mkAppTys :: Type -> [Type] -> Type
mkAppTys ty1 [] = ty1
| 425
|
mkAppTys :: Type -> [Type] -> Type
mkAppTys ty1 [] = ty1
| 73
|
mkAppTys ty1 [] = ty1
| 38
| true
| true
| 0
| 9
| 165
| 43
| 24
| 19
| null | null |
PipocaQuemada/ermine
|
src/Ermine/Parser/Module.hs
|
bsd-2-clause
|
prec :: (Monad m, TokenParsing m) => m Int
prec = (do n <- natural
if n <= 10
then return (fromInteger n)
else empty)
<?> "precedence between 0 and 10"
| 195
|
prec :: (Monad m, TokenParsing m) => m Int
prec = (do n <- natural
if n <= 10
then return (fromInteger n)
else empty)
<?> "precedence between 0 and 10"
| 195
|
prec = (do n <- natural
if n <= 10
then return (fromInteger n)
else empty)
<?> "precedence between 0 and 10"
| 152
| false
| true
| 0
| 12
| 74
| 67
| 34
| 33
| null | null |
portnov/yaledger
|
YaLedger/Reports/Ledger.hs
|
bsd-3-clause
|
showPostingValueD True (DPosting acc x _) = prettyPrint (x :# getCurrency acc)
| 78
|
showPostingValueD True (DPosting acc x _) = prettyPrint (x :# getCurrency acc)
| 78
|
showPostingValueD True (DPosting acc x _) = prettyPrint (x :# getCurrency acc)
| 78
| false
| false
| 0
| 8
| 11
| 34
| 16
| 18
| null | null |
davidzhulijun/TAM
|
RegisterMachine/Models/CMA4.hs
|
bsd-3-clause
|
trans (CPA r1 r2) = copyMem (A r1) (A r2)
| 42
|
trans (CPA r1 r2) = copyMem (A r1) (A r2)
| 42
|
trans (CPA r1 r2) = copyMem (A r1) (A r2)
| 42
| false
| false
| 0
| 7
| 10
| 35
| 16
| 19
| null | null |
jasonzoladz/persistent
|
persistent/Database/Persist/Quasi.hs
|
mit
|
takeCols :: (Text -> String -> Maybe FieldDef) -> PersistSettings -> [Text] -> Maybe FieldDef
takeCols _ _ ("deriving":_) = Nothing
| 131
|
takeCols :: (Text -> String -> Maybe FieldDef) -> PersistSettings -> [Text] -> Maybe FieldDef
takeCols _ _ ("deriving":_) = Nothing
| 131
|
takeCols _ _ ("deriving":_) = Nothing
| 37
| false
| true
| 0
| 11
| 20
| 62
| 30
| 32
| null | null |
kowey/GenI
|
src/NLP/GenI/Simple/SimpleBuilder.hs
|
gpl-2.0
|
iapplyAdjNode :: Bool -> SimpleItem -> SimpleItem -> Maybe SimpleItem
iapplyAdjNode twophase aItem pItem = {-# SCC "iapplyAdjNode" #-}
case siAdjnodes pItem of
[] -> Nothing
(pHead : pTail) -> do
-- let's go!
let pSite = toTagSite (lookupOrBug "iapplyAdjNode" pItem pHead)
(anr, anf, subst12) <- canAdjoin aItem pSite
let r_name = siRoot_ aItem
r = siRoot aItem
f <- siFoot aItem
let an_name = tsName pSite
-- the new adjunction nodes
aItem2 = aItem { siNodes = map (setSites anr) (siNodes aItem) }
where
setSites (TagSite n u d _) gn =
if gnname gn == n then gn { gup = u, gdown = d } else gn
rawCombined =
combineSimpleItems [tsName r, an_name] aItem2 $ pItem
{ siAdjnodes = pTail ++ siAdjnodes aItem
, siDerived = spliceTree (tsName f) (siDerived aItem) an_name (siDerived pItem)
, siDerivation = addToDerivation AdjunctionStep (aItem,tsOrigin r) (pItem,tsOrigin pSite,an_name)
-- , siAdjlist = (n, (tidnum te1)):(siAdjlist item2)
-- if we adjoin into the root, the new root is that of the aux
-- tree (affects 1p only)
, siRoot_ = if isRootOf pItem an_name then r_name else siRoot_ pItem
, siPendingTb =
if twophase then []
else tsName f : siPendingTb pItem ++ siPendingTb aItem
}
-- one phase = postpone tb unification
-- two phase = do tb unification on the fly
finalRes1p = return $ replace subst12 rawCombined
finalRes2p =
do -- tb on the former foot
tbRes <- hush $ unifyFeat (tsUp anf) (tsDown anf)
let (anf_tb, subst3) = tbRes
myRes = constrainAdj an_name anf_tb res'
-- apply the substitutions
res' = replace (appendSubst subst12 subst3) rawCombined
return myRes
-- ---------------
if twophase then finalRes2p else finalRes1p
| 1,989
|
iapplyAdjNode :: Bool -> SimpleItem -> SimpleItem -> Maybe SimpleItem
iapplyAdjNode twophase aItem pItem = {-# SCC "iapplyAdjNode" #-}
case siAdjnodes pItem of
[] -> Nothing
(pHead : pTail) -> do
-- let's go!
let pSite = toTagSite (lookupOrBug "iapplyAdjNode" pItem pHead)
(anr, anf, subst12) <- canAdjoin aItem pSite
let r_name = siRoot_ aItem
r = siRoot aItem
f <- siFoot aItem
let an_name = tsName pSite
-- the new adjunction nodes
aItem2 = aItem { siNodes = map (setSites anr) (siNodes aItem) }
where
setSites (TagSite n u d _) gn =
if gnname gn == n then gn { gup = u, gdown = d } else gn
rawCombined =
combineSimpleItems [tsName r, an_name] aItem2 $ pItem
{ siAdjnodes = pTail ++ siAdjnodes aItem
, siDerived = spliceTree (tsName f) (siDerived aItem) an_name (siDerived pItem)
, siDerivation = addToDerivation AdjunctionStep (aItem,tsOrigin r) (pItem,tsOrigin pSite,an_name)
-- , siAdjlist = (n, (tidnum te1)):(siAdjlist item2)
-- if we adjoin into the root, the new root is that of the aux
-- tree (affects 1p only)
, siRoot_ = if isRootOf pItem an_name then r_name else siRoot_ pItem
, siPendingTb =
if twophase then []
else tsName f : siPendingTb pItem ++ siPendingTb aItem
}
-- one phase = postpone tb unification
-- two phase = do tb unification on the fly
finalRes1p = return $ replace subst12 rawCombined
finalRes2p =
do -- tb on the former foot
tbRes <- hush $ unifyFeat (tsUp anf) (tsDown anf)
let (anf_tb, subst3) = tbRes
myRes = constrainAdj an_name anf_tb res'
-- apply the substitutions
res' = replace (appendSubst subst12 subst3) rawCombined
return myRes
-- ---------------
if twophase then finalRes2p else finalRes1p
| 1,989
|
iapplyAdjNode twophase aItem pItem = {-# SCC "iapplyAdjNode" #-}
case siAdjnodes pItem of
[] -> Nothing
(pHead : pTail) -> do
-- let's go!
let pSite = toTagSite (lookupOrBug "iapplyAdjNode" pItem pHead)
(anr, anf, subst12) <- canAdjoin aItem pSite
let r_name = siRoot_ aItem
r = siRoot aItem
f <- siFoot aItem
let an_name = tsName pSite
-- the new adjunction nodes
aItem2 = aItem { siNodes = map (setSites anr) (siNodes aItem) }
where
setSites (TagSite n u d _) gn =
if gnname gn == n then gn { gup = u, gdown = d } else gn
rawCombined =
combineSimpleItems [tsName r, an_name] aItem2 $ pItem
{ siAdjnodes = pTail ++ siAdjnodes aItem
, siDerived = spliceTree (tsName f) (siDerived aItem) an_name (siDerived pItem)
, siDerivation = addToDerivation AdjunctionStep (aItem,tsOrigin r) (pItem,tsOrigin pSite,an_name)
-- , siAdjlist = (n, (tidnum te1)):(siAdjlist item2)
-- if we adjoin into the root, the new root is that of the aux
-- tree (affects 1p only)
, siRoot_ = if isRootOf pItem an_name then r_name else siRoot_ pItem
, siPendingTb =
if twophase then []
else tsName f : siPendingTb pItem ++ siPendingTb aItem
}
-- one phase = postpone tb unification
-- two phase = do tb unification on the fly
finalRes1p = return $ replace subst12 rawCombined
finalRes2p =
do -- tb on the former foot
tbRes <- hush $ unifyFeat (tsUp anf) (tsDown anf)
let (anf_tb, subst3) = tbRes
myRes = constrainAdj an_name anf_tb res'
-- apply the substitutions
res' = replace (appendSubst subst12 subst3) rawCombined
return myRes
-- ---------------
if twophase then finalRes2p else finalRes1p
| 1,919
| false
| true
| 0
| 20
| 628
| 515
| 265
| 250
| null | null |
misgeatgit/opencog
|
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs
|
agpl-3.0
|
(.<) :: SynIso (a,b) c -> SynIso d a -> SynIso (d,b) c
(.<) i j = i . first j
| 77
|
(.<) :: SynIso (a,b) c -> SynIso d a -> SynIso (d,b) c
(.<) i j = i . first j
| 77
|
(.<) i j = i . first j
| 22
| false
| true
| 1
| 9
| 20
| 68
| 34
| 34
| null | null |
brendanhay/gogol
|
gogol-containeranalysis/gen/Network/Google/ContainerAnalysis/Types/Product.hs
|
mpl-2.0
|
-- | Required. The CPE URI in [CPE
-- format](https:\/\/cpe.mitre.org\/specification\/) denoting the package
-- manager version distributing a package.
lCpeURI :: Lens' Location (Maybe Text)
lCpeURI = lens _lCpeURI (\ s a -> s{_lCpeURI = a})
| 241
|
lCpeURI :: Lens' Location (Maybe Text)
lCpeURI = lens _lCpeURI (\ s a -> s{_lCpeURI = a})
| 89
|
lCpeURI = lens _lCpeURI (\ s a -> s{_lCpeURI = a})
| 50
| true
| true
| 0
| 9
| 35
| 48
| 27
| 21
| null | null |
agentm/project-m36
|
src/lib/ProjectM36/Client.hs
|
unlicense
|
createSessionAtHead conn@(RemoteConnection _) headn = remoteCall conn (CreateSessionAtHead headn)
| 97
|
createSessionAtHead conn@(RemoteConnection _) headn = remoteCall conn (CreateSessionAtHead headn)
| 97
|
createSessionAtHead conn@(RemoteConnection _) headn = remoteCall conn (CreateSessionAtHead headn)
| 97
| false
| false
| 0
| 8
| 8
| 31
| 15
| 16
| null | null |
skeskinen/neflEFortress
|
World.hs
|
mit
|
worldPhysics :: State World ()
worldPhysics = do
world <- get
let phys obj = do
let mpos = obj ^? objPos
case mpos of
Just pos -> do
let newpos = pos & _3 +~ 1
let getTileType position = world ^. worldTerrain . terrainTile position . tileType
if TileEmpty == getTileType pos && not (tileIsWall (getTileType newpos))
then moveObj obj newpos
else return obj
Nothing ->
return obj
newCreatures <- traverse phys (world ^. worldCreatures)
worldCreatures .= newCreatures
newItems <- traverse phys (world ^. worldItems)
worldItems .= newItems
| 760
|
worldPhysics :: State World ()
worldPhysics = do
world <- get
let phys obj = do
let mpos = obj ^? objPos
case mpos of
Just pos -> do
let newpos = pos & _3 +~ 1
let getTileType position = world ^. worldTerrain . terrainTile position . tileType
if TileEmpty == getTileType pos && not (tileIsWall (getTileType newpos))
then moveObj obj newpos
else return obj
Nothing ->
return obj
newCreatures <- traverse phys (world ^. worldCreatures)
worldCreatures .= newCreatures
newItems <- traverse phys (world ^. worldItems)
worldItems .= newItems
| 760
|
worldPhysics = do
world <- get
let phys obj = do
let mpos = obj ^? objPos
case mpos of
Just pos -> do
let newpos = pos & _3 +~ 1
let getTileType position = world ^. worldTerrain . terrainTile position . tileType
if TileEmpty == getTileType pos && not (tileIsWall (getTileType newpos))
then moveObj obj newpos
else return obj
Nothing ->
return obj
newCreatures <- traverse phys (world ^. worldCreatures)
worldCreatures .= newCreatures
newItems <- traverse phys (world ^. worldItems)
worldItems .= newItems
| 729
| false
| true
| 0
| 23
| 314
| 216
| 99
| 117
| null | null |
andrewthad/vinyl-vectors
|
src/Data/Vector/Vinyl/Default/NonEmpty/Tagged.hs
|
bsd-3-clause
|
-- Monadic indexing
-- ----------------
-- | /O(1)/ Indexing in a monad.
--
-- The monad allows operations to be strict in the vector when necessary.
-- Suppose vector copying is implemented like this:
--
-- > copy mv v = ... write mv i (v ! i) ...
--
-- For lazy vectors, @v ! i@ would not be evaluated which means that @mv@
-- would unnecessarily retain a reference to @v@ in each element written.
--
-- With 'indexM', copying can be implemented like this instead:
--
-- > copy mv v = ... do
-- > x <- indexM v i
-- > write mv i x
--
-- Here, no references to @v@ are retained because indexing (but /not/ the
-- elements) is evaluated eagerly.
--
indexM :: (Monad m, G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs))
=> (Vector k) (Rec (TaggedFunctor Identity) rs) -> Int -> m (Rec (TaggedFunctor Identity) rs)
indexM = G.indexM
| 874
|
indexM :: (Monad m, G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs))
=> (Vector k) (Rec (TaggedFunctor Identity) rs) -> Int -> m (Rec (TaggedFunctor Identity) rs)
indexM = G.indexM
| 188
|
indexM = G.indexM
| 17
| true
| true
| 0
| 13
| 197
| 127
| 72
| 55
| null | null |
yousufmsoliman/music
|
Source (Haskell)/Agent.hs
|
gpl-3.0
|
makeSoftRule op desc = Agent { isTester = True, isSoftRule = True, operate = op, description = desc }
| 101
|
makeSoftRule op desc = Agent { isTester = True, isSoftRule = True, operate = op, description = desc }
| 101
|
makeSoftRule op desc = Agent { isTester = True, isSoftRule = True, operate = op, description = desc }
| 101
| false
| false
| 0
| 6
| 18
| 38
| 22
| 16
| null | null |
ekmett/monoids
|
Data/Generator/Combinators.hs
|
bsd-3-clause
|
-- | Efficiently 'reduce' a 'Generator' using the 'Self' monoid. A specialized version of its namesake from "Data.Foldable"
--
-- @
-- 'reduceWith' 'getSelf'
-- @
fold :: (Monoid m, Generator c, Elem c ~ m) => c -> m
fold = reduceWith getSelf
| 246
|
fold :: (Monoid m, Generator c, Elem c ~ m) => c -> m
fold = reduceWith getSelf
| 79
|
fold = reduceWith getSelf
| 25
| true
| true
| 0
| 8
| 47
| 49
| 27
| 22
| null | null |
allonsy/masterpass
|
src/Cryptography/MasterPassword/Types.hs
|
mit
|
siteTypeToEnum StoredDevice = c_getStoredDevicePrivateSiteType
| 62
|
siteTypeToEnum StoredDevice = c_getStoredDevicePrivateSiteType
| 62
|
siteTypeToEnum StoredDevice = c_getStoredDevicePrivateSiteType
| 62
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
gridaphobe/target
|
examples/XMonad/StackSet.hs
|
mit
|
-- |
-- /O(w)/. Set focus to the workspace with index \'i\'.
-- If the index is out of range, return the original 'StackSet'.
--
-- Xinerama: If the workspace is not visible on any Xinerama screen, it
-- becomes the current screen. If it is in the visible list, it becomes
-- current.
{-@ predicate EqTag X S = (X = (ltag (lworkspace (lcurrent S)))) @-}
{-@ predicate TagMember X S =
(
(EqTag X S)
||
(Set_mem X (workspacesTags (lhidden S)))
||
(Set_mem X (screensTags (lvisible S)))
)
@-}
-- TODO prove uniqueness of tags!
{-@ invariant {v:StackSet i l a sid sd | (
Disjoint3 (Set_sng (ltag (lworkspace (lcurrent v)))) (workspacesTags (lhidden v)) (screensTags (lvisible v))
)} @-}
{-@ predicate EqEltsStackSet X Y = ((stackSetElts X) = (stackSetElts Y)) @-}
{-@ view :: (Eq s, Eq i)
=> x:i
-> s:UStackSet i l a s sd
-> {v:UStackSet i l a s sd | ( ((TagMember x s) => (EqTag x v)) && (EqEltsStackSet s v) && (((EqTag x s) || (not (TagMember x s))) => (s = v)) ) }
@-}
view :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
view i s
| i == currentTag s = s -- current
| Just x <- L.find ((i==).tag.workspace) (visible s)
-- if it is visible, it is just raised
= s { current = x, visible = current s : L.deleteBy (equating screen) x (visible s) }
| Just x <- L.find ((i==).tag) (hidden s) -- must be hidden then
-- if it was hidden, it is raised on the xine screen currently used
= s { current = (current s) { workspace = x }
, hidden = workspace (current s) : L.deleteBy (equating tag) x (hidden s) }
| otherwise = s -- not a member of the stackset
where equating f = \x y -> f x == f y
-- 'Catch'ing this might be hard. Relies on monotonically increasing
-- workspace tags defined in 'new'
--
-- and now tags are not monotonic, what happens here?
-- |
-- Set focus to the given workspace. If that workspace does not exist
-- in the stackset, the original workspace is returned. If that workspace is
-- 'hidden', then display that workspace on the current screen, and move the
-- current workspace to 'hidden'. If that workspace is 'visible' on another
-- screen, the workspaces of the current screen and the other screen are
-- swapped.
{-@ greedyView :: (Eq s, Eq i)
=> x:i
-> s:UStackSet i l a s sd
-> {v:UStackSet i l a s sd | ( ((TagMember x s) => (EqTag x v)) && (EqEltsStackSet s v) && (((EqTag x s) || (not (TagMember x s))) => (v = s))) }
@-}
| 2,569
|
view :: (Eq s, Eq i) => i -> StackSet i l a s sd -> StackSet i l a s sd
view i s
| i == currentTag s = s -- current
| Just x <- L.find ((i==).tag.workspace) (visible s)
-- if it is visible, it is just raised
= s { current = x, visible = current s : L.deleteBy (equating screen) x (visible s) }
| Just x <- L.find ((i==).tag) (hidden s) -- must be hidden then
-- if it was hidden, it is raised on the xine screen currently used
= s { current = (current s) { workspace = x }
, hidden = workspace (current s) : L.deleteBy (equating tag) x (hidden s) }
| otherwise = s -- not a member of the stackset
where equating f = \x y -> f x == f y
-- 'Catch'ing this might be hard. Relies on monotonically increasing
-- workspace tags defined in 'new'
--
-- and now tags are not monotonic, what happens here?
-- |
-- Set focus to the given workspace. If that workspace does not exist
-- in the stackset, the original workspace is returned. If that workspace is
-- 'hidden', then display that workspace on the current screen, and move the
-- current workspace to 'hidden'. If that workspace is 'visible' on another
-- screen, the workspaces of the current screen and the other screen are
-- swapped.
{-@ greedyView :: (Eq s, Eq i)
=> x:i
-> s:UStackSet i l a s sd
-> {v:UStackSet i l a s sd | ( ((TagMember x s) => (EqTag x v)) && (EqEltsStackSet s v) && (((EqTag x s) || (not (TagMember x s))) => (v = s))) }
@-}
| 1,508
|
view i s
| i == currentTag s = s -- current
| Just x <- L.find ((i==).tag.workspace) (visible s)
-- if it is visible, it is just raised
= s { current = x, visible = current s : L.deleteBy (equating screen) x (visible s) }
| Just x <- L.find ((i==).tag) (hidden s) -- must be hidden then
-- if it was hidden, it is raised on the xine screen currently used
= s { current = (current s) { workspace = x }
, hidden = workspace (current s) : L.deleteBy (equating tag) x (hidden s) }
| otherwise = s -- not a member of the stackset
where equating f = \x y -> f x == f y
-- 'Catch'ing this might be hard. Relies on monotonically increasing
-- workspace tags defined in 'new'
--
-- and now tags are not monotonic, what happens here?
-- |
-- Set focus to the given workspace. If that workspace does not exist
-- in the stackset, the original workspace is returned. If that workspace is
-- 'hidden', then display that workspace on the current screen, and move the
-- current workspace to 'hidden'. If that workspace is 'visible' on another
-- screen, the workspaces of the current screen and the other screen are
-- swapped.
{-@ greedyView :: (Eq s, Eq i)
=> x:i
-> s:UStackSet i l a s sd
-> {v:UStackSet i l a s sd | ( ((TagMember x s) => (EqTag x v)) && (EqEltsStackSet s v) && (((EqTag x s) || (not (TagMember x s))) => (v = s))) }
@-}
| 1,436
| true
| true
| 0
| 13
| 676
| 322
| 176
| 146
| null | null |
takenobu-hs/processor-creative-kit
|
Language/Pck/Tool/Debugger.hs
|
bsd-3-clause
|
----------------------------------------
-- driver
----------------------------------------
-- | debugging run
--
-- Example: run with a break condition. (break at pc == 1)
--
-- > > runDbg [] [(BrkPc BEQ 1)] [(0,[MOVI R0 7, MOVI R1 8, HALT])] []
-- > pc : 1
-- > gr : [7,0,0,0,0,0,0,0]
-- > fl : [False,False]
--
--
-- Example: run with trace output. (instruction trace)
--
-- > > runDbg [TrcInst] [] [(0,[MOVI R0 7, MOVI R1 8, HALT])] []
-- > TrcInst: pc : 0 MOVI R0 7
-- >
-- > TrcInst: pc : 1 MOVI R1 8
-- >
-- > TrcInst: pc : 2 HALT
--
runDbg :: [DbgTrc] -> [DbgBrk] -> InstImage -> DataImage -> (TrcLog, CpuState)
runDbg dbgtrc dbgbrk insts vals = runState (evalProgDbg dbgtrc dbgbrk)
(initCpuStateMem insts vals)
| 792
|
runDbg :: [DbgTrc] -> [DbgBrk] -> InstImage -> DataImage -> (TrcLog, CpuState)
runDbg dbgtrc dbgbrk insts vals = runState (evalProgDbg dbgtrc dbgbrk)
(initCpuStateMem insts vals)
| 214
|
runDbg dbgtrc dbgbrk insts vals = runState (evalProgDbg dbgtrc dbgbrk)
(initCpuStateMem insts vals)
| 135
| true
| true
| 0
| 9
| 205
| 91
| 58
| 33
| null | null |
Bolpat/CardGames
|
src/Watten/Help.hs
|
gpl-3.0
|
helpPlaying = "WIE MAN SPIELT\n \
\Einfach den Anweisungen folgen."
| 81
|
helpPlaying = "WIE MAN SPIELT\n \
\Einfach den Anweisungen folgen."
| 81
|
helpPlaying = "WIE MAN SPIELT\n \
\Einfach den Anweisungen folgen."
| 81
| false
| false
| 0
| 4
| 23
| 6
| 3
| 3
| null | null |
markus-git/imperative-edsl-vhdl
|
src/Language/Embedded/VHDL/Monad.hs
|
bsd-3-clause
|
signal :: MonadV m => Identifier -> Mode -> SubtypeIndication -> Maybe Expression -> m ()
signal i m t e = addSignal $ InterfaceSignalDeclaration [i] (Just m) t False e
| 168
|
signal :: MonadV m => Identifier -> Mode -> SubtypeIndication -> Maybe Expression -> m ()
signal i m t e = addSignal $ InterfaceSignalDeclaration [i] (Just m) t False e
| 168
|
signal i m t e = addSignal $ InterfaceSignalDeclaration [i] (Just m) t False e
| 78
| false
| true
| 2
| 12
| 30
| 80
| 37
| 43
| null | null |
chadbrewbaker/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkArithmeticOpCommand1 = verify checkArithmeticOpCommand "i=i + 1"
| 74
|
prop_checkArithmeticOpCommand1 = verify checkArithmeticOpCommand "i=i + 1"
| 74
|
prop_checkArithmeticOpCommand1 = verify checkArithmeticOpCommand "i=i + 1"
| 74
| false
| false
| 0
| 5
| 6
| 11
| 5
| 6
| null | null |
gust/feature-creature
|
legacy/lib/Products/ProductRepo.hs
|
mit
|
getStatusDiff :: P.ProductID -> GitConfig -> WithErr String
getStatusDiff prodID gitConfig =
let repositoryPath = codeRepositoryDir prodID gitConfig
in Git.statusDiff repositoryPath
| 185
|
getStatusDiff :: P.ProductID -> GitConfig -> WithErr String
getStatusDiff prodID gitConfig =
let repositoryPath = codeRepositoryDir prodID gitConfig
in Git.statusDiff repositoryPath
| 185
|
getStatusDiff prodID gitConfig =
let repositoryPath = codeRepositoryDir prodID gitConfig
in Git.statusDiff repositoryPath
| 125
| false
| true
| 0
| 9
| 24
| 50
| 23
| 27
| null | null |
jkozlowski/kdb-haskell
|
src/Database/Kdb/Internal/Types/KdbTypes.hs
|
mit
|
numElements (A _) = undefined
| 43
|
numElements (A _) = undefined
| 43
|
numElements (A _) = undefined
| 43
| false
| false
| 0
| 7
| 18
| 15
| 7
| 8
| null | null |
jgm/citeproc
|
src/Citeproc/CaseTransform.hs
|
bsd-2-clause
|
isStopWord "an" = True
| 22
|
isStopWord "an" = True
| 22
|
isStopWord "an" = True
| 22
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
gibiansky/nvim-hs
|
test-suite/Neovim/Plugin/ConfigHelperSpec.hs
|
apache-2.0
|
isLeft _ = False
| 23
|
isLeft _ = False
| 23
|
isLeft _ = False
| 23
| false
| false
| 0
| 4
| 10
| 10
| 4
| 6
| null | null |
vulgr/vulgr
|
src/Graph/UniqueNodeGraph.hs
|
bsd-3-clause
|
-- | Convenience method to pretty print the graph.
--
pretty :: UniqueNodeGraph NodeData RelationData -> T.Text
pretty g = T.pack . prettify $ extract g
| 152
|
pretty :: UniqueNodeGraph NodeData RelationData -> T.Text
pretty g = T.pack . prettify $ extract g
| 98
|
pretty g = T.pack . prettify $ extract g
| 40
| true
| true
| 1
| 8
| 25
| 46
| 21
| 25
| null | null |
caioariede/tpll
|
src/Tpll/Parser.hs
|
mit
|
-- | Render a block
--
-- Examples:
--
-- >>> let ctx1 = ctx [("foo", cStr "abc")]
-- >>> let ctx2 = ctx [("foo", cStr "def")]
-- >>>
-- >>> let tags' = tags [] []
-- >>> --- let tokens = [Variable { content = "foo", line = 1, raw = "{{ foo }}" }]
-- >>> let tokens = [Text { content = "\n", line = 1, raw = "" }, Variable { content = "foo", line = 1, raw = "{{ foo }}" }]
-- >>>
-- >>> renderBlock [ctx1, ctx2] tags' tokens []
-- "\nabc\ndef"
renderBlock :: [Context] -> Tags -> [Token] -> [IO String] -> IO String
renderBlock [] _ _ acc =
foldl1 (liftM2 (++)) acc
| 569
|
renderBlock :: [Context] -> Tags -> [Token] -> [IO String] -> IO String
renderBlock [] _ _ acc =
foldl1 (liftM2 (++)) acc
| 125
|
renderBlock [] _ _ acc =
foldl1 (liftM2 (++)) acc
| 53
| true
| true
| 0
| 10
| 126
| 79
| 47
| 32
| null | null |
haskell/haddock
|
haddock-api/src/Haddock/Options.hs
|
bsd-2-clause
|
optIndexUrl :: [Flag] -> Maybe String
optIndexUrl flags = optLast [ url | Flag_UseIndex url <- flags ]
| 102
|
optIndexUrl :: [Flag] -> Maybe String
optIndexUrl flags = optLast [ url | Flag_UseIndex url <- flags ]
| 102
|
optIndexUrl flags = optLast [ url | Flag_UseIndex url <- flags ]
| 64
| false
| true
| 0
| 9
| 17
| 41
| 20
| 21
| null | null |
christiaanb/clash-tryout
|
src/CLaSH/Normalize/Transformations.hs
|
bsd-3-clause
|
bindNonRep :: NormalizeStep
bindNonRep = inlineBinders ("bindNonRep") (isUntranslatable . fst)
| 94
|
bindNonRep :: NormalizeStep
bindNonRep = inlineBinders ("bindNonRep") (isUntranslatable . fst)
| 94
|
bindNonRep = inlineBinders ("bindNonRep") (isUntranslatable . fst)
| 66
| false
| true
| 0
| 7
| 9
| 26
| 14
| 12
| null | null |
nfjinjing/level5
|
src/MusicPad/Type/Music.hs
|
bsd-3-clause
|
rest d = Prim (Rest d)
| 30
|
rest d = Prim (Rest d)
| 30
|
rest d = Prim (Rest d)
| 30
| false
| false
| 1
| 7
| 13
| 21
| 8
| 13
| null | null |
paul-rouse/persistent
|
persistent-mongoDB/Database/Persist/MongoDB.hs
|
mit
|
projectionFromKey :: PersistEntity record => Key record -> DB.Projector
projectionFromKey = projectionFromEntityDef . entityDefFromKey
| 134
|
projectionFromKey :: PersistEntity record => Key record -> DB.Projector
projectionFromKey = projectionFromEntityDef . entityDefFromKey
| 134
|
projectionFromKey = projectionFromEntityDef . entityDefFromKey
| 62
| false
| true
| 0
| 7
| 13
| 31
| 15
| 16
| null | null |
GaloisInc/halvm-ghc
|
compiler/codeGen/StgCmmUtils.hs
|
bsd-3-clause
|
emitRODataLits :: CLabel -> [CmmLit] -> FCode ()
-- Emit a read-only data block
emitRODataLits lbl lits = emitDecl (mkRODataLits lbl lits)
| 138
|
emitRODataLits :: CLabel -> [CmmLit] -> FCode ()
emitRODataLits lbl lits = emitDecl (mkRODataLits lbl lits)
| 107
|
emitRODataLits lbl lits = emitDecl (mkRODataLits lbl lits)
| 58
| true
| true
| 0
| 8
| 21
| 44
| 22
| 22
| null | null |
brendanhay/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/NodeGroups/DeleteNodes.hs
|
mpl-2.0
|
-- | Creates a value of 'NodeGroupsDeleteNodes' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ngdnRequestId'
--
-- * 'ngdnNodeGroup'
--
-- * 'ngdnProject'
--
-- * 'ngdnZone'
--
-- * 'ngdnPayload'
nodeGroupsDeleteNodes
:: Text -- ^ 'ngdnNodeGroup'
-> Text -- ^ 'ngdnProject'
-> Text -- ^ 'ngdnZone'
-> NodeGroupsDeleteNodesRequest -- ^ 'ngdnPayload'
-> NodeGroupsDeleteNodes
nodeGroupsDeleteNodes pNgdnNodeGroup_ pNgdnProject_ pNgdnZone_ pNgdnPayload_ =
NodeGroupsDeleteNodes'
{ _ngdnRequestId = Nothing
, _ngdnNodeGroup = pNgdnNodeGroup_
, _ngdnProject = pNgdnProject_
, _ngdnZone = pNgdnZone_
, _ngdnPayload = pNgdnPayload_
}
| 760
|
nodeGroupsDeleteNodes
:: Text -- ^ 'ngdnNodeGroup'
-> Text -- ^ 'ngdnProject'
-> Text -- ^ 'ngdnZone'
-> NodeGroupsDeleteNodesRequest -- ^ 'ngdnPayload'
-> NodeGroupsDeleteNodes
nodeGroupsDeleteNodes pNgdnNodeGroup_ pNgdnProject_ pNgdnZone_ pNgdnPayload_ =
NodeGroupsDeleteNodes'
{ _ngdnRequestId = Nothing
, _ngdnNodeGroup = pNgdnNodeGroup_
, _ngdnProject = pNgdnProject_
, _ngdnZone = pNgdnZone_
, _ngdnPayload = pNgdnPayload_
}
| 476
|
nodeGroupsDeleteNodes pNgdnNodeGroup_ pNgdnProject_ pNgdnZone_ pNgdnPayload_ =
NodeGroupsDeleteNodes'
{ _ngdnRequestId = Nothing
, _ngdnNodeGroup = pNgdnNodeGroup_
, _ngdnProject = pNgdnProject_
, _ngdnZone = pNgdnZone_
, _ngdnPayload = pNgdnPayload_
}
| 278
| true
| true
| 0
| 10
| 146
| 94
| 58
| 36
| null | null |
mdsteele/fallback
|
src/Fallback/State/FOV.hs
|
gpl-3.0
|
pointNextAt :: ViewLink s -> Either (ViewList s) (View s) -> ST s ()
pointNextAt vlink target =
(either vlistFirst viewNext <$> readSTRef vlink) >>= flip writeSTRef target
| 173
|
pointNextAt :: ViewLink s -> Either (ViewList s) (View s) -> ST s ()
pointNextAt vlink target =
(either vlistFirst viewNext <$> readSTRef vlink) >>= flip writeSTRef target
| 173
|
pointNextAt vlink target =
(either vlistFirst viewNext <$> readSTRef vlink) >>= flip writeSTRef target
| 104
| false
| true
| 0
| 9
| 29
| 75
| 35
| 40
| null | null |
ducis/haAni
|
hs/common/Graphics/Rendering/OpenGL/GLU/Quadrics.hs
|
gpl-2.0
|
renderPrimitive quadricObj (Disk i o s l) =
gluDisk quadricObj i o s l
| 73
|
renderPrimitive quadricObj (Disk i o s l) =
gluDisk quadricObj i o s l
| 73
|
renderPrimitive quadricObj (Disk i o s l) =
gluDisk quadricObj i o s l
| 73
| false
| false
| 0
| 7
| 16
| 34
| 16
| 18
| null | null |
oldmanmike/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
matchSeparator IfAlt = text "->"
| 39
|
matchSeparator IfAlt = text "->"
| 39
|
matchSeparator IfAlt = text "->"
| 39
| false
| false
| 0
| 5
| 11
| 12
| 5
| 7
| null | null |
agentm/project-m36
|
src/bin/benchmark/Handles.hs
|
unlicense
|
parseTransactionCount :: Parser Int
parseTransactionCount = option auto (short 't' <> long "transaction-count")
| 111
|
parseTransactionCount :: Parser Int
parseTransactionCount = option auto (short 't' <> long "transaction-count")
| 111
|
parseTransactionCount = option auto (short 't' <> long "transaction-count")
| 75
| false
| true
| 0
| 8
| 12
| 32
| 15
| 17
| null | null |
chrisnc/tangaroa
|
src/Network/Tangaroa/Byzantine/Spec/Simple.hs
|
bsd-3-clause
|
cfgFold :: [a -> IO a] -> a -> IO a
cfgFold [] x = return x
| 59
|
cfgFold :: [a -> IO a] -> a -> IO a
cfgFold [] x = return x
| 59
|
cfgFold [] x = return x
| 23
| false
| true
| 0
| 8
| 16
| 42
| 20
| 22
| null | null |
dmbarbour/awelon
|
hsrc_util/ABCGraph.hs
|
bsd-3-clause
|
runOp Op_neg = opNeg
| 20
|
runOp Op_neg = opNeg
| 20
|
runOp Op_neg = opNeg
| 20
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
dysinger/amazonka
|
amazonka-s3/gen/Network/AWS/S3/PutObject.hs
|
mpl-2.0
|
-- | The type of storage to use for the object. Defaults to 'STANDARD'.
poStorageClass :: Lens' PutObject (Maybe StorageClass)
poStorageClass = lens _poStorageClass (\s a -> s { _poStorageClass = a })
| 200
|
poStorageClass :: Lens' PutObject (Maybe StorageClass)
poStorageClass = lens _poStorageClass (\s a -> s { _poStorageClass = a })
| 128
|
poStorageClass = lens _poStorageClass (\s a -> s { _poStorageClass = a })
| 73
| true
| true
| 0
| 9
| 32
| 46
| 25
| 21
| null | null |
pascal-knodel/haskell-craft
|
_/links/E'7'26.hs
|
mit
|
-- QuickCheck tests for "isSubsequnce" (ex. 7.25):
prop_isSubsequence :: String -> String -> Bool
prop_isSubsequence potentialSubstring string
= Data.List.isInfixOf potentialSubstring string == isSubsequence potentialSubstring string
| 238
|
prop_isSubsequence :: String -> String -> Bool
prop_isSubsequence potentialSubstring string
= Data.List.isInfixOf potentialSubstring string == isSubsequence potentialSubstring string
| 185
|
prop_isSubsequence potentialSubstring string
= Data.List.isInfixOf potentialSubstring string == isSubsequence potentialSubstring string
| 138
| true
| true
| 0
| 7
| 29
| 42
| 21
| 21
| null | null |
ghc-android/ghc
|
compiler/nativeGen/RegAlloc/Linear/Main.hs
|
bsd-3-clause
|
regAlloc _ (CmmProc _ _ _ _)
= panic "RegAllocLinear.regAlloc: no match"
| 80
|
regAlloc _ (CmmProc _ _ _ _)
= panic "RegAllocLinear.regAlloc: no match"
| 80
|
regAlloc _ (CmmProc _ _ _ _)
= panic "RegAllocLinear.regAlloc: no match"
| 80
| false
| false
| 0
| 7
| 19
| 26
| 12
| 14
| null | null |
Proclivis/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_ADA_WORD :: Int
wxSTC_ADA_WORD = 1
| 40
|
wxSTC_ADA_WORD :: Int
wxSTC_ADA_WORD = 1
| 40
|
wxSTC_ADA_WORD = 1
| 18
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
ghcjs/ghcjs
|
src-bin/Boot.hs
|
mit
|
bootConfigFile :: BootSettings -> IO B.ByteString
bootConfigFile bs = do
sourceDir <- bootSourceDir bs
let sourceDir' = sourceDir
e <- doesFileExist sourceDir'
if e then do -- it's a tar file
entries <- Tar.read . BL.fromStrict <$>
B.readFile sourceDir'
pure (BL.toStrict $ getBootYaml entries)
else B.readFile (sourceDir </> "boot" <.> "yaml")
where
getBootYaml (Tar.Next e es)
| Tar.entryPath e == "boot/boot.yaml"
, Tar.NormalFile contents _size <- Tar.entryContent e = contents
| otherwise = getBootYaml es
getBootYaml Tar.Done = error "boot/boot.yaml file not found in archive"
getBootYaml (Tar.Fail e) = error $ "error reading boot archive: " ++ show e
| 738
|
bootConfigFile :: BootSettings -> IO B.ByteString
bootConfigFile bs = do
sourceDir <- bootSourceDir bs
let sourceDir' = sourceDir
e <- doesFileExist sourceDir'
if e then do -- it's a tar file
entries <- Tar.read . BL.fromStrict <$>
B.readFile sourceDir'
pure (BL.toStrict $ getBootYaml entries)
else B.readFile (sourceDir </> "boot" <.> "yaml")
where
getBootYaml (Tar.Next e es)
| Tar.entryPath e == "boot/boot.yaml"
, Tar.NormalFile contents _size <- Tar.entryContent e = contents
| otherwise = getBootYaml es
getBootYaml Tar.Done = error "boot/boot.yaml file not found in archive"
getBootYaml (Tar.Fail e) = error $ "error reading boot archive: " ++ show e
| 738
|
bootConfigFile bs = do
sourceDir <- bootSourceDir bs
let sourceDir' = sourceDir
e <- doesFileExist sourceDir'
if e then do -- it's a tar file
entries <- Tar.read . BL.fromStrict <$>
B.readFile sourceDir'
pure (BL.toStrict $ getBootYaml entries)
else B.readFile (sourceDir </> "boot" <.> "yaml")
where
getBootYaml (Tar.Next e es)
| Tar.entryPath e == "boot/boot.yaml"
, Tar.NormalFile contents _size <- Tar.entryContent e = contents
| otherwise = getBootYaml es
getBootYaml Tar.Done = error "boot/boot.yaml file not found in archive"
getBootYaml (Tar.Fail e) = error $ "error reading boot archive: " ++ show e
| 688
| false
| true
| 2
| 13
| 178
| 228
| 106
| 122
| null | null |
vikraman/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
binderVar e (Anon t) = pprPanic ("binderVar (" ++ e ++ ")") (ppr t)
| 70
|
binderVar e (Anon t) = pprPanic ("binderVar (" ++ e ++ ")") (ppr t)
| 70
|
binderVar e (Anon t) = pprPanic ("binderVar (" ++ e ++ ")") (ppr t)
| 70
| false
| false
| 0
| 8
| 16
| 41
| 19
| 22
| null | null |
lostbean/sledge
|
test/TestSampler.hs
|
gpl-3.0
|
testSampFit :: Int -> IO ()
testSampFit n = let
da1 = (1, mkQuaternion (Vec4 0 0 1 0))
da2 = (10, mkQuaternion (Vec4 0 1 0 0))
da3 = (10, mkQuaternion (Vec4 1 0 0 1))
din = mkBingham da1 da2 da3
in do
xs <- hitAndRunSlice defaultCfg (binghamPDF din) (mempty) n
let dout = fitBingham (U.fromList xs)
writeQuater "Bing-PDF-In-testSamplerQuality" $ renderBingham din
writeQuater "Bing-Samples-testSamplerQuality" $ renderPoints xs
writeQuater "Bing-PDF-Out-testSamplerQuality" $ renderBingham dout
| 527
|
testSampFit :: Int -> IO ()
testSampFit n = let
da1 = (1, mkQuaternion (Vec4 0 0 1 0))
da2 = (10, mkQuaternion (Vec4 0 1 0 0))
da3 = (10, mkQuaternion (Vec4 1 0 0 1))
din = mkBingham da1 da2 da3
in do
xs <- hitAndRunSlice defaultCfg (binghamPDF din) (mempty) n
let dout = fitBingham (U.fromList xs)
writeQuater "Bing-PDF-In-testSamplerQuality" $ renderBingham din
writeQuater "Bing-Samples-testSamplerQuality" $ renderPoints xs
writeQuater "Bing-PDF-Out-testSamplerQuality" $ renderBingham dout
| 527
|
testSampFit n = let
da1 = (1, mkQuaternion (Vec4 0 0 1 0))
da2 = (10, mkQuaternion (Vec4 0 1 0 0))
da3 = (10, mkQuaternion (Vec4 1 0 0 1))
din = mkBingham da1 da2 da3
in do
xs <- hitAndRunSlice defaultCfg (binghamPDF din) (mempty) n
let dout = fitBingham (U.fromList xs)
writeQuater "Bing-PDF-In-testSamplerQuality" $ renderBingham din
writeQuater "Bing-Samples-testSamplerQuality" $ renderPoints xs
writeQuater "Bing-PDF-Out-testSamplerQuality" $ renderBingham dout
| 499
| false
| true
| 0
| 15
| 106
| 203
| 97
| 106
| null | null |
davbaumgartner/LAuREL
|
LAuREL/Types.hs
|
bsd-3-clause
|
funsionLib (Lib ((x@(LibFunction i _ _ _ _)):xs)) (Lib l2) =
funsionLib (Lib xs) (Lib (x:[if i /= j || u == x then u else error "Cannot overwrite function declaration"| u@(LibFunction j _ _ _ _) <- l2]))
| 212
|
funsionLib (Lib ((x@(LibFunction i _ _ _ _)):xs)) (Lib l2) =
funsionLib (Lib xs) (Lib (x:[if i /= j || u == x then u else error "Cannot overwrite function declaration"| u@(LibFunction j _ _ _ _) <- l2]))
| 212
|
funsionLib (Lib ((x@(LibFunction i _ _ _ _)):xs)) (Lib l2) =
funsionLib (Lib xs) (Lib (x:[if i /= j || u == x then u else error "Cannot overwrite function declaration"| u@(LibFunction j _ _ _ _) <- l2]))
| 212
| false
| false
| 1
| 15
| 47
| 133
| 65
| 68
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.