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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LeonardoRigon/TypeInfer-LambdaExpressions-in-Haskell | Parser.hs | mit | numbers = do n <- idNumbers
return (Lit (LInt (fromIntegral n))) | 81 | numbers = do n <- idNumbers
return (Lit (LInt (fromIntegral n))) | 81 | numbers = do n <- idNumbers
return (Lit (LInt (fromIntegral n))) | 81 | false | false | 0 | 13 | 27 | 37 | 17 | 20 | null | null |
WraithM/haskell-opaleye | src/Opaleye/SqlTypes.hs | bsd-3-clause | sqlDay :: Time.Day -> F.Field SqlDate
sqlDay = P.pgDay | 54 | sqlDay :: Time.Day -> F.Field SqlDate
sqlDay = P.pgDay | 54 | sqlDay = P.pgDay | 16 | false | true | 0 | 8 | 8 | 30 | 13 | 17 | null | null |
23Skidoo/aeson | Data/Aeson/TH.hs | bsd-3-clause | parseArgs :: Name -- ^ Name of the type to which the constructor belongs.
-> Options -- ^ Encoding options.
-> Con -- ^ Constructor for which to generate JSON parsing code.
-> Either (String, Name) Name -- ^ Left (valFieldName, objName) or
-- Right valName
-> Q Exp
-- Nullary constructors.
parseArgs tName _ (NormalC conName []) (Left (valFieldName, obj)) =
getValField obj valFieldName $ parseNullaryMatches tName conName | 507 | parseArgs :: Name -- ^ Name of the type to which the constructor belongs.
-> Options -- ^ Encoding options.
-> Con -- ^ Constructor for which to generate JSON parsing code.
-> Either (String, Name) Name -- ^ Left (valFieldName, objName) or
-- Right valName
-> Q Exp
parseArgs tName _ (NormalC conName []) (Left (valFieldName, obj)) =
getValField obj valFieldName $ parseNullaryMatches tName conName | 482 | parseArgs tName _ (NormalC conName []) (Left (valFieldName, obj)) =
getValField obj valFieldName $ parseNullaryMatches tName conName | 134 | true | true | 2 | 13 | 152 | 98 | 50 | 48 | null | null |
cryptica/CodeEval | Challenges/96_SwapCase/main.hs | gpl-3.0 | main :: IO ()
main = do
[inputFile] <- getArgs
input <- readFile inputFile
mapM_ putStrLn $ map processLine $ lines input | 133 | main :: IO ()
main = do
[inputFile] <- getArgs
input <- readFile inputFile
mapM_ putStrLn $ map processLine $ lines input | 133 | main = do
[inputFile] <- getArgs
input <- readFile inputFile
mapM_ putStrLn $ map processLine $ lines input | 119 | false | true | 0 | 9 | 33 | 56 | 25 | 31 | null | null |
forste/haReFork | tools/base/parse2/Parser/PosSyntax.hs | bsd-3-clause | is_unit_tycon_name n = n==unit_tycon_name undefined | 51 | is_unit_tycon_name n = n==unit_tycon_name undefined | 51 | is_unit_tycon_name n = n==unit_tycon_name undefined | 51 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
danr/hipspec | examples/old-examples/hip/ZenoLists.hs | gpl-3.0 | take _ [] = [] | 14 | take _ [] = [] | 14 | take _ [] = [] | 14 | false | false | 0 | 6 | 4 | 19 | 8 | 11 | null | null |
shayan-najd/HsParser | Lexeme.hs | gpl-3.0 | okTcOcc str@(c:_)
| startsConId c
= okConIdOcc str
| startsConSym c
= okConSymOcc str
| startsVarSym c
= okVarSymOcc str | 132 | okTcOcc str@(c:_)
| startsConId c
= okConIdOcc str
| startsConSym c
= okConSymOcc str
| startsVarSym c
= okVarSymOcc str | 132 | okTcOcc str@(c:_)
| startsConId c
= okConIdOcc str
| startsConSym c
= okConSymOcc str
| startsVarSym c
= okVarSymOcc str | 132 | false | false | 2 | 8 | 31 | 58 | 26 | 32 | null | null |
taktoa/TSLogAnalyzer | library/Utility/TSLogAnalyzer/Util.hs | gpl-3.0 | space = A.char ' ' | 24 | space = A.char ' ' | 24 | space = A.char ' ' | 24 | false | false | 1 | 5 | 10 | 15 | 5 | 10 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp ReadJCharArrayOp = _ILIT(1120) | 43 | tagOf_PrimOp ReadJCharArrayOp = _ILIT(1120) | 43 | tagOf_PrimOp ReadJCharArrayOp = _ILIT(1120) | 43 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
kyren/hsgb | spec/Gameboy/AssemblerSpec.hs | unlicense | testParsing :: Spec
testParsing = it "handles blank lines and comments and spacing" $
assemblyMatches
[here|
LD B,$ff; comment
LD C, (HL)
; comment
|]
[
LD_R_N BRegister 0xff,
LD_R_ATHL CRegister
] | 250 | testParsing :: Spec
testParsing = it "handles blank lines and comments and spacing" $
assemblyMatches
[here|
LD B,$ff; comment
LD C, (HL)
; comment
|]
[
LD_R_N BRegister 0xff,
LD_R_ATHL CRegister
] | 250 | testParsing = it "handles blank lines and comments and spacing" $
assemblyMatches
[here|
LD B,$ff; comment
LD C, (HL)
; comment
|]
[
LD_R_N BRegister 0xff,
LD_R_ATHL CRegister
] | 230 | false | true | 0 | 6 | 84 | 42 | 22 | 20 | null | null |
MaKToff/SPbSU_Homeworks | Semester 3/Homework 3/Homework3.hs | mit | to_list (E first second) = (to_list first) ++ (to_list second) | 62 | to_list (E first second) = (to_list first) ++ (to_list second) | 62 | to_list (E first second) = (to_list first) ++ (to_list second) | 62 | false | false | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
copton/hgdbmi | src/Gdbmi/Commands.hs | bsd-3-clause | targetOptions (Sim xs) = map opt xs | 35 | targetOptions (Sim xs) = map opt xs | 35 | targetOptions (Sim xs) = map opt xs | 35 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
Orvid/fbthrift | thrift/lib/hs/Thrift/Protocol/Binary.hs | apache-2.0 | parseBinaryValue T_STRING = do
i :: Int32 <- Binary.decode . LBS.fromStrict <$> P.take 4
TString . LBS.fromStrict <$> P.take (fromIntegral i) | 146 | parseBinaryValue T_STRING = do
i :: Int32 <- Binary.decode . LBS.fromStrict <$> P.take 4
TString . LBS.fromStrict <$> P.take (fromIntegral i) | 146 | parseBinaryValue T_STRING = do
i :: Int32 <- Binary.decode . LBS.fromStrict <$> P.take 4
TString . LBS.fromStrict <$> P.take (fromIntegral i) | 146 | false | false | 0 | 10 | 25 | 61 | 28 | 33 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Spanner/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'PartitionReadRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'prrPartitionOptions'
--
-- * 'prrKeySet'
--
-- * 'prrTransaction'
--
-- * 'prrColumns'
--
-- * 'prrIndex'
--
-- * 'prrTable'
partitionReadRequest
:: PartitionReadRequest
partitionReadRequest =
PartitionReadRequest'
{ _prrPartitionOptions = Nothing
, _prrKeySet = Nothing
, _prrTransaction = Nothing
, _prrColumns = Nothing
, _prrIndex = Nothing
, _prrTable = Nothing
} | 583 | partitionReadRequest
:: PartitionReadRequest
partitionReadRequest =
PartitionReadRequest'
{ _prrPartitionOptions = Nothing
, _prrKeySet = Nothing
, _prrTransaction = Nothing
, _prrColumns = Nothing
, _prrIndex = Nothing
, _prrTable = Nothing
} | 277 | partitionReadRequest =
PartitionReadRequest'
{ _prrPartitionOptions = Nothing
, _prrKeySet = Nothing
, _prrTransaction = Nothing
, _prrColumns = Nothing
, _prrIndex = Nothing
, _prrTable = Nothing
} | 228 | true | true | 0 | 7 | 118 | 74 | 48 | 26 | null | null |
jsnajder/confusion-matrix | src/Statistics/ConfusionMatrix.hs | bsd-3-clause | matrixSum :: (Num a) => [[a]] -> a
matrixSum = sum . map sum | 60 | matrixSum :: (Num a) => [[a]] -> a
matrixSum = sum . map sum | 60 | matrixSum = sum . map sum | 25 | false | true | 0 | 8 | 13 | 37 | 20 | 17 | null | null |
kumasento/accelerate | Data/Array/Accelerate/Analysis/Match.hs | bsd-3-clause | matchPrimFun' (PrimAsin _) (PrimAsin _) = Just REFL | 71 | matchPrimFun' (PrimAsin _) (PrimAsin _) = Just REFL | 71 | matchPrimFun' (PrimAsin _) (PrimAsin _) = Just REFL | 71 | false | false | 0 | 7 | 27 | 26 | 12 | 14 | null | null |
cchens/courseography | hs/WebParsing/TimeTableParser.hs | gpl-3.0 | -- | takes in cells representing a course, and recursively places lecture and tutorial info
-- into courseSlots.
parseCourse :: [[T.Text]] -> Maybe CourseSlot -> [Maybe CourseSlot] -> [Maybe CourseSlot]
parseCourse [] slot slots = slot:slots | 241 | parseCourse :: [[T.Text]] -> Maybe CourseSlot -> [Maybe CourseSlot] -> [Maybe CourseSlot]
parseCourse [] slot slots = slot:slots | 128 | parseCourse [] slot slots = slot:slots | 38 | true | true | 0 | 9 | 35 | 61 | 32 | 29 | null | null |
puffnfresh/blimp | Blimp/Main.hs | mit | compileExp (Con c) = compileCon c | 33 | compileExp (Con c) = compileCon c | 33 | compileExp (Con c) = compileCon c | 33 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
mhwombat/creatur-wains-iomha | src/ALife/Creatur/Wain/Iomha/Experiment.hs | bsd-3-clause | chooseAction3
:: ImageWain -> Object -> Object
-> StateT (U.Universe ImageWain) IO
(UIDouble, Int, UIDouble, Int, Response Action, ImageWain)
chooseAction3 w dObj iObj = do
U.writeToLog $ agentId w ++ " sees " ++ O.objectId dObj
++ " and " ++ O.objectId iObj
whenM (use U.uShowPredictorModels)
(mapM_ U.writeToLog . IW.describePredictorModels $ w)
let (lds, sps, rplos, aos, r, w')
= W.chooseAction
[O.objectAppearance dObj, O.objectAppearance iObj] w
let (_, dObjNovelty, dObjNoveltyAdj,
_, iObjNovelty, iObjNoveltyAdj)
= analyseClassification lds w
whenM (use U.uGenFmris)
(mapM_ U.writeToLog . IW.describeClassifierModels $ w)
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId dObj ++ " has novelty " ++ show dObjNovelty
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId iObj ++ " has novelty " ++ show iObjNovelty
whenM (use U.uShowPredictions) $ do
mapM_ U.writeToLog $ scenarioReport sps
mapM_ U.writeToLog $ responseReport rplos
mapM_ U.writeToLog $ decisionReport aos
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId dObj ++ " has adjusted novelty " ++ show dObjNoveltyAdj
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId iObj ++ " has adjusted novelty " ++ show iObjNoveltyAdj
U.writeToLog $ agentId w ++ " sees " ++ O.objectId dObj
++ " and chooses to " ++ show (_action r)
++ " predicting the outcomes " ++ show (_outcomes r)
return (dObjNovelty, dObjNoveltyAdj, iObjNovelty, iObjNoveltyAdj, r, w') | 1,559 | chooseAction3
:: ImageWain -> Object -> Object
-> StateT (U.Universe ImageWain) IO
(UIDouble, Int, UIDouble, Int, Response Action, ImageWain)
chooseAction3 w dObj iObj = do
U.writeToLog $ agentId w ++ " sees " ++ O.objectId dObj
++ " and " ++ O.objectId iObj
whenM (use U.uShowPredictorModels)
(mapM_ U.writeToLog . IW.describePredictorModels $ w)
let (lds, sps, rplos, aos, r, w')
= W.chooseAction
[O.objectAppearance dObj, O.objectAppearance iObj] w
let (_, dObjNovelty, dObjNoveltyAdj,
_, iObjNovelty, iObjNoveltyAdj)
= analyseClassification lds w
whenM (use U.uGenFmris)
(mapM_ U.writeToLog . IW.describeClassifierModels $ w)
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId dObj ++ " has novelty " ++ show dObjNovelty
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId iObj ++ " has novelty " ++ show iObjNovelty
whenM (use U.uShowPredictions) $ do
mapM_ U.writeToLog $ scenarioReport sps
mapM_ U.writeToLog $ responseReport rplos
mapM_ U.writeToLog $ decisionReport aos
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId dObj ++ " has adjusted novelty " ++ show dObjNoveltyAdj
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId iObj ++ " has adjusted novelty " ++ show iObjNoveltyAdj
U.writeToLog $ agentId w ++ " sees " ++ O.objectId dObj
++ " and chooses to " ++ show (_action r)
++ " predicting the outcomes " ++ show (_outcomes r)
return (dObjNovelty, dObjNoveltyAdj, iObjNovelty, iObjNoveltyAdj, r, w') | 1,559 | chooseAction3 w dObj iObj = do
U.writeToLog $ agentId w ++ " sees " ++ O.objectId dObj
++ " and " ++ O.objectId iObj
whenM (use U.uShowPredictorModels)
(mapM_ U.writeToLog . IW.describePredictorModels $ w)
let (lds, sps, rplos, aos, r, w')
= W.chooseAction
[O.objectAppearance dObj, O.objectAppearance iObj] w
let (_, dObjNovelty, dObjNoveltyAdj,
_, iObjNovelty, iObjNoveltyAdj)
= analyseClassification lds w
whenM (use U.uGenFmris)
(mapM_ U.writeToLog . IW.describeClassifierModels $ w)
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId dObj ++ " has novelty " ++ show dObjNovelty
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId iObj ++ " has novelty " ++ show iObjNovelty
whenM (use U.uShowPredictions) $ do
mapM_ U.writeToLog $ scenarioReport sps
mapM_ U.writeToLog $ responseReport rplos
mapM_ U.writeToLog $ decisionReport aos
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId dObj ++ " has adjusted novelty " ++ show dObjNoveltyAdj
U.writeToLog $ "To " ++ agentId w ++ ", "
++ O.objectId iObj ++ " has adjusted novelty " ++ show iObjNoveltyAdj
U.writeToLog $ agentId w ++ " sees " ++ O.objectId dObj
++ " and chooses to " ++ show (_action r)
++ " predicting the outcomes " ++ show (_outcomes r)
return (dObjNovelty, dObjNoveltyAdj, iObjNovelty, iObjNoveltyAdj, r, w') | 1,403 | false | true | 0 | 15 | 353 | 566 | 269 | 297 | null | null |
kmilner/tamarin-prover | src/Web/Theory.hs | gpl-3.0 | isInterestingDiffMethod _ = False | 45 | isInterestingDiffMethod _ = False | 45 | isInterestingDiffMethod _ = False | 45 | false | false | 0 | 4 | 15 | 10 | 4 | 6 | null | null |
ejlilley/AbstractMusic | Canon.hs | gpl-3.0 | p4rhythms = (take 14 $ repeat quaver) ++ [dotted quaver, semiquaver] | 68 | p4rhythms = (take 14 $ repeat quaver) ++ [dotted quaver, semiquaver] | 68 | p4rhythms = (take 14 $ repeat quaver) ++ [dotted quaver, semiquaver] | 68 | false | false | 0 | 8 | 10 | 32 | 16 | 16 | null | null |
sarahn/ganeti | src/Ganeti/HTools/Program/Hspace.hs | gpl-2.0 | printISpec False ispec spec disk_template =
printf "%s instance spec is:\n %s, using disk\
\ template '%s'.\n"
(specDescription spec)
(formatResources ispec specData) (diskTemplateToRaw disk_template) | 230 | printISpec False ispec spec disk_template =
printf "%s instance spec is:\n %s, using disk\
\ template '%s'.\n"
(specDescription spec)
(formatResources ispec specData) (diskTemplateToRaw disk_template) | 230 | printISpec False ispec spec disk_template =
printf "%s instance spec is:\n %s, using disk\
\ template '%s'.\n"
(specDescription spec)
(formatResources ispec specData) (diskTemplateToRaw disk_template) | 230 | false | false | 0 | 7 | 53 | 44 | 21 | 23 | null | null |
prasmussen/magmod | Magento/Module/Path.hs | mit | codeRootPath :: ModuleInfo -> FilePath
codeRootPath info =
joinPath [takeDirectory $ getConfigXml info, ".."] | 113 | codeRootPath :: ModuleInfo -> FilePath
codeRootPath info =
joinPath [takeDirectory $ getConfigXml info, ".."] | 113 | codeRootPath info =
joinPath [takeDirectory $ getConfigXml info, ".."] | 74 | false | true | 0 | 8 | 17 | 34 | 17 | 17 | null | null |
NicolasT/kontiki | bin/udp.hs | bsd-3-clause | handleCommand :: PlumbingState -> Command Value -> IO PlumbingState
handleCommand s c = case c of
CBroadcast m -> do
putStrLn $ "CBroadcast: " ++ show m
atomically $ mapM_ (flip RollingQueue.write m) (Map.elems $ psChannels s)
return s
CSend n m -> do
putStrLn $ "CSend: " ++ show n ++ " -> " ++ show m
case Map.lookup n (psChannels s) of
Nothing -> putStrLn "Unknown node?!"
Just q -> atomically $ RollingQueue.write q m
return s
CResetElectionTimeout a b -> do
t <- randomRIO (a, b)
putStrLn $ "Reset election timeout: " ++ show t
Timer.reset (psElectionTimer s) t
return s
CResetHeartbeatTimeout a -> do
putStrLn $ "Reset heartbeat timeout: " ++ show a
Timer.reset (psHeartbeatTimer s) a
return s
CLog b -> do
let m = LBS8.unpack $ Builder.toLazyByteString b
putStrLn $ "Log: " ++ m
return s
CTruncateLog i -> do
putStrLn $ "Truncate: " ++ show i
let l = psLog s
i' = fromIntegral $ unIndex i
l' = IntMap.filterWithKey (\k _ -> k <= i') l
return $ s { psLog = l' }
CLogEntries es -> do
putStrLn $ "Log entries: " ++ show es
let l = psLog s
l' = foldr (\e -> MemLog.insert (fromIntegral $ unIndex $ eIndex e) e) l es
return $ s { psLog = l' }
CSetCommitIndex i' -> do
let i = psCommitIndex s
putStrLn $ "New commit index, to commit: " ++ entriesToCommit i i'
return $ s { psCommitIndex = i' } | 1,586 | handleCommand :: PlumbingState -> Command Value -> IO PlumbingState
handleCommand s c = case c of
CBroadcast m -> do
putStrLn $ "CBroadcast: " ++ show m
atomically $ mapM_ (flip RollingQueue.write m) (Map.elems $ psChannels s)
return s
CSend n m -> do
putStrLn $ "CSend: " ++ show n ++ " -> " ++ show m
case Map.lookup n (psChannels s) of
Nothing -> putStrLn "Unknown node?!"
Just q -> atomically $ RollingQueue.write q m
return s
CResetElectionTimeout a b -> do
t <- randomRIO (a, b)
putStrLn $ "Reset election timeout: " ++ show t
Timer.reset (psElectionTimer s) t
return s
CResetHeartbeatTimeout a -> do
putStrLn $ "Reset heartbeat timeout: " ++ show a
Timer.reset (psHeartbeatTimer s) a
return s
CLog b -> do
let m = LBS8.unpack $ Builder.toLazyByteString b
putStrLn $ "Log: " ++ m
return s
CTruncateLog i -> do
putStrLn $ "Truncate: " ++ show i
let l = psLog s
i' = fromIntegral $ unIndex i
l' = IntMap.filterWithKey (\k _ -> k <= i') l
return $ s { psLog = l' }
CLogEntries es -> do
putStrLn $ "Log entries: " ++ show es
let l = psLog s
l' = foldr (\e -> MemLog.insert (fromIntegral $ unIndex $ eIndex e) e) l es
return $ s { psLog = l' }
CSetCommitIndex i' -> do
let i = psCommitIndex s
putStrLn $ "New commit index, to commit: " ++ entriesToCommit i i'
return $ s { psCommitIndex = i' } | 1,586 | handleCommand s c = case c of
CBroadcast m -> do
putStrLn $ "CBroadcast: " ++ show m
atomically $ mapM_ (flip RollingQueue.write m) (Map.elems $ psChannels s)
return s
CSend n m -> do
putStrLn $ "CSend: " ++ show n ++ " -> " ++ show m
case Map.lookup n (psChannels s) of
Nothing -> putStrLn "Unknown node?!"
Just q -> atomically $ RollingQueue.write q m
return s
CResetElectionTimeout a b -> do
t <- randomRIO (a, b)
putStrLn $ "Reset election timeout: " ++ show t
Timer.reset (psElectionTimer s) t
return s
CResetHeartbeatTimeout a -> do
putStrLn $ "Reset heartbeat timeout: " ++ show a
Timer.reset (psHeartbeatTimer s) a
return s
CLog b -> do
let m = LBS8.unpack $ Builder.toLazyByteString b
putStrLn $ "Log: " ++ m
return s
CTruncateLog i -> do
putStrLn $ "Truncate: " ++ show i
let l = psLog s
i' = fromIntegral $ unIndex i
l' = IntMap.filterWithKey (\k _ -> k <= i') l
return $ s { psLog = l' }
CLogEntries es -> do
putStrLn $ "Log entries: " ++ show es
let l = psLog s
l' = foldr (\e -> MemLog.insert (fromIntegral $ unIndex $ eIndex e) e) l es
return $ s { psLog = l' }
CSetCommitIndex i' -> do
let i = psCommitIndex s
putStrLn $ "New commit index, to commit: " ++ entriesToCommit i i'
return $ s { psCommitIndex = i' } | 1,518 | false | true | 8 | 16 | 542 | 579 | 262 | 317 | null | null |
simonswine/string-kata-haskell | src/String/Kata.hs | gpl-3.0 | getUpTo :: ([Char],[Char]) -> Char -> ([Char], [Char])
getUpTo ("", "") _ = ("", "") | 84 | getUpTo :: ([Char],[Char]) -> Char -> ([Char], [Char])
getUpTo ("", "") _ = ("", "") | 84 | getUpTo ("", "") _ = ("", "") | 29 | false | true | 0 | 10 | 14 | 66 | 37 | 29 | null | null |
jean-edouard/manager | rpc-proxy/Msg/Json.hs | gpl-2.0 | -- 1MB
maxFrameLen = 1024*1024 | 31 | maxFrameLen = 1024*1024 | 23 | maxFrameLen = 1024*1024 | 23 | true | false | 2 | 5 | 5 | 17 | 6 | 11 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Books/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'VolumeUserInfoUserUploadedVolumeInfo' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'vuiuuviProcessingState'
volumeUserInfoUserUploadedVolumeInfo
:: VolumeUserInfoUserUploadedVolumeInfo
volumeUserInfoUserUploadedVolumeInfo =
VolumeUserInfoUserUploadedVolumeInfo' {_vuiuuviProcessingState = Nothing} | 416 | volumeUserInfoUserUploadedVolumeInfo
:: VolumeUserInfoUserUploadedVolumeInfo
volumeUserInfoUserUploadedVolumeInfo =
VolumeUserInfoUserUploadedVolumeInfo' {_vuiuuviProcessingState = Nothing} | 195 | volumeUserInfoUserUploadedVolumeInfo =
VolumeUserInfoUserUploadedVolumeInfo' {_vuiuuviProcessingState = Nothing} | 114 | true | true | 1 | 7 | 48 | 28 | 16 | 12 | null | null |
nzok/decimal | ScaledDecimalTest.hs | mit | prop_less_and_greater_equal_are_complements =
forAll sdGen $ \x ->
forAll sdGen $ \y ->
(x < y) /= (x >= y) | 119 | prop_less_and_greater_equal_are_complements =
forAll sdGen $ \x ->
forAll sdGen $ \y ->
(x < y) /= (x >= y) | 119 | prop_less_and_greater_equal_are_complements =
forAll sdGen $ \x ->
forAll sdGen $ \y ->
(x < y) /= (x >= y) | 119 | false | false | 0 | 11 | 30 | 48 | 25 | 23 | null | null |
ryantm/ghc | compiler/main/DynFlags.hs | bsd-3-clause | supportedLanguageOverlays :: [String]
supportedLanguageOverlays = [ name | (name, _, _) <- safeHaskellFlags ] | 109 | supportedLanguageOverlays :: [String]
supportedLanguageOverlays = [ name | (name, _, _) <- safeHaskellFlags ] | 109 | supportedLanguageOverlays = [ name | (name, _, _) <- safeHaskellFlags ] | 71 | false | true | 0 | 8 | 13 | 34 | 20 | 14 | null | null |
acharal/wam | src/WAM/Runtime.hs | gpl-2.0 | -- | make cell i unbound, namely a variable cell with self-reference
create_unbound i = change_cell i (Var i) | 109 | create_unbound i = change_cell i (Var i) | 40 | create_unbound i = change_cell i (Var i) | 40 | true | false | 0 | 7 | 18 | 21 | 10 | 11 | null | null |
spechub/Hets | Common/ExtSign.hs | gpl-2.0 | mkExtSign :: sign -> ExtSign sign symbol
mkExtSign s = ExtSign s Set.empty | 74 | mkExtSign :: sign -> ExtSign sign symbol
mkExtSign s = ExtSign s Set.empty | 74 | mkExtSign s = ExtSign s Set.empty | 33 | false | true | 0 | 7 | 12 | 36 | 15 | 21 | null | null |
FranklinChen/monadiccp | Control/CP/FD/Interface.hs | bsd-3-clause | (@>=) :: (Constraint s ~ Either Model q, MonadTree m, TreeSolver m ~ s) => ModelInt -> ModelInt -> m ()
(@>=) a b = addM $ (Sugar.@>=) a b | 138 | (@>=) :: (Constraint s ~ Either Model q, MonadTree m, TreeSolver m ~ s) => ModelInt -> ModelInt -> m ()
(@>=) a b = addM $ (Sugar.@>=) a b | 138 | (@>=) a b = addM $ (Sugar.@>=) a b | 34 | false | true | 2 | 10 | 29 | 87 | 43 | 44 | null | null |
DanielSchuessler/hstri | Triangulation/InnerNormalArc.hs | gpl-3.0 | normalTrisContainingInnNA :: InnNA -> Pair INormalTri
normalTrisContainingInnNA (InnNA ina1 ina2) =
map2 iNormalTriByNormalArc (ina1, ina2) | 164 | normalTrisContainingInnNA :: InnNA -> Pair INormalTri
normalTrisContainingInnNA (InnNA ina1 ina2) =
map2 iNormalTriByNormalArc (ina1, ina2) | 164 | normalTrisContainingInnNA (InnNA ina1 ina2) =
map2 iNormalTriByNormalArc (ina1, ina2) | 110 | false | true | 0 | 7 | 39 | 40 | 20 | 20 | null | null |
GaloisInc/halvm-ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | appK :: Kind -> Kind -> Kind
appK = AppT | 40 | appK :: Kind -> Kind -> Kind
appK = AppT | 40 | appK = AppT | 11 | false | true | 0 | 8 | 9 | 26 | 11 | 15 | null | null |
ucsd-progsys/nanomaly | src/NanoML/Prim.hs | bsd-3-clause | plist_tl :: MonadEval m => Value -> m Value
plist_tl (VL _ xs mt) = case xs of
_ : xs -> withCurrentProv $ \prv -> VL prv xs mt
_ -> withCurrentProvM $ \prv -> maybeThrow (MLException (mkExn "Invalid_argument" [VS prv "List.hd"] prv)) | 238 | plist_tl :: MonadEval m => Value -> m Value
plist_tl (VL _ xs mt) = case xs of
_ : xs -> withCurrentProv $ \prv -> VL prv xs mt
_ -> withCurrentProvM $ \prv -> maybeThrow (MLException (mkExn "Invalid_argument" [VS prv "List.hd"] prv)) | 238 | plist_tl (VL _ xs mt) = case xs of
_ : xs -> withCurrentProv $ \prv -> VL prv xs mt
_ -> withCurrentProvM $ \prv -> maybeThrow (MLException (mkExn "Invalid_argument" [VS prv "List.hd"] prv)) | 194 | false | true | 0 | 16 | 47 | 114 | 55 | 59 | null | null |
reuleaux/pire | exe/Pretty.hs | bsd-3-clause | -- ppexpr :: Expr -> String
ppexpr :: Expr N N -> String
ppexpr = render . ppr 0 | 80 | ppexpr :: Expr N N -> String
ppexpr = render . ppr 0 | 52 | ppexpr = render . ppr 0 | 23 | true | true | 0 | 6 | 18 | 28 | 14 | 14 | null | null |
danidiaz/process-streaming | src/System/Process/Streaming.hs | bsd-3-clause | {-| Feed a lazy 'Data.Lazy.Text' to @stdin@, encoding it as UTF8.
-}
feedLazyUtf8 :: Data.Text.Lazy.Text -> Streams e ()
feedLazyUtf8 = feedProducer . fromLazy . Data.Text.Lazy.Encoding.encodeUtf8 | 199 | feedLazyUtf8 :: Data.Text.Lazy.Text -> Streams e ()
feedLazyUtf8 = feedProducer . fromLazy . Data.Text.Lazy.Encoding.encodeUtf8 | 127 | feedLazyUtf8 = feedProducer . fromLazy . Data.Text.Lazy.Encoding.encodeUtf8 | 75 | true | true | 0 | 7 | 28 | 40 | 23 | 17 | null | null |
RayRacine/nucleic | Nucleic/Element.hs | gpl-3.0 | inputElement :: Text -> [(Text, Text)] -> DocumentM INPUT.HTMLInputElement
inputElement itype attrs = do
e <- createElement inputTag ((attrType, itype) : attrs)
liftIO $ return (INPUT.castToHTMLInputElement e)
where
attrType = "type" :: Text
inputTag = "input" :: Text | 286 | inputElement :: Text -> [(Text, Text)] -> DocumentM INPUT.HTMLInputElement
inputElement itype attrs = do
e <- createElement inputTag ((attrType, itype) : attrs)
liftIO $ return (INPUT.castToHTMLInputElement e)
where
attrType = "type" :: Text
inputTag = "input" :: Text | 286 | inputElement itype attrs = do
e <- createElement inputTag ((attrType, itype) : attrs)
liftIO $ return (INPUT.castToHTMLInputElement e)
where
attrType = "type" :: Text
inputTag = "input" :: Text | 211 | false | true | 1 | 11 | 55 | 109 | 53 | 56 | null | null |
kindl/Hypatia | src/Compiler.hs | mit | getConditions v i (ConstructorPattern c ps) =
[mkIsArray (Access v i),
Eq (mkSize (Access v i)) (LitI (length ps + 1)),
Eq (Access v (i ++ [0])) (Var c)]
++ descendAccess (getConditions v) i 1 ps | 211 | getConditions v i (ConstructorPattern c ps) =
[mkIsArray (Access v i),
Eq (mkSize (Access v i)) (LitI (length ps + 1)),
Eq (Access v (i ++ [0])) (Var c)]
++ descendAccess (getConditions v) i 1 ps | 211 | getConditions v i (ConstructorPattern c ps) =
[mkIsArray (Access v i),
Eq (mkSize (Access v i)) (LitI (length ps + 1)),
Eq (Access v (i ++ [0])) (Var c)]
++ descendAccess (getConditions v) i 1 ps | 211 | false | false | 2 | 11 | 51 | 129 | 62 | 67 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/Type.hs | bsd-3-clause | getClassPredTys_maybe :: PredType -> Maybe (Class, [Type])
getClassPredTys_maybe ty = case splitTyConApp_maybe ty of
Just (tc, tys) | Just clas <- tyConClass_maybe tc -> Just (clas, tys)
_ -> Nothing | 215 | getClassPredTys_maybe :: PredType -> Maybe (Class, [Type])
getClassPredTys_maybe ty = case splitTyConApp_maybe ty of
Just (tc, tys) | Just clas <- tyConClass_maybe tc -> Just (clas, tys)
_ -> Nothing | 215 | getClassPredTys_maybe ty = case splitTyConApp_maybe ty of
Just (tc, tys) | Just clas <- tyConClass_maybe tc -> Just (clas, tys)
_ -> Nothing | 156 | false | true | 0 | 12 | 45 | 83 | 41 | 42 | null | null |
ckaestne/CIDE | CIDE_Language_Haskell/test/fromviral/TreeManipLib.hs | gpl-3.0 | -- Subsidiary functions -------------------------------------------------------------------
paren s = " (" ++ s ++ ") " | 124 | paren s = " (" ++ s ++ ") " | 27 | paren s = " (" ++ s ++ ") " | 27 | true | false | 0 | 6 | 18 | 18 | 9 | 9 | null | null |
akc/sym | tests/ListStat.hs | bsd-3-clause | peaks, valleys, doubleAscents, doubleDescents :: Ord a => [a] -> [(a, a, a)]
peaks w = [ v | v@(x,y,z) <- zip3 w (tail w) (tail (tail w)), x < y, y > z ] | 162 | peaks, valleys, doubleAscents, doubleDescents :: Ord a => [a] -> [(a, a, a)]
peaks w = [ v | v@(x,y,z) <- zip3 w (tail w) (tail (tail w)), x < y, y > z ] | 162 | peaks w = [ v | v@(x,y,z) <- zip3 w (tail w) (tail (tail w)), x < y, y > z ] | 85 | false | true | 0 | 12 | 43 | 110 | 62 | 48 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/Organizations/Search.hs | mpl-2.0 | -- | Optional. An optional query string used to filter the Organizations to
-- return in the response. Query rules are case-insensitive. | Field |
-- Description |
-- |------------------|--------------------------------------------| |
-- directoryCustomerId, owner.directoryCustomerId | Filters by directory
-- customer id. | | domain | Filters by domain. | Organizations may be
-- queried by \`directoryCustomerId\` or by \`domain\`, where the domain is
-- a G Suite domain, for example: * Query \`directorycustomerid:123456789\`
-- returns Organization resources with \`owner.directory_customer_id\`
-- equal to \`123456789\`. * Query \`domain:google.com\` returns
-- Organization resources corresponding to the domain \`google.com\`.
osQuery :: Lens' OrganizationsSearch (Maybe Text)
osQuery = lens _osQuery (\ s a -> s{_osQuery = a}) | 837 | osQuery :: Lens' OrganizationsSearch (Maybe Text)
osQuery = lens _osQuery (\ s a -> s{_osQuery = a}) | 100 | osQuery = lens _osQuery (\ s a -> s{_osQuery = a}) | 50 | true | true | 1 | 9 | 111 | 61 | 35 | 26 | null | null |
carlohamalainen/imagetrove-cai-projects-db | Main.hs | bsd-2-clause | doExperiment e = do
m <- map snd <$> mapM API.handyParameterSet (RestTypes.eiParameterSets e)
case map (M.lookup "Project") m of
[Just caiProjectID] -> do addGroupAccessToExperiment e caiProjectID
liftIO $ addExperiment statePrefix e
err -> liftIO $ putStrLn $ "Error: none/too many project IDs found: " ++ show err | 390 | doExperiment e = do
m <- map snd <$> mapM API.handyParameterSet (RestTypes.eiParameterSets e)
case map (M.lookup "Project") m of
[Just caiProjectID] -> do addGroupAccessToExperiment e caiProjectID
liftIO $ addExperiment statePrefix e
err -> liftIO $ putStrLn $ "Error: none/too many project IDs found: " ++ show err | 390 | doExperiment e = do
m <- map snd <$> mapM API.handyParameterSet (RestTypes.eiParameterSets e)
case map (M.lookup "Project") m of
[Just caiProjectID] -> do addGroupAccessToExperiment e caiProjectID
liftIO $ addExperiment statePrefix e
err -> liftIO $ putStrLn $ "Error: none/too many project IDs found: " ++ show err | 390 | false | false | 1 | 14 | 121 | 115 | 50 | 65 | null | null |
deech/LibClang | src/Clang/String.hs | bsd-3-clause | -- | Converts an 'FFI.ClangString' to a 'T.Text'.
unpackText :: ClangBase m => FFI.ClangString s' -> ClangT s m T.Text
unpackText s = do
-- Since unsafeGetByteString does not make a copy, this doesn't actually
-- require the two copies that it appears to employ.
str <- FFI.unsafeGetByteString s
return $! TE.decodeUtf8With TEE.lenientDecode str
-- | Converts an 'FFI.ClangString' to a 'B.ByteString'. This is faster
-- than 'unpack' and 'unpackText' since it requires no encoding. | 490 | unpackText :: ClangBase m => FFI.ClangString s' -> ClangT s m T.Text
unpackText s = do
-- Since unsafeGetByteString does not make a copy, this doesn't actually
-- require the two copies that it appears to employ.
str <- FFI.unsafeGetByteString s
return $! TE.decodeUtf8With TEE.lenientDecode str
-- | Converts an 'FFI.ClangString' to a 'B.ByteString'. This is faster
-- than 'unpack' and 'unpackText' since it requires no encoding. | 440 | unpackText s = do
-- Since unsafeGetByteString does not make a copy, this doesn't actually
-- require the two copies that it appears to employ.
str <- FFI.unsafeGetByteString s
return $! TE.decodeUtf8With TEE.lenientDecode str
-- | Converts an 'FFI.ClangString' to a 'B.ByteString'. This is faster
-- than 'unpack' and 'unpackText' since it requires no encoding. | 371 | true | true | 0 | 10 | 83 | 77 | 36 | 41 | null | null |
bkoropoff/Idris-dev | src/Idris/ParseHelpers.hs | bsd-3-clause | -- | Parses an end of block
closeBlock :: IdrisParser ()
closeBlock = do ist <- get
bs <- case brace_stack ist of
[] -> eof >> return []
Nothing : xs -> lchar '}' >> return xs <?> "end of block"
Just lvl : xs -> (do i <- indent
isParen <- lookAheadMatches (char ')')
isIn <- lookAheadMatches (reserved "in")
if i >= lvl && not (isParen || isIn)
then fail "not end of block"
else return xs)
<|> (do notOpenBraces
eof
return [])
put (ist { brace_stack = bs })
-- | Parses a terminator | 963 | closeBlock :: IdrisParser ()
closeBlock = do ist <- get
bs <- case brace_stack ist of
[] -> eof >> return []
Nothing : xs -> lchar '}' >> return xs <?> "end of block"
Just lvl : xs -> (do i <- indent
isParen <- lookAheadMatches (char ')')
isIn <- lookAheadMatches (reserved "in")
if i >= lvl && not (isParen || isIn)
then fail "not end of block"
else return xs)
<|> (do notOpenBraces
eof
return [])
put (ist { brace_stack = bs })
-- | Parses a terminator | 935 | closeBlock = do ist <- get
bs <- case brace_stack ist of
[] -> eof >> return []
Nothing : xs -> lchar '}' >> return xs <?> "end of block"
Just lvl : xs -> (do i <- indent
isParen <- lookAheadMatches (char ')')
isIn <- lookAheadMatches (reserved "in")
if i >= lvl && not (isParen || isIn)
then fail "not end of block"
else return xs)
<|> (do notOpenBraces
eof
return [])
put (ist { brace_stack = bs })
-- | Parses a terminator | 906 | true | true | 1 | 20 | 577 | 212 | 98 | 114 | null | null |
eklinkhammer/haskell-vision | Warping/Segment/Class.hs | mit | -- not used, but makes sublime coloring look pretty. Also, consider changing to use this
segToPoints :: Segment -> (Point, Point)
segToPoints (Segment px py qx qy) = ((Point px py),(Point qx qy)) | 196 | segToPoints :: Segment -> (Point, Point)
segToPoints (Segment px py qx qy) = ((Point px py),(Point qx qy)) | 106 | segToPoints (Segment px py qx qy) = ((Point px py),(Point qx qy)) | 65 | true | true | 0 | 7 | 33 | 63 | 33 | 30 | null | null |
olsner/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | -- | Construct a label for a DWARF Debug Information Entity (DIE)
-- describing another symbol.
mkAsmTempDieLabel :: CLabel -> CLabel
mkAsmTempDieLabel l = mkAsmTempDerivedLabel l (fsLit "_die") | 194 | mkAsmTempDieLabel :: CLabel -> CLabel
mkAsmTempDieLabel l = mkAsmTempDerivedLabel l (fsLit "_die") | 98 | mkAsmTempDieLabel l = mkAsmTempDerivedLabel l (fsLit "_die") | 60 | true | true | 0 | 7 | 27 | 31 | 16 | 15 | null | null |
nikki-and-the-robots/nikki | src/test/Physics/Chipmunk/StickyEdges/Tests.hs | lgpl-3.0 | -- | shows an arbitrary offending value (if one can be found
showArbitraryOffender :: Testable p => (TestPolygons -> p) -> IO ()
showArbitraryOffender p =
catcher $ quickCheck $ \ a -> whenFail (throwIO a) $ p a | 215 | showArbitraryOffender :: Testable p => (TestPolygons -> p) -> IO ()
showArbitraryOffender p =
catcher $ quickCheck $ \ a -> whenFail (throwIO a) $ p a | 154 | showArbitraryOffender p =
catcher $ quickCheck $ \ a -> whenFail (throwIO a) $ p a | 86 | true | true | 4 | 9 | 42 | 73 | 34 | 39 | null | null |
haskell/haddock | haddock-api/src/Haddock/Options.hs | bsd-2-clause | optCssFile :: [Flag] -> Maybe FilePath
optCssFile flags = optLast [ str | Flag_CSS str <- flags ] | 97 | optCssFile :: [Flag] -> Maybe FilePath
optCssFile flags = optLast [ str | Flag_CSS str <- flags ] | 97 | optCssFile flags = optLast [ str | Flag_CSS str <- flags ] | 58 | false | true | 0 | 9 | 17 | 41 | 20 | 21 | null | null |
wrengr/bytestring-trie | src/Data/Trie.hs | bsd-3-clause | getMatch q (n,x) =
case S.splitAt n q of
(p,q') -> (p, x, q')
-- | Given a query, find the longest prefix with an associated value
-- in the trie, and return that prefix, it's value, and the remainder
-- of the query.
--
-- @since 0.2.4 | 245 | getMatch q (n,x) =
case S.splitAt n q of
(p,q') -> (p, x, q')
-- | Given a query, find the longest prefix with an associated value
-- in the trie, and return that prefix, it's value, and the remainder
-- of the query.
--
-- @since 0.2.4 | 245 | getMatch q (n,x) =
case S.splitAt n q of
(p,q') -> (p, x, q')
-- | Given a query, find the longest prefix with an associated value
-- in the trie, and return that prefix, it's value, and the remainder
-- of the query.
--
-- @since 0.2.4 | 245 | false | false | 1 | 7 | 56 | 54 | 32 | 22 | null | null |
ak3n/hseiffel | src/Codegen.hs | mit | -- Arithmetic and Constants
fadd :: Operand -> Operand -> Codegen Operand
fadd a b = instr $ FAdd NoFastMathFlags a b [] | 120 | fadd :: Operand -> Operand -> Codegen Operand
fadd a b = instr $ FAdd NoFastMathFlags a b [] | 92 | fadd a b = instr $ FAdd NoFastMathFlags a b [] | 46 | true | true | 0 | 7 | 22 | 43 | 21 | 22 | null | null |
mwu-tow/cuda | Foreign/CUDA/Analysis/Occupancy.hs | bsd-3-clause | maxResidentBlocks
:: DeviceProperties -- ^ Properties of the card in question
-> Int -- ^ Threads per block
-> Int -- ^ Registers per thread
-> Int -- ^ Shared memory per block (bytes)
-> Int -- ^ Maximum number of resident blocks
maxResidentBlocks !dev !thds !regs !smem =
multiProcessorCount dev * activeThreadBlocks (occupancy dev thds regs smem) | 423 | maxResidentBlocks
:: DeviceProperties -- ^ Properties of the card in question
-> Int -- ^ Threads per block
-> Int -- ^ Registers per thread
-> Int -- ^ Shared memory per block (bytes)
-> Int
maxResidentBlocks !dev !thds !regs !smem =
multiProcessorCount dev * activeThreadBlocks (occupancy dev thds regs smem) | 369 | maxResidentBlocks !dev !thds !regs !smem =
multiProcessorCount dev * activeThreadBlocks (occupancy dev thds regs smem) | 120 | true | true | 0 | 13 | 131 | 76 | 38 | 38 | null | null |
AlexanderPankiv/ghc | compiler/prelude/THNames.hs | bsd-3-clause | infixNDName = libFun (fsLit "infixND") infixNDIdKey | 70 | infixNDName = libFun (fsLit "infixND") infixNDIdKey | 70 | infixNDName = libFun (fsLit "infixND") infixNDIdKey | 70 | false | false | 1 | 7 | 24 | 20 | 8 | 12 | null | null |
JacquesCarette/literate-scientific-software | People/Dan/Presentations/CommitteeMeeting4/BodyOld.hs | bsd-2-clause | s8_list = Enumeration $ Simple $ map (\(a,b) -> (a, Flat b))
[(((likelyChg ^. term) :+: S "1"), ((assumption ^. term) :+:
S "3 - The system currently only calculates for external blast risk." +:+.
S "In the future calculations can be added for the internal blast risk")),
(((likelyChg ^. term) :+: S "2"), ((assumption ^. term) :+:
S "4" `sC` (assumption ^. term) :+: S "8 - Currently the values for"
+:+ (P $ sflawParamM ^. symbol) `sC` (P $ sflawParamK ^. symbol) `sC`
S "and" +:+ (P $ mod_elas ^. symbol) +:+ S "are assumed to be the"
+:+ S "same for all glass. In the future these values can be changed to"
+:+. S "variable inputs")),
(((likelyChg ^. term) :+: S "3"), ((assumption ^. term ) :+:
S "5 - The software may be changed to accommodate more than a single" +:+.
(sMap (map toLower) (lite ^. term)))),
(((likelyChg ^. term) :+: S "4"), ((assumption ^. term) :+:
S "6 - The software may be changed to accommodate more boundary" +:+.
S "conditions than 4-sided support")),
(((likelyChg ^. term) :+: S "5"), ((assumption ^. term) :+:
S "7 - The software may be changed to consider more than just flexure" +:+.
S "of the glass"))] | 1,178 | s8_list = Enumeration $ Simple $ map (\(a,b) -> (a, Flat b))
[(((likelyChg ^. term) :+: S "1"), ((assumption ^. term) :+:
S "3 - The system currently only calculates for external blast risk." +:+.
S "In the future calculations can be added for the internal blast risk")),
(((likelyChg ^. term) :+: S "2"), ((assumption ^. term) :+:
S "4" `sC` (assumption ^. term) :+: S "8 - Currently the values for"
+:+ (P $ sflawParamM ^. symbol) `sC` (P $ sflawParamK ^. symbol) `sC`
S "and" +:+ (P $ mod_elas ^. symbol) +:+ S "are assumed to be the"
+:+ S "same for all glass. In the future these values can be changed to"
+:+. S "variable inputs")),
(((likelyChg ^. term) :+: S "3"), ((assumption ^. term ) :+:
S "5 - The software may be changed to accommodate more than a single" +:+.
(sMap (map toLower) (lite ^. term)))),
(((likelyChg ^. term) :+: S "4"), ((assumption ^. term) :+:
S "6 - The software may be changed to accommodate more boundary" +:+.
S "conditions than 4-sided support")),
(((likelyChg ^. term) :+: S "5"), ((assumption ^. term) :+:
S "7 - The software may be changed to consider more than just flexure" +:+.
S "of the glass"))] | 1,178 | s8_list = Enumeration $ Simple $ map (\(a,b) -> (a, Flat b))
[(((likelyChg ^. term) :+: S "1"), ((assumption ^. term) :+:
S "3 - The system currently only calculates for external blast risk." +:+.
S "In the future calculations can be added for the internal blast risk")),
(((likelyChg ^. term) :+: S "2"), ((assumption ^. term) :+:
S "4" `sC` (assumption ^. term) :+: S "8 - Currently the values for"
+:+ (P $ sflawParamM ^. symbol) `sC` (P $ sflawParamK ^. symbol) `sC`
S "and" +:+ (P $ mod_elas ^. symbol) +:+ S "are assumed to be the"
+:+ S "same for all glass. In the future these values can be changed to"
+:+. S "variable inputs")),
(((likelyChg ^. term) :+: S "3"), ((assumption ^. term ) :+:
S "5 - The software may be changed to accommodate more than a single" +:+.
(sMap (map toLower) (lite ^. term)))),
(((likelyChg ^. term) :+: S "4"), ((assumption ^. term) :+:
S "6 - The software may be changed to accommodate more boundary" +:+.
S "conditions than 4-sided support")),
(((likelyChg ^. term) :+: S "5"), ((assumption ^. term) :+:
S "7 - The software may be changed to consider more than just flexure" +:+.
S "of the glass"))] | 1,178 | false | false | 0 | 19 | 247 | 401 | 216 | 185 | null | null |
vshatskyi/sql | src/Lib.hs | bsd-3-clause | select :: ValidateSelect (SELECT selectList FROM tableReference ())
=> selectList
-> FROM
-> tableReference
-> SELECT selectList FROM tableReference ()
select selectList from' tableReference = SELECT selectList from' tableReference () | 262 | select :: ValidateSelect (SELECT selectList FROM tableReference ())
=> selectList
-> FROM
-> tableReference
-> SELECT selectList FROM tableReference ()
select selectList from' tableReference = SELECT selectList from' tableReference () | 262 | select selectList from' tableReference = SELECT selectList from' tableReference () | 82 | false | true | 0 | 10 | 57 | 73 | 35 | 38 | null | null |
brianshourd/haskell-Calypso | Calypso/Core.hs | bsd-3-clause | upAddLocal :: (PsoVect a, Grade b) => Double -> Updater a b
upAddLocal c = upAddLocalDynamic $ const c | 102 | upAddLocal :: (PsoVect a, Grade b) => Double -> Updater a b
upAddLocal c = upAddLocalDynamic $ const c | 102 | upAddLocal c = upAddLocalDynamic $ const c | 42 | false | true | 0 | 7 | 18 | 45 | 22 | 23 | null | null |
lpeterse/koka | src/Common/Name.hs | apache-2.0 | qualify :: Name -> Name -> Name
qualify (Name x _ m hm) (Name y _ n hn) | null x && null y = Name m hm n hn | 107 | qualify :: Name -> Name -> Name
qualify (Name x _ m hm) (Name y _ n hn) | null x && null y = Name m hm n hn | 107 | qualify (Name x _ m hm) (Name y _ n hn) | null x && null y = Name m hm n hn | 75 | false | true | 0 | 9 | 29 | 73 | 34 | 39 | null | null |
zenhack/haskell-capnp | lib/Capnp/Untyped.hs | mit | allocNormalList' bitsPerElt msg len = do
-- round 'len' up to the nearest word boundary.
let totalBits = BitCount (len * bitsPerElt)
totalWords = bytesToWordsCeil $ bitsToBytesCeil totalBits
ptr <- M.alloc msg totalWords
pure NormalList { nPtr = ptr, nLen = len } | 287 | allocNormalList' bitsPerElt msg len = do
-- round 'len' up to the nearest word boundary.
let totalBits = BitCount (len * bitsPerElt)
totalWords = bytesToWordsCeil $ bitsToBytesCeil totalBits
ptr <- M.alloc msg totalWords
pure NormalList { nPtr = ptr, nLen = len } | 287 | allocNormalList' bitsPerElt msg len = do
-- round 'len' up to the nearest word boundary.
let totalBits = BitCount (len * bitsPerElt)
totalWords = bytesToWordsCeil $ bitsToBytesCeil totalBits
ptr <- M.alloc msg totalWords
pure NormalList { nPtr = ptr, nLen = len } | 287 | false | false | 0 | 12 | 66 | 80 | 39 | 41 | null | null |
vikraman/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsTyVar x = noLoc (HsTyVar (noLoc x)) | 51 | nlHsTyVar x = noLoc (HsTyVar (noLoc x)) | 51 | nlHsTyVar x = noLoc (HsTyVar (noLoc x)) | 51 | false | false | 1 | 9 | 18 | 28 | 11 | 17 | null | null |
ExNexu/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | highestFC (PUniverse _) = Nothing | 33 | highestFC (PUniverse _) = Nothing | 33 | highestFC (PUniverse _) = Nothing | 33 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
olsner/ghc | compiler/types/Coercion.hs | bsd-3-clause | mkHeteroCoercionType Representational = mkHeteroReprPrimEqPred | 62 | mkHeteroCoercionType Representational = mkHeteroReprPrimEqPred | 62 | mkHeteroCoercionType Representational = mkHeteroReprPrimEqPred | 62 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
saltlang/compiler-toolbox | src/Control/Monad/Symbols.hs | bsd-3-clause | allNames' :: Monad m => (ReaderT (Array Symbol ByteString) m) [ByteString]
allNames' = liftM elems ask | 102 | allNames' :: Monad m => (ReaderT (Array Symbol ByteString) m) [ByteString]
allNames' = liftM elems ask | 102 | allNames' = liftM elems ask | 27 | false | true | 0 | 10 | 15 | 45 | 22 | 23 | null | null |
snoyberg/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | -- | This is a fake package id used to provide identities to any un-implemented
-- signatures. The set of hole identities is global over an entire compilation.
-- Don't use this directly: use 'mkHoleModule' or 'isHoleModule' instead.
-- See Note [Representation of module/name variables]
holeUnitId :: UnitId
holeUnitId = fsToUnitId (fsLit "hole") | 353 | holeUnitId :: UnitId
holeUnitId = fsToUnitId (fsLit "hole") | 64 | holeUnitId = fsToUnitId (fsLit "hole") | 43 | true | true | 0 | 7 | 58 | 24 | 14 | 10 | null | null |
Booster2/Booster2 | Workflow_Precond/impl_disjoint/Formulas.hs | bsd-3-clause | fshow (Not f) offset = let (s1,o1) = fshow f (offset + 5)
in ("not (" ++ s1 ++ ")",o1+1) | 112 | fshow (Not f) offset = let (s1,o1) = fshow f (offset + 5)
in ("not (" ++ s1 ++ ")",o1+1) | 112 | fshow (Not f) offset = let (s1,o1) = fshow f (offset + 5)
in ("not (" ++ s1 ++ ")",o1+1) | 112 | false | false | 1 | 12 | 43 | 68 | 33 | 35 | null | null |
izgzhen/aliyun-haskell-sdk | src/Aliyun/OSS.hs | apache-2.0 | constructSign :: Content a => RequestMethod -> a -> Config -> HTTPDate -> [OSSHeader] -> OSSResource -> String
constructSign verb content conf date ossHeaders resource =
"OSS " ++ show (_akId conf) ++ ":" ++ base64 (hmacSha1 (_akSec conf) (Message $ BC.pack plain))
where
plain = show verb ++ "\n" ++
(base64 . B.unpack $ _md5 content) ++ "\n" ++
_type content ++ "\n" ++
(BC.unpack (formatHTTPDate date)) ++ "\n" ++
canonicalize ossHeaders ++
canonicalize resource | 561 | constructSign :: Content a => RequestMethod -> a -> Config -> HTTPDate -> [OSSHeader] -> OSSResource -> String
constructSign verb content conf date ossHeaders resource =
"OSS " ++ show (_akId conf) ++ ":" ++ base64 (hmacSha1 (_akSec conf) (Message $ BC.pack plain))
where
plain = show verb ++ "\n" ++
(base64 . B.unpack $ _md5 content) ++ "\n" ++
_type content ++ "\n" ++
(BC.unpack (formatHTTPDate date)) ++ "\n" ++
canonicalize ossHeaders ++
canonicalize resource | 561 | constructSign verb content conf date ossHeaders resource =
"OSS " ++ show (_akId conf) ++ ":" ++ base64 (hmacSha1 (_akSec conf) (Message $ BC.pack plain))
where
plain = show verb ++ "\n" ++
(base64 . B.unpack $ _md5 content) ++ "\n" ++
_type content ++ "\n" ++
(BC.unpack (formatHTTPDate date)) ++ "\n" ++
canonicalize ossHeaders ++
canonicalize resource | 450 | false | true | 0 | 16 | 171 | 194 | 94 | 100 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/subtract_2.hs | mit | subtractMyInt :: MyInt -> MyInt -> MyInt
subtractMyInt = flip msMyInt | 73 | subtractMyInt :: MyInt -> MyInt -> MyInt
subtractMyInt = flip msMyInt | 73 | subtractMyInt = flip msMyInt | 28 | false | true | 0 | 8 | 14 | 28 | 12 | 16 | null | null |
lukexi/udp-pal | exec/Broadcast.hs | bsd-3-clause | beginSearch = forkIO' $ do
-- Begin trying to receive a server beacon message
receiveSocket <- boundSocketAny 9999 4096
searchResultMVar <- newEmptyMVar
searchThread <- forkIO . forever $ do
putStrLn "Receiving..."
receivedData <- receiveFromDecoded receiveSocket
case receivedData of
(receivedMagicNumber, SockAddrInet _port hostAddress) | receivedMagicNumber == magicNumber -> do
hostAddressString <- inet_ntoa hostAddress
putMVar searchResultMVar hostAddressString
_ -> return ()
-- Search for 1 second
threadDelay 1000000
killThread searchThread
-- Check the results
searchResult <- tryReadMVar searchResultMVar
case searchResult of
Just foundServerIP -> putStrLn $ "connectToServer: " ++ foundServerIP
Nothing -> putStrLn "startServerAndBroadcaster" | 825 | beginSearch = forkIO' $ do
-- Begin trying to receive a server beacon message
receiveSocket <- boundSocketAny 9999 4096
searchResultMVar <- newEmptyMVar
searchThread <- forkIO . forever $ do
putStrLn "Receiving..."
receivedData <- receiveFromDecoded receiveSocket
case receivedData of
(receivedMagicNumber, SockAddrInet _port hostAddress) | receivedMagicNumber == magicNumber -> do
hostAddressString <- inet_ntoa hostAddress
putMVar searchResultMVar hostAddressString
_ -> return ()
-- Search for 1 second
threadDelay 1000000
killThread searchThread
-- Check the results
searchResult <- tryReadMVar searchResultMVar
case searchResult of
Just foundServerIP -> putStrLn $ "connectToServer: " ++ foundServerIP
Nothing -> putStrLn "startServerAndBroadcaster" | 825 | beginSearch = forkIO' $ do
-- Begin trying to receive a server beacon message
receiveSocket <- boundSocketAny 9999 4096
searchResultMVar <- newEmptyMVar
searchThread <- forkIO . forever $ do
putStrLn "Receiving..."
receivedData <- receiveFromDecoded receiveSocket
case receivedData of
(receivedMagicNumber, SockAddrInet _port hostAddress) | receivedMagicNumber == magicNumber -> do
hostAddressString <- inet_ntoa hostAddress
putMVar searchResultMVar hostAddressString
_ -> return ()
-- Search for 1 second
threadDelay 1000000
killThread searchThread
-- Check the results
searchResult <- tryReadMVar searchResultMVar
case searchResult of
Just foundServerIP -> putStrLn $ "connectToServer: " ++ foundServerIP
Nothing -> putStrLn "startServerAndBroadcaster" | 825 | false | false | 1 | 20 | 162 | 185 | 80 | 105 | null | null |
unisonweb/platform | parser-typechecker/tests/Unison/Test/ANF.hs | mit | backReference :: Word64 -> Reference
backReference _ = error "backReference" | 76 | backReference :: Word64 -> Reference
backReference _ = error "backReference" | 76 | backReference _ = error "backReference" | 39 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
yihuang/ghcjs | src/Compiler/Program.hs | mit | -- end GHCJS pre-startup modes
showVersionMode, showNumVersionMode, showSupportedExtensionsMode, showOptionsMode :: Mode
showVersionMode = mkPreStartupMode ShowVersion | 180 | showVersionMode, showNumVersionMode, showSupportedExtensionsMode, showOptionsMode :: Mode
showVersionMode = mkPreStartupMode ShowVersion | 148 | showVersionMode = mkPreStartupMode ShowVersion | 58 | true | true | 0 | 5 | 27 | 21 | 14 | 7 | null | null |
fpco/hlint | src/Apply.hs | bsd-3-clause | -- | Apply hints to a single file, you may have the contents of the file.
applyHintFile :: ParseFlags -> [Setting] -> FilePath -> Maybe String -> IO [Idea]
applyHintFile flags s file src = do
res <- parseModuleApply flags s file src
return $ case res of
Left err -> [err]
Right m -> executeHints s [m]
-- | Apply hints to multiple files, allowing cross-file hints to fire. | 398 | applyHintFile :: ParseFlags -> [Setting] -> FilePath -> Maybe String -> IO [Idea]
applyHintFile flags s file src = do
res <- parseModuleApply flags s file src
return $ case res of
Left err -> [err]
Right m -> executeHints s [m]
-- | Apply hints to multiple files, allowing cross-file hints to fire. | 324 | applyHintFile flags s file src = do
res <- parseModuleApply flags s file src
return $ case res of
Left err -> [err]
Right m -> executeHints s [m]
-- | Apply hints to multiple files, allowing cross-file hints to fire. | 242 | true | true | 0 | 12 | 95 | 106 | 52 | 54 | null | null |
diagrams/diagrams-contrib | src/Diagrams/Color/XKCD.hs | bsd-3-clause | pinkish = fromJust $ readHexColor "#d46a7e" | 57 | pinkish = fromJust $ readHexColor "#d46a7e" | 57 | pinkish = fromJust $ readHexColor "#d46a7e" | 57 | false | false | 0 | 6 | 19 | 13 | 6 | 7 | null | null |
laughedelic/HaTeXExtension | HaTeXExtension/Math.hs | bsd-3-clause | -- | Shothand for @parenthesis@ function
prn :: LaTeX -> LaTeX
prn = parenthesis | 80 | prn :: LaTeX -> LaTeX
prn = parenthesis | 39 | prn = parenthesis | 17 | true | true | 0 | 7 | 13 | 23 | 10 | 13 | null | null |
GaloisInc/saw-script | heapster-saw/src/Verifier/SAW/Heapster/archival/Permissions.hs | bsd-3-clause | weakenWeakening1 (Weakening1 d sz) = Weakening1 d (incSize sz) | 62 | weakenWeakening1 (Weakening1 d sz) = Weakening1 d (incSize sz) | 62 | weakenWeakening1 (Weakening1 d sz) = Weakening1 d (incSize sz) | 62 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
nico202/NeMosim | src/api/autogen/Latex.hs | gpl-2.0 | -- TODO: use definition list instead?
inputDoc :: Int -> [Input] -> Doc
inputDoc level [] = empty | 97 | inputDoc :: Int -> [Input] -> Doc
inputDoc level [] = empty | 59 | inputDoc level [] = empty | 25 | true | true | 0 | 7 | 17 | 30 | 16 | 14 | null | null |
elieux/ghc | compiler/typecheck/TcPatSyn.hs | bsd-3-clause | {-
************************************************************************
* *
Constructing the "builder" Id
* *
************************************************************************
-}
mkPatSynBuilderId :: HsPatSynDir a -> Located Name
-> [TyVar] -> ThetaType -> [Type] -> Type
-> TcM (Maybe (Id, Bool))
mkPatSynBuilderId dir (L _ name) qtvs theta arg_tys pat_ty
| isUnidirectional dir
= return Nothing
| otherwise
= do { builder_name <- newImplicitBinder name mkBuilderOcc
; let builder_sigma = mkSigmaTy qtvs theta (mkFunTys builder_arg_tys pat_ty)
builder_id =
-- See Note [Exported LocalIds] in Id
mkExportedLocalId VanillaId builder_name builder_sigma
; return (Just (builder_id, need_dummy_arg)) }
where
builder_arg_tys | need_dummy_arg = [voidPrimTy]
| otherwise = arg_tys
need_dummy_arg = isUnLiftedType pat_ty && null arg_tys && null theta | 1,134 | mkPatSynBuilderId :: HsPatSynDir a -> Located Name
-> [TyVar] -> ThetaType -> [Type] -> Type
-> TcM (Maybe (Id, Bool))
mkPatSynBuilderId dir (L _ name) qtvs theta arg_tys pat_ty
| isUnidirectional dir
= return Nothing
| otherwise
= do { builder_name <- newImplicitBinder name mkBuilderOcc
; let builder_sigma = mkSigmaTy qtvs theta (mkFunTys builder_arg_tys pat_ty)
builder_id =
-- See Note [Exported LocalIds] in Id
mkExportedLocalId VanillaId builder_name builder_sigma
; return (Just (builder_id, need_dummy_arg)) }
where
builder_arg_tys | need_dummy_arg = [voidPrimTy]
| otherwise = arg_tys
need_dummy_arg = isUnLiftedType pat_ty && null arg_tys && null theta | 796 | mkPatSynBuilderId dir (L _ name) qtvs theta arg_tys pat_ty
| isUnidirectional dir
= return Nothing
| otherwise
= do { builder_name <- newImplicitBinder name mkBuilderOcc
; let builder_sigma = mkSigmaTy qtvs theta (mkFunTys builder_arg_tys pat_ty)
builder_id =
-- See Note [Exported LocalIds] in Id
mkExportedLocalId VanillaId builder_name builder_sigma
; return (Just (builder_id, need_dummy_arg)) }
where
builder_arg_tys | need_dummy_arg = [voidPrimTy]
| otherwise = arg_tys
need_dummy_arg = isUnLiftedType pat_ty && null arg_tys && null theta | 641 | true | true | 1 | 14 | 386 | 227 | 110 | 117 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Types/Refinements.hs | bsd-3-clause | pOr = simplify . POr | 30 | pOr = simplify . POr | 30 | pOr = simplify . POr | 30 | false | false | 1 | 5 | 14 | 13 | 5 | 8 | null | null |
superduper/bloodhound | tests/tests.hs | bsd-3-clause | searchTermsAggHint :: [ExecutionHint] -> BH IO ()
searchTermsAggHint hints = do
let terms hint = TermsAgg $ (mkTermsAggregation "user") { termExecutionHint = Just hint }
let search hint = mkAggregateSearch Nothing $ mkAggregations "users" $ terms hint
forM_ hints $ searchExpectAggs . search
forM_ hints (\x -> searchValidBucketAgg (search x) "users" toTerms) | 383 | searchTermsAggHint :: [ExecutionHint] -> BH IO ()
searchTermsAggHint hints = do
let terms hint = TermsAgg $ (mkTermsAggregation "user") { termExecutionHint = Just hint }
let search hint = mkAggregateSearch Nothing $ mkAggregations "users" $ terms hint
forM_ hints $ searchExpectAggs . search
forM_ hints (\x -> searchValidBucketAgg (search x) "users" toTerms) | 383 | searchTermsAggHint hints = do
let terms hint = TermsAgg $ (mkTermsAggregation "user") { termExecutionHint = Just hint }
let search hint = mkAggregateSearch Nothing $ mkAggregations "users" $ terms hint
forM_ hints $ searchExpectAggs . search
forM_ hints (\x -> searchValidBucketAgg (search x) "users" toTerms) | 333 | false | true | 0 | 13 | 75 | 133 | 62 | 71 | null | null |
stevely/DumpTruck | src/Web/DumpTruck/EndPoint.hs | bsd-3-clause | -- | Retrieves the app-wide environment value.
getState :: Monad m => EndPoint s m s
getState = EndPoint (\_ hs s -> return (Right (s, hs))) | 140 | getState :: Monad m => EndPoint s m s
getState = EndPoint (\_ hs s -> return (Right (s, hs))) | 93 | getState = EndPoint (\_ hs s -> return (Right (s, hs))) | 55 | true | true | 0 | 11 | 26 | 62 | 30 | 32 | null | null |
micknelso/language-c | src/Language/CFamily/C/Analysis/TypeCheck.hs | bsd-3-clause | assignCompatible :: CAssignOp -> Type -> Type -> Either String ()
assignCompatible CAssignOp t1 t2 =
case (canonicalType t1, canonicalType t2) of
(DirectType (TyBuiltin TyAny) _ _, _) -> return ()
(_, DirectType (TyBuiltin TyAny) _ _) -> return ()
-- XXX: check qualifiers
(PtrType (DirectType TyVoid _ _) _ _, t2') | isPointerType t2' -> return ()
-- XXX: check qualifiers
(t1', PtrType (DirectType TyVoid _ _) _ _) | isPointerType t1' -> return ()
(PtrType _ _ _, t2') | isIntegralType t2' -> return ()
(t1', t2') | isPointerType t1' && isPointerType t2' ->
do compatible (baseType t1') (baseType t2')
--unless (typeQuals t2 <= typeQuals t1) $
-- fail $
-- "incompatible qualifiers in pointer assignment: "
-- ++ pType t1 ++ ", " ++ pType t2
(DirectType (TyComp c1) _ _, DirectType (TyComp c2) _ _)
| sueRef c1 == sueRef c2 -> return ()
| otherwise -> fail $
"incompatible compound types in assignment: "
++ pType t1 ++ ", " ++ pType t2
(DirectType (TyBuiltin TyVaList) _ _, DirectType (TyBuiltin TyVaList) _ _) ->
return ()
(DirectType tn1 _ _, DirectType tn2 _ _)
| isJust (arithmeticConversion tn1 tn2) -> return ()
| otherwise -> fail $ "incompatible direct types in assignment: "
++ pType t1 ++ ", " ++ pType t2
(t1', t2') -> compatible t1' t2' | 1,493 | assignCompatible :: CAssignOp -> Type -> Type -> Either String ()
assignCompatible CAssignOp t1 t2 =
case (canonicalType t1, canonicalType t2) of
(DirectType (TyBuiltin TyAny) _ _, _) -> return ()
(_, DirectType (TyBuiltin TyAny) _ _) -> return ()
-- XXX: check qualifiers
(PtrType (DirectType TyVoid _ _) _ _, t2') | isPointerType t2' -> return ()
-- XXX: check qualifiers
(t1', PtrType (DirectType TyVoid _ _) _ _) | isPointerType t1' -> return ()
(PtrType _ _ _, t2') | isIntegralType t2' -> return ()
(t1', t2') | isPointerType t1' && isPointerType t2' ->
do compatible (baseType t1') (baseType t2')
--unless (typeQuals t2 <= typeQuals t1) $
-- fail $
-- "incompatible qualifiers in pointer assignment: "
-- ++ pType t1 ++ ", " ++ pType t2
(DirectType (TyComp c1) _ _, DirectType (TyComp c2) _ _)
| sueRef c1 == sueRef c2 -> return ()
| otherwise -> fail $
"incompatible compound types in assignment: "
++ pType t1 ++ ", " ++ pType t2
(DirectType (TyBuiltin TyVaList) _ _, DirectType (TyBuiltin TyVaList) _ _) ->
return ()
(DirectType tn1 _ _, DirectType tn2 _ _)
| isJust (arithmeticConversion tn1 tn2) -> return ()
| otherwise -> fail $ "incompatible direct types in assignment: "
++ pType t1 ++ ", " ++ pType t2
(t1', t2') -> compatible t1' t2' | 1,493 | assignCompatible CAssignOp t1 t2 =
case (canonicalType t1, canonicalType t2) of
(DirectType (TyBuiltin TyAny) _ _, _) -> return ()
(_, DirectType (TyBuiltin TyAny) _ _) -> return ()
-- XXX: check qualifiers
(PtrType (DirectType TyVoid _ _) _ _, t2') | isPointerType t2' -> return ()
-- XXX: check qualifiers
(t1', PtrType (DirectType TyVoid _ _) _ _) | isPointerType t1' -> return ()
(PtrType _ _ _, t2') | isIntegralType t2' -> return ()
(t1', t2') | isPointerType t1' && isPointerType t2' ->
do compatible (baseType t1') (baseType t2')
--unless (typeQuals t2 <= typeQuals t1) $
-- fail $
-- "incompatible qualifiers in pointer assignment: "
-- ++ pType t1 ++ ", " ++ pType t2
(DirectType (TyComp c1) _ _, DirectType (TyComp c2) _ _)
| sueRef c1 == sueRef c2 -> return ()
| otherwise -> fail $
"incompatible compound types in assignment: "
++ pType t1 ++ ", " ++ pType t2
(DirectType (TyBuiltin TyVaList) _ _, DirectType (TyBuiltin TyVaList) _ _) ->
return ()
(DirectType tn1 _ _, DirectType tn2 _ _)
| isJust (arithmeticConversion tn1 tn2) -> return ()
| otherwise -> fail $ "incompatible direct types in assignment: "
++ pType t1 ++ ", " ++ pType t2
(t1', t2') -> compatible t1' t2' | 1,427 | false | true | 0 | 13 | 464 | 515 | 246 | 269 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory.hs | gpl-3.0 | -- | Add intruder proof rules for both caches.
addIntrRuleACsDiffBoth :: [IntrRuleAC] -> OpenDiffTheory -> OpenDiffTheory
addIntrRuleACsDiffBoth rs' thy = addIntrRuleACsDiffRight rs' (addIntrRuleACsDiffLeft rs' thy) | 215 | addIntrRuleACsDiffBoth :: [IntrRuleAC] -> OpenDiffTheory -> OpenDiffTheory
addIntrRuleACsDiffBoth rs' thy = addIntrRuleACsDiffRight rs' (addIntrRuleACsDiffLeft rs' thy) | 168 | addIntrRuleACsDiffBoth rs' thy = addIntrRuleACsDiffRight rs' (addIntrRuleACsDiffLeft rs' thy) | 93 | true | true | 0 | 8 | 24 | 46 | 22 | 24 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | checkDivBeforeMult params (TA_Binary _ "*" (TA_Binary id "/" _ x) y)
| not (hasFloatingPoint params) && x /= y =
info id 2017 "Increase precision by replacing a/b*c with a*c/b." | 189 | checkDivBeforeMult params (TA_Binary _ "*" (TA_Binary id "/" _ x) y)
| not (hasFloatingPoint params) && x /= y =
info id 2017 "Increase precision by replacing a/b*c with a*c/b." | 189 | checkDivBeforeMult params (TA_Binary _ "*" (TA_Binary id "/" _ x) y)
| not (hasFloatingPoint params) && x /= y =
info id 2017 "Increase precision by replacing a/b*c with a*c/b." | 189 | false | false | 0 | 12 | 41 | 69 | 30 | 39 | null | null |
thlorenz/Pricetory | src/Contract/Symbols.hs | bsd-3-clause | eurgbp = "EURGBP" | 17 | eurgbp = "EURGBP" | 17 | eurgbp = "EURGBP" | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
christiaanb/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | isVarOcc _ = False | 36 | isVarOcc _ = False | 36 | isVarOcc _ = False | 36 | false | false | 0 | 5 | 21 | 9 | 4 | 5 | null | null |
phischu/fragnix | builtins/base/Data.Foldable.hs | bsd-3-clause | -- | Determines whether all elements of the structure satisfy the predicate.
all :: Foldable t => (a -> Bool) -> t a -> Bool
all p = getAll #. foldMap (All #. p) | 161 | all :: Foldable t => (a -> Bool) -> t a -> Bool
all p = getAll #. foldMap (All #. p) | 84 | all p = getAll #. foldMap (All #. p) | 36 | true | true | 0 | 8 | 33 | 54 | 27 | 27 | null | null |
fmapfmapfmap/amazonka | amazonka-sns/gen/Network/AWS/SNS/GetPlatformApplicationAttributes.hs | mpl-2.0 | -- | The response status code.
gpaarsResponseStatus :: Lens' GetPlatformApplicationAttributesResponse Int
gpaarsResponseStatus = lens _gpaarsResponseStatus (\ s a -> s{_gpaarsResponseStatus = a}) | 195 | gpaarsResponseStatus :: Lens' GetPlatformApplicationAttributesResponse Int
gpaarsResponseStatus = lens _gpaarsResponseStatus (\ s a -> s{_gpaarsResponseStatus = a}) | 164 | gpaarsResponseStatus = lens _gpaarsResponseStatus (\ s a -> s{_gpaarsResponseStatus = a}) | 89 | true | true | 1 | 9 | 21 | 45 | 22 | 23 | null | null |
jhstanton/haskellator | examples/MIPs/MIPs/Disassemble.hs | bsd-3-clause | commaSeparate :: [String] -> String
commaSeparate [] = "" | 61 | commaSeparate :: [String] -> String
commaSeparate [] = "" | 61 | commaSeparate [] = "" | 25 | false | true | 0 | 6 | 12 | 23 | 12 | 11 | null | null |
chpatrick/hchip | HChip/Graphics.hs | mit | cls :: Emu ()
cls = do
bb <- gets backBuffer
liftIO $ fillRect bb Nothing (Pixel 0)
return () | 99 | cls :: Emu ()
cls = do
bb <- gets backBuffer
liftIO $ fillRect bb Nothing (Pixel 0)
return () | 99 | cls = do
bb <- gets backBuffer
liftIO $ fillRect bb Nothing (Pixel 0)
return () | 85 | false | true | 1 | 11 | 25 | 58 | 24 | 34 | null | null |
lolisa/ChineseChess | app/Main.hs | bsd-3-clause | enemy Black = Red | 17 | enemy Black = Red | 17 | enemy Black = Red | 17 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
andygill/willowbrae | projections/Types.hs | bsd-3-clause | mkSpherical :: (Double,Double,Double) -> Spherical
mkSpherical (r,t,u) = mkSpherical' (r,radian t, radian u)
where
mkSpherical' (r,t,u)
| traceShow ("mkSpherical",(r,t,u)) False = undefined
-- | t < -pi / 2 = mkSpherical (r,-t,u' + pi)
-- | t > pi / 2 = mkSpherical (r,-t,u' - pi)
| otherwise = Spherical (r,t,u) -- t is +/- pi/2 (+/-90), u is +/- pi (+/-180) | 384 | mkSpherical :: (Double,Double,Double) -> Spherical
mkSpherical (r,t,u) = mkSpherical' (r,radian t, radian u)
where
mkSpherical' (r,t,u)
| traceShow ("mkSpherical",(r,t,u)) False = undefined
-- | t < -pi / 2 = mkSpherical (r,-t,u' + pi)
-- | t > pi / 2 = mkSpherical (r,-t,u' - pi)
| otherwise = Spherical (r,t,u) -- t is +/- pi/2 (+/-90), u is +/- pi (+/-180) | 383 | mkSpherical (r,t,u) = mkSpherical' (r,radian t, radian u)
where
mkSpherical' (r,t,u)
| traceShow ("mkSpherical",(r,t,u)) False = undefined
-- | t < -pi / 2 = mkSpherical (r,-t,u' + pi)
-- | t > pi / 2 = mkSpherical (r,-t,u' - pi)
| otherwise = Spherical (r,t,u) -- t is +/- pi/2 (+/-90), u is +/- pi (+/-180) | 332 | false | true | 0 | 10 | 86 | 131 | 71 | 60 | null | null |
psibi/shakespeare | Text/MkSizeType.hs | mit | instanceType :: String -> Name -> Type
instanceType className name = AppT (ConT $ mkName className) (ConT name) | 111 | instanceType :: String -> Name -> Type
instanceType className name = AppT (ConT $ mkName className) (ConT name) | 111 | instanceType className name = AppT (ConT $ mkName className) (ConT name) | 72 | false | true | 0 | 8 | 17 | 50 | 23 | 27 | null | null |
succzero/fino | src/Parser.hs | bsd-3-clause | test :: Show a => Parser a -> String -> IO ()
test p input = parseTest (do { whiteSpace
; x <- p
; eof
; return x
}) input | 234 | test :: Show a => Parser a -> String -> IO ()
test p input = parseTest (do { whiteSpace
; x <- p
; eof
; return x
}) input | 234 | test p input = parseTest (do { whiteSpace
; x <- p
; eof
; return x
}) input | 188 | false | true | 0 | 9 | 142 | 71 | 34 | 37 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | stodgily = id | 13 | stodgily = id | 13 | stodgily = id | 13 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
geekingfrog/advent-of-code | src/Y2018/Day16.hs | bsd-3-clause | mapSample :: Sample -> (Word16, [Ins])
mapSample sample =
let (o, a, b, c) = instruction sample
f i = exec i a b c (beforeS sample) == Just (afterS sample)
in (o, filter f instructions) | 195 | mapSample :: Sample -> (Word16, [Ins])
mapSample sample =
let (o, a, b, c) = instruction sample
f i = exec i a b c (beforeS sample) == Just (afterS sample)
in (o, filter f instructions) | 195 | mapSample sample =
let (o, a, b, c) = instruction sample
f i = exec i a b c (beforeS sample) == Just (afterS sample)
in (o, filter f instructions) | 156 | false | true | 0 | 12 | 45 | 103 | 53 | 50 | null | null |
acamino/cis-194-2013 | src/CIS194/Week06/Fibonacci.hs | mit | streamMap :: (a -> b) -> Stream a -> Stream b
streamMap f (Cons x xs) = Cons (f x) (streamMap f xs) | 99 | streamMap :: (a -> b) -> Stream a -> Stream b
streamMap f (Cons x xs) = Cons (f x) (streamMap f xs) | 99 | streamMap f (Cons x xs) = Cons (f x) (streamMap f xs) | 53 | false | true | 0 | 7 | 22 | 64 | 31 | 33 | null | null |
brendanhay/gogol | gogol-admin-directory/gen/Network/Google/Resource/Directory/MobileDevices/List.hs | mpl-2.0 | -- | Maximum number of results to return. Max allowed value is 100.
mdlMaxResults :: Lens' MobileDevicesList Int32
mdlMaxResults
= lens _mdlMaxResults
(\ s a -> s{_mdlMaxResults = a})
. _Coerce | 207 | mdlMaxResults :: Lens' MobileDevicesList Int32
mdlMaxResults
= lens _mdlMaxResults
(\ s a -> s{_mdlMaxResults = a})
. _Coerce | 139 | mdlMaxResults
= lens _mdlMaxResults
(\ s a -> s{_mdlMaxResults = a})
. _Coerce | 92 | true | true | 2 | 8 | 44 | 51 | 24 | 27 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M11/D15/Exercise.hs | mit | {--
Now that we have the articles, upload them to the mongoDB with the following
schema as a guide. The database is "articledb" and the collection is "articles"
{
"_id" : ObjectId("59f1413cd8ffa2cbebe6add0"),
"articleId" : "101",
"ArticleName" : "Donald Trump wants speedy ACA repeal, replacement",
"author" : "Leslie Small",
"publicationDate" : ISODate("2017-01-10T00:00:00Z"),
"summary" : "President-elect Donald Trump says that he wants to both repeal and replace the Affordable Care Act quickly, a position that contradicts what Republican leaders in Congress have planned for the healthcare law.",
"imgPath" : [
"https://qtxasset.com/styles/breakpoint_xl_880px_w/s3fs/2016-11/Donald-J-Trump.jpeg?Z4gkRYMNz0f636qTSpcdn_LkxkwXT130&itok=z8u50OzP"
],
"articleUrl" : "http://www.fiercehealthcare.com/payer/donald-trump-wants-speedy-aca-repeal-replacement",
"numViews" : 1000000,
"ranking" : 41,
"keywords" : [
"trump",
"affordable care act",
"reform"
]
}
for MongoDB _id is optional: if you don't provide one, MongoDB makes one.
the keywords for this data set is: ["education", "funding"]
recall that art is:
artIdx :: Integer, title :: String, published :: Day,
author, summary :: String, img, url :: FilePath,
views, rank :: Integer,
keywords :: [String] }
deriving (Eq,Show)
--}
-- render the articles in the above JSON-format ... which Data.Aeson can't
-- handle because of the ISODate guard.
jsonifyArt :: Article -> String
jsonifyArt art = undefined | 1,517 | jsonifyArt :: Article -> String
jsonifyArt art = undefined | 58 | jsonifyArt art = undefined | 26 | true | true | 0 | 5 | 252 | 21 | 12 | 9 | null | null |
twopoint718/midi | midi.hs | gpl-3.0 | mask :: Word8
mask = fromIntegral 0x7f | 38 | mask :: Word8
mask = fromIntegral 0x7f | 38 | mask = fromIntegral 0x7f | 24 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
Lythimus/lptv | sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | isSpecial '-' = True | 20 | isSpecial '-' = True | 20 | isSpecial '-' = True | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
momomimachli/Hedsql | tests/Database/Hedsql/Tests/Select.hs | gpl-3.0 | testIntersectAll :: Test
testIntersectAll = testCase "SELECT INTERSECT ALL" assertUnion
where
assertUnion :: Assertion
assertUnion = assertEqual
"SELECT INTERSECT ALL is incorrect"
( "SELECT * FROM \"People\" WHERE \"personId\" = 1 "
<> "INTERSECT ALL SELECT * FROM \"People\" WHERE \"personId\" = 2"
)
(S.codeGen intersectAllQuery) | 413 | testIntersectAll :: Test
testIntersectAll = testCase "SELECT INTERSECT ALL" assertUnion
where
assertUnion :: Assertion
assertUnion = assertEqual
"SELECT INTERSECT ALL is incorrect"
( "SELECT * FROM \"People\" WHERE \"personId\" = 1 "
<> "INTERSECT ALL SELECT * FROM \"People\" WHERE \"personId\" = 2"
)
(S.codeGen intersectAllQuery) | 413 | testIntersectAll = testCase "SELECT INTERSECT ALL" assertUnion
where
assertUnion :: Assertion
assertUnion = assertEqual
"SELECT INTERSECT ALL is incorrect"
( "SELECT * FROM \"People\" WHERE \"personId\" = 1 "
<> "INTERSECT ALL SELECT * FROM \"People\" WHERE \"personId\" = 2"
)
(S.codeGen intersectAllQuery) | 388 | false | true | 0 | 8 | 126 | 60 | 27 | 33 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.