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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dimara/ganeti | src/Ganeti/HTools/Program/Hspace.hs | bsd-2-clause | -- | Spindles efficiency.
spnEff :: Cluster.CStats -> Double
spnEff = effFn Cluster.csIspn Cluster.csTspn | 105 | spnEff :: Cluster.CStats -> Double
spnEff = effFn Cluster.csIspn Cluster.csTspn | 79 | spnEff = effFn Cluster.csIspn Cluster.csTspn | 44 | true | true | 0 | 6 | 13 | 27 | 14 | 13 | null | null |
prb/perpubplat | src/Blog/Constants.hs | bsd-3-clause | data_dir :: String
data_dir = content_root ++ "/data" | 53 | data_dir :: String
data_dir = content_root ++ "/data" | 53 | data_dir = content_root ++ "/data" | 34 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
rueshyna/gogol | gogol-mirror/gen/Network/Google/Mirror/Types/Product.hs | mpl-2.0 | -- | The bundle ID for this item. Services can specify a bundleId to group
-- many items together. They appear under a single top-level item on the
-- device.
tiBundleId :: Lens' TimelineItem (Maybe Text)
tiBundleId
= lens _tiBundleId (\ s a -> s{_tiBundleId = a}) | 266 | tiBundleId :: Lens' TimelineItem (Maybe Text)
tiBundleId
= lens _tiBundleId (\ s a -> s{_tiBundleId = a}) | 107 | tiBundleId
= lens _tiBundleId (\ s a -> s{_tiBundleId = a}) | 61 | true | true | 0 | 9 | 48 | 50 | 27 | 23 | null | null |
stephenjbarr/parody-bot | src/GoogleCustomSearch.hs | bsd-3-clause | ----------------------------------------
-- debug shit
-- creds <- getGoogleCSECred "keys.yml"
-- let query = "weird al wikipedia"
-- let query = "handy weird al wikipedia"
getQueryUrls :: GoogleCSECred -> Text -> IO [Text]
getQueryUrls creds query = do
let my_key = T.pack $ google_key creds
let my_cse_id = T.pack $ google_cse_id creds
let my_params = defaults & param "key" .~ [my_key] & param "cx" .~ [my_cse_id] & param "q" .~ [query]
r <- getWith my_params url_cse_endpt
let urls = r ^.. responseBody . key "items" . values . key "link" . _String
return $ urls | 587 | getQueryUrls :: GoogleCSECred -> Text -> IO [Text]
getQueryUrls creds query = do
let my_key = T.pack $ google_key creds
let my_cse_id = T.pack $ google_cse_id creds
let my_params = defaults & param "key" .~ [my_key] & param "cx" .~ [my_cse_id] & param "q" .~ [query]
r <- getWith my_params url_cse_endpt
let urls = r ^.. responseBody . key "items" . values . key "link" . _String
return $ urls | 411 | getQueryUrls creds query = do
let my_key = T.pack $ google_key creds
let my_cse_id = T.pack $ google_cse_id creds
let my_params = defaults & param "key" .~ [my_key] & param "cx" .~ [my_cse_id] & param "q" .~ [query]
r <- getWith my_params url_cse_endpt
let urls = r ^.. responseBody . key "items" . values . key "link" . _String
return $ urls | 360 | true | true | 0 | 16 | 114 | 181 | 86 | 95 | null | null |
noinia/damokles | src/Main.hs | bsd-3-clause | htmlTemplateExt = ".html" | 28 | htmlTemplateExt = ".html" | 28 | htmlTemplateExt = ".html" | 28 | false | false | 1 | 5 | 5 | 10 | 3 | 7 | null | null |
ktvoelker/auth-proxy | src/HTML.hs | bsd-3-clause | render :: [(Text, Text)] -> FilePath -> IO Text
render args fp = renderText args <$> readFile fp | 96 | render :: [(Text, Text)] -> FilePath -> IO Text
render args fp = renderText args <$> readFile fp | 96 | render args fp = renderText args <$> readFile fp | 48 | false | true | 0 | 7 | 17 | 46 | 23 | 23 | null | null |
olsner/ghc | compiler/cmm/CmmUtils.hs | bsd-3-clause | isTrivialCmmExpr (CmmMachOp _ _) = False | 43 | isTrivialCmmExpr (CmmMachOp _ _) = False | 43 | isTrivialCmmExpr (CmmMachOp _ _) = False | 43 | false | false | 0 | 7 | 8 | 17 | 8 | 9 | null | null |
bergmark/clay | src/Clay/Text.hs | bsd-3-clause | justify, matchParent, start, end :: TextAlign
justify = TextAlign "justify" | 80 | justify, matchParent, start, end :: TextAlign
justify = TextAlign "justify" | 79 | justify = TextAlign "justify" | 33 | false | true | 0 | 5 | 14 | 20 | 13 | 7 | null | null |
nfrisby/yoko | Data/Yoko/TH/Internal.hs | bsd-2-clause | thFail :: String -> Q a
thFail s = fail $ "yokoTH: " ++ s | 57 | thFail :: String -> Q a
thFail s = fail $ "yokoTH: " ++ s | 57 | thFail s = fail $ "yokoTH: " ++ s | 33 | false | true | 0 | 6 | 14 | 29 | 14 | 15 | null | null |
oldmanmike/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Conversion functions
fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
fromIntegralIdKey = mkPreludeMiscIdUnique 190 | 160 | fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique
fromIntegralIdKey = mkPreludeMiscIdUnique 190 | 136 | fromIntegralIdKey = mkPreludeMiscIdUnique 190 | 48 | true | true | 0 | 5 | 15 | 21 | 14 | 7 | null | null |
tjakway/ghcjvm | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | condIntCode :: Cond -> CmmExpr -> CmmExpr -> NatM CondCode
condIntCode cond x y = do is32Bit <- is32BitPlatform
condIntCode' is32Bit cond x y | 167 | condIntCode :: Cond -> CmmExpr -> CmmExpr -> NatM CondCode
condIntCode cond x y = do is32Bit <- is32BitPlatform
condIntCode' is32Bit cond x y | 167 | condIntCode cond x y = do is32Bit <- is32BitPlatform
condIntCode' is32Bit cond x y | 108 | false | true | 0 | 9 | 49 | 57 | 25 | 32 | null | null |
TomMD/ghc | compiler/utils/Binary.hs | bsd-3-clause | writeBinMem :: BinHandle -> FilePath -> IO ()
writeBinMem (BinMem _ ix_r _ arr_r) fn = do
h <- openBinaryFile fn WriteMode
arr <- readIORef arr_r
ix <- readFastMutInt ix_r
withForeignPtr arr $ \p -> hPutBuf h p ix
hClose h | 233 | writeBinMem :: BinHandle -> FilePath -> IO ()
writeBinMem (BinMem _ ix_r _ arr_r) fn = do
h <- openBinaryFile fn WriteMode
arr <- readIORef arr_r
ix <- readFastMutInt ix_r
withForeignPtr arr $ \p -> hPutBuf h p ix
hClose h | 233 | writeBinMem (BinMem _ ix_r _ arr_r) fn = do
h <- openBinaryFile fn WriteMode
arr <- readIORef arr_r
ix <- readFastMutInt ix_r
withForeignPtr arr $ \p -> hPutBuf h p ix
hClose h | 187 | false | true | 0 | 10 | 51 | 106 | 46 | 60 | null | null |
bflyblue/quadtree | Quadtree2.hs | unlicense | pathFromZipper :: Zipper a -> Path
pathFromZipper (Zipper _ h bc) = (h + length bc, reverse $ map dir bc)
where dir (Crumb d _ _ _) = d | 141 | pathFromZipper :: Zipper a -> Path
pathFromZipper (Zipper _ h bc) = (h + length bc, reverse $ map dir bc)
where dir (Crumb d _ _ _) = d | 141 | pathFromZipper (Zipper _ h bc) = (h + length bc, reverse $ map dir bc)
where dir (Crumb d _ _ _) = d | 106 | false | true | 0 | 7 | 35 | 75 | 37 | 38 | null | null |
nikki-and-the-robots/nikki | src/Top/Main.hs | lgpl-3.0 | renderThread :: Configuration -> MVar Application -> IO ()
renderThread configuration appRef =
{-# scc "renderThread" #-}
withQApplication $ \ qApp -> do
withMainWindow swapInterval (width defaultWindowSize) (height defaultWindowSize) $ \ window -> do
paintEngine <- paintEngineTypeMainWindow window
logg Debug ("paint engine: " ++ show paintEngine)
withNikkiIcon window $ do
keyPoller <- newKeyPoller window
(initial_events configuration ++ initialDebuggingSignals)
-- loading the gui pixmaps
appPixmaps <- loadApplicationPixmaps
-- showing main window
let windowMode = if fullscreen configuration
then FullScreen
else Windowed defaultWindowSize
setWindowTitle window "Nikki and the Robots"
setWindowSize window windowMode
showLoadingScreen qApp window appPixmaps configuration
showMainWindow window
processEventsQApplication qApp
withAllSorts $ \ sorts ->
withApplicationSounds $ \ appSounds -> do
let app :: Application
app = Application qApp window keyPoller
startAppState appPixmaps
appSounds sorts
putMVar appRef app
-- will be quit by the logick thread
exitCode <- execQApplication qApp
when (exitCode /= 0) $
logg Error ("error exit code from execQApplication: " ++ show exitCode) | 1,494 | renderThread :: Configuration -> MVar Application -> IO ()
renderThread configuration appRef =
{-# scc "renderThread" #-}
withQApplication $ \ qApp -> do
withMainWindow swapInterval (width defaultWindowSize) (height defaultWindowSize) $ \ window -> do
paintEngine <- paintEngineTypeMainWindow window
logg Debug ("paint engine: " ++ show paintEngine)
withNikkiIcon window $ do
keyPoller <- newKeyPoller window
(initial_events configuration ++ initialDebuggingSignals)
-- loading the gui pixmaps
appPixmaps <- loadApplicationPixmaps
-- showing main window
let windowMode = if fullscreen configuration
then FullScreen
else Windowed defaultWindowSize
setWindowTitle window "Nikki and the Robots"
setWindowSize window windowMode
showLoadingScreen qApp window appPixmaps configuration
showMainWindow window
processEventsQApplication qApp
withAllSorts $ \ sorts ->
withApplicationSounds $ \ appSounds -> do
let app :: Application
app = Application qApp window keyPoller
startAppState appPixmaps
appSounds sorts
putMVar appRef app
-- will be quit by the logick thread
exitCode <- execQApplication qApp
when (exitCode /= 0) $
logg Error ("error exit code from execQApplication: " ++ show exitCode) | 1,494 | renderThread configuration appRef =
{-# scc "renderThread" #-}
withQApplication $ \ qApp -> do
withMainWindow swapInterval (width defaultWindowSize) (height defaultWindowSize) $ \ window -> do
paintEngine <- paintEngineTypeMainWindow window
logg Debug ("paint engine: " ++ show paintEngine)
withNikkiIcon window $ do
keyPoller <- newKeyPoller window
(initial_events configuration ++ initialDebuggingSignals)
-- loading the gui pixmaps
appPixmaps <- loadApplicationPixmaps
-- showing main window
let windowMode = if fullscreen configuration
then FullScreen
else Windowed defaultWindowSize
setWindowTitle window "Nikki and the Robots"
setWindowSize window windowMode
showLoadingScreen qApp window appPixmaps configuration
showMainWindow window
processEventsQApplication qApp
withAllSorts $ \ sorts ->
withApplicationSounds $ \ appSounds -> do
let app :: Application
app = Application qApp window keyPoller
startAppState appPixmaps
appSounds sorts
putMVar appRef app
-- will be quit by the logick thread
exitCode <- execQApplication qApp
when (exitCode /= 0) $
logg Error ("error exit code from execQApplication: " ++ show exitCode) | 1,435 | false | true | 0 | 26 | 460 | 306 | 141 | 165 | null | null |
pascal-knodel/haskell-craft | _/links/E'4'16.hs | mit | isWinter December = True | 25 | isWinter December = True | 25 | isWinter December = True | 25 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
FranklinChen/reddit | src/Reddit/Routes/User.hs | bsd-2-clause | blocked :: Route
blocked = Route [ "prefs", "blocked" ]
[ ]
"GET" | 97 | blocked :: Route
blocked = Route [ "prefs", "blocked" ]
[ ]
"GET" | 97 | blocked = Route [ "prefs", "blocked" ]
[ ]
"GET" | 80 | false | true | 0 | 6 | 44 | 35 | 15 | 20 | null | null |
bdesham/pinboard-notes-backup | src/Pinboard.hs | gpl-3.0 | -- * Constants
nominalDiffTimeToMicroseconds :: NominalDiffTime -> Int
nominalDiffTimeToMicroseconds = floor . ((1000000 :: Double) *) . realToFrac | 148 | nominalDiffTimeToMicroseconds :: NominalDiffTime -> Int
nominalDiffTimeToMicroseconds = floor . ((1000000 :: Double) *) . realToFrac | 132 | nominalDiffTimeToMicroseconds = floor . ((1000000 :: Double) *) . realToFrac | 76 | true | true | 0 | 8 | 18 | 34 | 20 | 14 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/playpen/hcpn/examples/locker.hs | unlicense | release_shared crs rs = [ if r `elem` crs then (r,(e,s-1)) else (r,(e,s)) | (r,(e,s)) <- rs ] | 93 | release_shared crs rs = [ if r `elem` crs then (r,(e,s-1)) else (r,(e,s)) | (r,(e,s)) <- rs ] | 93 | release_shared crs rs = [ if r `elem` crs then (r,(e,s-1)) else (r,(e,s)) | (r,(e,s)) <- rs ] | 93 | false | false | 0 | 9 | 17 | 76 | 46 | 30 | null | null |
intolerable/GroupProject | src/Emulator/Memory/Regions.hs | bsd-2-clause | canRead GamePakROM = True | 28 | canRead GamePakROM = True | 28 | canRead GamePakROM = True | 28 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
spinda/liquidhaskell | tests/gsoc15/unknown/pos/maybe2.hs | bsd-3-clause | filterGt' b' (Bin _ kx x l r) =
case compare b' kx of LT -> join kx x (filterGt' b' l) r
EQ -> r
GT -> filterGt' b' r | 191 | filterGt' b' (Bin _ kx x l r) =
case compare b' kx of LT -> join kx x (filterGt' b' l) r
EQ -> r
GT -> filterGt' b' r | 191 | filterGt' b' (Bin _ kx x l r) =
case compare b' kx of LT -> join kx x (filterGt' b' l) r
EQ -> r
GT -> filterGt' b' r | 191 | false | false | 0 | 10 | 104 | 74 | 35 | 39 | null | null |
functorial/blog-source | Main.hs | bsd-3-clause | renderFeed :: [Post] -> RSS.RSS
renderFeed posts =
RSS.RSS "Functorial Blog"
(URI.URI
"https:"
(Just (URI.URIAuth "" "blog.functorial.com" ""))
"/feed.rss"
""
"")
"A blog about functional programming"
[ RSS.Language "English"
, RSS.Copyright copyright
, RSS.WebMaster "freeman.phil@gmail.com"
]
(map renderFeedPost posts) | 453 | renderFeed :: [Post] -> RSS.RSS
renderFeed posts =
RSS.RSS "Functorial Blog"
(URI.URI
"https:"
(Just (URI.URIAuth "" "blog.functorial.com" ""))
"/feed.rss"
""
"")
"A blog about functional programming"
[ RSS.Language "English"
, RSS.Copyright copyright
, RSS.WebMaster "freeman.phil@gmail.com"
]
(map renderFeedPost posts) | 453 | renderFeed posts =
RSS.RSS "Functorial Blog"
(URI.URI
"https:"
(Just (URI.URIAuth "" "blog.functorial.com" ""))
"/feed.rss"
""
"")
"A blog about functional programming"
[ RSS.Language "English"
, RSS.Copyright copyright
, RSS.WebMaster "freeman.phil@gmail.com"
]
(map renderFeedPost posts) | 421 | false | true | 0 | 11 | 170 | 106 | 51 | 55 | null | null |
frenetic-lang/netcore-1.0 | examples/ErrorDetect.hs | bsd-3-clause | --a map of query actions and channels to read to get info about the query
monTable :: IORef (Map Int (Chan (Switch, Integer), [Action]))
monTable = unsafePerformIO (newIORef Map.empty) | 184 | monTable :: IORef (Map Int (Chan (Switch, Integer), [Action]))
monTable = unsafePerformIO (newIORef Map.empty) | 110 | monTable = unsafePerformIO (newIORef Map.empty) | 47 | true | true | 0 | 10 | 28 | 52 | 28 | 24 | null | null |
alvisespano/Lw | extras/hml-prototype/PPrint.hs | gpl-3.0 | x <//> y = x <> softbreak <> y | 37 | x <//> y = x <> softbreak <> y | 37 | x <//> y = x <> softbreak <> y | 37 | false | false | 2 | 6 | 15 | 20 | 9 | 11 | null | null |
Soostone/hadron | src/Hadron/Run/Hadoop.hs | bsd-3-clause | hdfsFanOut :: HadoopEnv -> FilePath -> IO FanOut
hdfsFanOut env@HadoopEnv{..} tmp = mkFanOut mkHandle
where
mkTmp fp = tmp </> (toS . Base16.encode . toS . hash . toS $ fp)
-- write into a temp file loc until we know the stage is
-- complete without failure
mkHandle fp = do
let fp' = mkTmp fp
createDirectoryIfMissing True (fp' ^. directory)
h <- openFile fp' AppendMode
let fin = runResourceT $ do
a <- register $ removeFile fp'
liftIO $ hdfsMkdir env (fp ^. directory)
liftIO $ hdfsPut env fp' fp
release a
return (h, fin)
-------------------------------------------------------------------------------
-- | Create HDFS directory if missing | 772 | hdfsFanOut :: HadoopEnv -> FilePath -> IO FanOut
hdfsFanOut env@HadoopEnv{..} tmp = mkFanOut mkHandle
where
mkTmp fp = tmp </> (toS . Base16.encode . toS . hash . toS $ fp)
-- write into a temp file loc until we know the stage is
-- complete without failure
mkHandle fp = do
let fp' = mkTmp fp
createDirectoryIfMissing True (fp' ^. directory)
h <- openFile fp' AppendMode
let fin = runResourceT $ do
a <- register $ removeFile fp'
liftIO $ hdfsMkdir env (fp ^. directory)
liftIO $ hdfsPut env fp' fp
release a
return (h, fin)
-------------------------------------------------------------------------------
-- | Create HDFS directory if missing | 772 | hdfsFanOut env@HadoopEnv{..} tmp = mkFanOut mkHandle
where
mkTmp fp = tmp </> (toS . Base16.encode . toS . hash . toS $ fp)
-- write into a temp file loc until we know the stage is
-- complete without failure
mkHandle fp = do
let fp' = mkTmp fp
createDirectoryIfMissing True (fp' ^. directory)
h <- openFile fp' AppendMode
let fin = runResourceT $ do
a <- register $ removeFile fp'
liftIO $ hdfsMkdir env (fp ^. directory)
liftIO $ hdfsPut env fp' fp
release a
return (h, fin)
-------------------------------------------------------------------------------
-- | Create HDFS directory if missing | 723 | false | true | 5 | 17 | 233 | 222 | 100 | 122 | null | null |
yesodweb/shakespeare | Text/MkSizeType.hs | mit | showInstanceDec :: Name -> String -> Dec
showInstanceDec name unit' = instanceD [] (instanceType "Show" name) [showDec]
where showSize = VarE $ mkName "showSize"
x = mkName "x"
unit = LitE $ StringL unit'
showDec = FunD (mkName "show") [Clause [showPat] showBody []]
showPat = conP name [VarP x]
showBody = NormalB $ AppE (AppE showSize $ VarE x) unit | 393 | showInstanceDec :: Name -> String -> Dec
showInstanceDec name unit' = instanceD [] (instanceType "Show" name) [showDec]
where showSize = VarE $ mkName "showSize"
x = mkName "x"
unit = LitE $ StringL unit'
showDec = FunD (mkName "show") [Clause [showPat] showBody []]
showPat = conP name [VarP x]
showBody = NormalB $ AppE (AppE showSize $ VarE x) unit | 393 | showInstanceDec name unit' = instanceD [] (instanceType "Show" name) [showDec]
where showSize = VarE $ mkName "showSize"
x = mkName "x"
unit = LitE $ StringL unit'
showDec = FunD (mkName "show") [Clause [showPat] showBody []]
showPat = conP name [VarP x]
showBody = NormalB $ AppE (AppE showSize $ VarE x) unit | 352 | false | true | 5 | 10 | 101 | 155 | 76 | 79 | null | null |
uduki/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | qCast_QStyleOptionMenuItem :: Object a -> IO (QStyleOptionMenuItem ())
qCast_QStyleOptionMenuItem _qobj
= return (objectCast _qobj) | 133 | qCast_QStyleOptionMenuItem :: Object a -> IO (QStyleOptionMenuItem ())
qCast_QStyleOptionMenuItem _qobj
= return (objectCast _qobj) | 133 | qCast_QStyleOptionMenuItem _qobj
= return (objectCast _qobj) | 62 | false | true | 0 | 9 | 15 | 41 | 19 | 22 | null | null |
mrmonday/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | jsBigInt js = JSNum $ JSInteger $ JSBigIntExpr js | 61 | jsBigInt js = JSNum $ JSInteger $ JSBigIntExpr js | 61 | jsBigInt js = JSNum $ JSInteger $ JSBigIntExpr js | 61 | false | false | 0 | 6 | 20 | 20 | 9 | 11 | null | null |
balangs/eTeak | src/Bind.hs | bsd-3-clause | bindPreCmd cs other = (cs, other) | 33 | bindPreCmd cs other = (cs, other) | 33 | bindPreCmd cs other = (cs, other) | 33 | false | false | 1 | 5 | 5 | 21 | 9 | 12 | null | null |
DanielSchuessler/hstri | Equivalence/Tests.hs | gpl-3.0 | - | The equivalence test as implemented is the same as testing equality of representatives
prop_eq_by_reps :: Property
prop_eq_by_reps = mkProp (\es _ e ->
forAll2 (elements es) (elements es) (\x y ->
eqv_eq e x y == (((==) `on` (eqv_rep e)) x y))) | 287 | prop_eq_by_reps :: Property
prop_eq_by_reps = mkProp (\es _ e ->
forAll2 (elements es) (elements es) (\x y ->
eqv_eq e x y == (((==) `on` (eqv_rep e)) x y))) | 195 | prop_eq_by_reps = mkProp (\es _ e ->
forAll2 (elements es) (elements es) (\x y ->
eqv_eq e x y == (((==) `on` (eqv_rep e)) x y))) | 166 | true | true | 1 | 18 | 82 | 129 | 65 | 64 | null | null |
tchoutri/Hexon | Network/Hexon.hs | bsd-3-clause | -- | Retrieves informations about the given ID
-- |
-- | Example:
--
-- >>> sock <- mkConn
-- >>> getId sock "1"
-- Right (RID {rid_status = "success", rid_message = "Item is available"
-- , rid_info = Info {info_name = "Thingy"
-- , info_id = "1", info_date = "2016-09-02 13:25:11"
-- , info_comments = "First of the Name", info_author = "anon"}})
getId :: Socket -> ID -> IO (Either String Response)
getId sock id = executeCmd sock "id" [Singleton id] | 484 | getId :: Socket -> ID -> IO (Either String Response)
getId sock id = executeCmd sock "id" [Singleton id] | 104 | getId sock id = executeCmd sock "id" [Singleton id] | 51 | true | true | 0 | 9 | 112 | 58 | 33 | 25 | null | null |
michalkonecny/polypaver | src/PolyPaver/Simplify/Substitution.hs | bsd-3-clause | monoTypeMatches :: MonotonicityType -> MonotonicityType -> Bool
monoTypeMatches Equal _ = True | 94 | monoTypeMatches :: MonotonicityType -> MonotonicityType -> Bool
monoTypeMatches Equal _ = True | 94 | monoTypeMatches Equal _ = True | 30 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
mattias-lundell/timber-llvm | src/Scp.hs | bsd-3-clause | redRat2 p _ _ = internalError0 ("Scp.redRat2 " ++ show p) | 76 | redRat2 p _ _ = internalError0 ("Scp.redRat2 " ++ show p) | 76 | redRat2 p _ _ = internalError0 ("Scp.redRat2 " ++ show p) | 76 | false | false | 0 | 8 | 29 | 26 | 12 | 14 | null | null |
travitch/foreign-inference | tests/SAPArgumentTests.hs | bsd-3-clause | main :: IO ()
main = do
args <- getArgs
let pattern = case args of
[] -> "tests/sap/argument/*.c"
[infile] -> infile
_ -> error "At most one argument allowed"
ds <- loadDependencies [] []
let testDescriptors = [
TestDescriptor { testPattern = pattern
, testExpectedMapping = (<.> "expected")
, testResultBuilder = analyzeSAPs ds
, testResultComparator = assertEqual
}
]
withArgs [] $ testAgainstExpected requiredOptimizations bcParser testDescriptors
where
bcParser = parseLLVMFile defaultParserOptions | 650 | main :: IO ()
main = do
args <- getArgs
let pattern = case args of
[] -> "tests/sap/argument/*.c"
[infile] -> infile
_ -> error "At most one argument allowed"
ds <- loadDependencies [] []
let testDescriptors = [
TestDescriptor { testPattern = pattern
, testExpectedMapping = (<.> "expected")
, testResultBuilder = analyzeSAPs ds
, testResultComparator = assertEqual
}
]
withArgs [] $ testAgainstExpected requiredOptimizations bcParser testDescriptors
where
bcParser = parseLLVMFile defaultParserOptions | 650 | main = do
args <- getArgs
let pattern = case args of
[] -> "tests/sap/argument/*.c"
[infile] -> infile
_ -> error "At most one argument allowed"
ds <- loadDependencies [] []
let testDescriptors = [
TestDescriptor { testPattern = pattern
, testExpectedMapping = (<.> "expected")
, testResultBuilder = analyzeSAPs ds
, testResultComparator = assertEqual
}
]
withArgs [] $ testAgainstExpected requiredOptimizations bcParser testDescriptors
where
bcParser = parseLLVMFile defaultParserOptions | 636 | false | true | 0 | 13 | 219 | 153 | 77 | 76 | null | null |
DeeLaiD/project_megadeal | global.hs | bsd-3-clause | inputToIntList :: String -> IO [Int]
inputToIntList s = do
catch(do
if s == "" then do
newInput <- getLine
inputToIntList newInput
else do
evaluate (read s))
((\_ -> do
putStrLn "Invalid input. Correct format: [1,3,5]"
inputToIntList "") :: SomeException -> IO [Int])
{- exists [a] a
Purpose: Check if the list of data type a exists in the given list of data type a.
Pre: True
Post: True
Side-effect:
-} | 465 | inputToIntList :: String -> IO [Int]
inputToIntList s = do
catch(do
if s == "" then do
newInput <- getLine
inputToIntList newInput
else do
evaluate (read s))
((\_ -> do
putStrLn "Invalid input. Correct format: [1,3,5]"
inputToIntList "") :: SomeException -> IO [Int])
{- exists [a] a
Purpose: Check if the list of data type a exists in the given list of data type a.
Pre: True
Post: True
Side-effect:
-} | 465 | inputToIntList s = do
catch(do
if s == "" then do
newInput <- getLine
inputToIntList newInput
else do
evaluate (read s))
((\_ -> do
putStrLn "Invalid input. Correct format: [1,3,5]"
inputToIntList "") :: SomeException -> IO [Int])
{- exists [a] a
Purpose: Check if the list of data type a exists in the given list of data type a.
Pre: True
Post: True
Side-effect:
-} | 428 | false | true | 0 | 17 | 132 | 117 | 55 | 62 | null | null |
wolftune/hoogle | src/Query.hs | bsd-3-clause | typeSig_ :: [String] -> Maybe Type
typeSig_ xs = case parseTypeWithMode parseMode $ unwords $ fixup $ filter (not . all isSpace) xs of
ParseOk x -> Just $ transformBi (\v -> if v == Ident "__" then Ident "_" else v) x
_ -> Nothing
where
fixup = underscore . closeBracket . completeFunc . completeArrow
completeArrow (unsnoc -> Just (a,b)) | b `elem` ["-","="] = snoc a (b ++ ">")
completeArrow x = x
completeFunc (unsnoc -> Just (a,b)) | b `elem` ["->","=>"] = a ++ [b,"_"]
completeFunc x = x
closeBracket xs = xs ++ foldl f [] xs
where f stack x | Just c <- lookup x (zip openBrackets shutBrackets) = c:stack
f (s:tack) x | x == s = tack
f stack x = stack
underscore = replace ["_"] ["__"] | 810 | typeSig_ :: [String] -> Maybe Type
typeSig_ xs = case parseTypeWithMode parseMode $ unwords $ fixup $ filter (not . all isSpace) xs of
ParseOk x -> Just $ transformBi (\v -> if v == Ident "__" then Ident "_" else v) x
_ -> Nothing
where
fixup = underscore . closeBracket . completeFunc . completeArrow
completeArrow (unsnoc -> Just (a,b)) | b `elem` ["-","="] = snoc a (b ++ ">")
completeArrow x = x
completeFunc (unsnoc -> Just (a,b)) | b `elem` ["->","=>"] = a ++ [b,"_"]
completeFunc x = x
closeBracket xs = xs ++ foldl f [] xs
where f stack x | Just c <- lookup x (zip openBrackets shutBrackets) = c:stack
f (s:tack) x | x == s = tack
f stack x = stack
underscore = replace ["_"] ["__"] | 810 | typeSig_ xs = case parseTypeWithMode parseMode $ unwords $ fixup $ filter (not . all isSpace) xs of
ParseOk x -> Just $ transformBi (\v -> if v == Ident "__" then Ident "_" else v) x
_ -> Nothing
where
fixup = underscore . closeBracket . completeFunc . completeArrow
completeArrow (unsnoc -> Just (a,b)) | b `elem` ["-","="] = snoc a (b ++ ">")
completeArrow x = x
completeFunc (unsnoc -> Just (a,b)) | b `elem` ["->","=>"] = a ++ [b,"_"]
completeFunc x = x
closeBracket xs = xs ++ foldl f [] xs
where f stack x | Just c <- lookup x (zip openBrackets shutBrackets) = c:stack
f (s:tack) x | x == s = tack
f stack x = stack
underscore = replace ["_"] ["__"] | 775 | false | true | 0 | 14 | 254 | 366 | 185 | 181 | null | null |
ssaavedra/liquidhaskell | tests/pos/RBTree-col-height.hs | bsd-3-clause | --------------------------------------------------------------------------
-- | Add an element -------------------------------------------------------
---------------------------------------------------------------------------
{-@ add :: (Ord a) => a -> RBT a -> RBT a @-}
add x s = makeBlack (ins x s)
| 304 | add x s = makeBlack (ins x s) | 29 | add x s = makeBlack (ins x s) | 29 | true | false | 1 | 7 | 31 | 30 | 14 | 16 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/LocalBuildInfo.hs | bsd-3-clause | componentDisabledReason (CBench bm)
| not (buildable (benchmarkBuildInfo bm)) = Just DisabledComponent
| not (benchmarkEnabled bm) = Just DisabledAllBenchmarks | 177 | componentDisabledReason (CBench bm)
| not (buildable (benchmarkBuildInfo bm)) = Just DisabledComponent
| not (benchmarkEnabled bm) = Just DisabledAllBenchmarks | 177 | componentDisabledReason (CBench bm)
| not (buildable (benchmarkBuildInfo bm)) = Just DisabledComponent
| not (benchmarkEnabled bm) = Just DisabledAllBenchmarks | 177 | false | false | 0 | 12 | 35 | 62 | 27 | 35 | null | null |
urbanslug/ghc | libraries/base/Data/Typeable/Internal.hs | bsd-3-clause | -- | Applies a polymorhic type constructor to a sequence of kinds and types
mkPolyTyConApp :: TyCon -> [KindRep] -> [TypeRep] -> TypeRep
mkPolyTyConApp tc@(TyCon tc_k _ _ _) [] [] = TypeRep tc_k tc [] [] | 203 | mkPolyTyConApp :: TyCon -> [KindRep] -> [TypeRep] -> TypeRep
mkPolyTyConApp tc@(TyCon tc_k _ _ _) [] [] = TypeRep tc_k tc [] [] | 127 | mkPolyTyConApp tc@(TyCon tc_k _ _ _) [] [] = TypeRep tc_k tc [] [] | 66 | true | true | 1 | 8 | 36 | 76 | 37 | 39 | null | null |
ilyasergey/GHC-XAppFix | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | etRegister' _ (CmmReg reg)
= return (Fixed (cmmTypeSize (cmmRegType reg))
(getRegisterReg reg) nilOL)
| 122 | getRegister' _ (CmmReg reg)
= return (Fixed (cmmTypeSize (cmmRegType reg))
(getRegisterReg reg) nilOL) | 122 | getRegister' _ (CmmReg reg)
= return (Fixed (cmmTypeSize (cmmRegType reg))
(getRegisterReg reg) nilOL) | 122 | false | false | 1 | 10 | 33 | 50 | 23 | 27 | null | null |
shlevy/ghc | compiler/prelude/THNames.hs | bsd-3-clause | sectionLName = libFun (fsLit "sectionL") sectionLIdKey | 60 | sectionLName = libFun (fsLit "sectionL") sectionLIdKey | 60 | sectionLName = libFun (fsLit "sectionL") sectionLIdKey | 60 | false | false | 0 | 7 | 11 | 17 | 8 | 9 | null | null |
c19/Exercism-Haskell | scrabble-score/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen/Paths_scrabble_score.hs | mit | getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
getBinDir = catchIO (getEnv "scrabble_score_bindir") (\_ -> return bindir) | 166 | getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
getBinDir = catchIO (getEnv "scrabble_score_bindir") (\_ -> return bindir) | 166 | getBinDir = catchIO (getEnv "scrabble_score_bindir") (\_ -> return bindir) | 74 | false | true | 0 | 8 | 17 | 46 | 28 | 18 | null | null |
k0001/snaplet-remotestorage | src/Network/RemoteStorage/Types.hs | bsd-3-clause | apiVersion :: B.ByteString
apiVersion = "draft-dejong-remotestorage-00" | 71 | apiVersion :: B.ByteString
apiVersion = "draft-dejong-remotestorage-00" | 71 | apiVersion = "draft-dejong-remotestorage-00" | 44 | false | true | 0 | 7 | 5 | 20 | 8 | 12 | null | null |
hsyl20/HViperVM | lib/ViperVM/Parsing/Prettify.hs | lgpl-3.0 | helpMessage :: String -> String
helpMessage progName =
usageInfo progName options | 83 | helpMessage :: String -> String
helpMessage progName =
usageInfo progName options | 83 | helpMessage progName =
usageInfo progName options | 51 | false | true | 0 | 5 | 12 | 23 | 11 | 12 | null | null |
leichunfeng/learnyouahaskell | baby.hs | mit | phoneBookToMap' :: (Ord k) => [(k, a)] -> Map.Map k [a]
phoneBookToMap' xs = Map.fromListWith (++) $ map (\(k,v) -> (k,[v])) xs | 127 | phoneBookToMap' :: (Ord k) => [(k, a)] -> Map.Map k [a]
phoneBookToMap' xs = Map.fromListWith (++) $ map (\(k,v) -> (k,[v])) xs | 127 | phoneBookToMap' xs = Map.fromListWith (++) $ map (\(k,v) -> (k,[v])) xs | 71 | false | true | 0 | 10 | 21 | 89 | 49 | 40 | null | null |
tadeuzagallo/verve-lang | src/Typing/Subtyping.hs | mit | (Forall gen t12) <: t2@(TyApp _t21 args) | length gen == length args =
let t1' = applySubst (zipSubst gen args) t12
in t1' <: t2 | 133 | (Forall gen t12) <: t2@(TyApp _t21 args) | length gen == length args =
let t1' = applySubst (zipSubst gen args) t12
in t1' <: t2 | 133 | (Forall gen t12) <: t2@(TyApp _t21 args) | length gen == length args =
let t1' = applySubst (zipSubst gen args) t12
in t1' <: t2 | 133 | false | false | 0 | 12 | 30 | 75 | 34 | 41 | null | null |
lfritz/python-type-inference | python-type-inference/src/Language/Python/TypeInference/Analysis/Analysis.hs | bsd-3-clause | getArguments :: Configuration -> [Parameter] -> TF ()
getArguments c params =
do let ps = filter isRegularParameter params
paramIdentifiers = map getParamIdentifier ps
n = length ps
sp = find isStarParameter params
ssp = find isStarStarParameter params
nameMap = Map.fromList $ zip [n | Parameter (Name _ n) _ <- ps] [0..]
getDefault :: Parameter -> TF (Maybe UnionType)
getDefault (Parameter _ Nothing) = return Nothing
getDefault (Parameter _ (Just e)) = do t <- expressionType c e
return $ Just t
defaults <- mapM getDefault ps
args <- getAllFromL isArgumentIdentifier
removeFromL isArgumentIdentifier
let (pa, ka, sa, ssa) = splitArgs args
f = do let v = Map.fromList $ zip [0..n-1] (repeat Nothing)
(pa', extraPositional) =
partition (\(PositionalAI i, _) -> i < n) pa
v' = Map.fromList [ (i, Just t)
| (PositionalAI i, t) <- pa' ]
`Map.union`
v
when (not (null extraPositional) && isNothing sp)
Nothing
let (ka', extraKw) =
partition (\(KeywordAI kw, _) ->
kw `Map.member` nameMap)
ka
v'' = Map.fromList [ (nameMap Map.! kw, Just t)
| (KeywordAI kw, t) <- ka']
`Map.union` v'
when (not (null extraKw) && isNothing ssp)
Nothing
let useDefault _ (Just v) = Just v
useDefault k _ = defaults !! k
v''' = Map.mapWithKey useDefault v''
when (any isNothing (Map.elems v''') && null sa && null ssa)
Nothing
let values = map (fromMaybe UTyTop . snd) (Map.toAscList v''')
entries = zip paramIdentifiers values
++ case sp of Nothing -> []
Just p -> [(getParamIdentifier p,
oneType TupleType)]
++ case ssp of Nothing -> []
Just p -> [(getParamIdentifier p,
oneType DictType)]
return $ Map.fromList entries
allTop = Map.fromList (zip paramIdentifiers (repeat UTyTop))
newEntries = fromMaybe allTop f
mapM_ (uncurry setType) (Map.toList newEntries) | 2,839 | getArguments :: Configuration -> [Parameter] -> TF ()
getArguments c params =
do let ps = filter isRegularParameter params
paramIdentifiers = map getParamIdentifier ps
n = length ps
sp = find isStarParameter params
ssp = find isStarStarParameter params
nameMap = Map.fromList $ zip [n | Parameter (Name _ n) _ <- ps] [0..]
getDefault :: Parameter -> TF (Maybe UnionType)
getDefault (Parameter _ Nothing) = return Nothing
getDefault (Parameter _ (Just e)) = do t <- expressionType c e
return $ Just t
defaults <- mapM getDefault ps
args <- getAllFromL isArgumentIdentifier
removeFromL isArgumentIdentifier
let (pa, ka, sa, ssa) = splitArgs args
f = do let v = Map.fromList $ zip [0..n-1] (repeat Nothing)
(pa', extraPositional) =
partition (\(PositionalAI i, _) -> i < n) pa
v' = Map.fromList [ (i, Just t)
| (PositionalAI i, t) <- pa' ]
`Map.union`
v
when (not (null extraPositional) && isNothing sp)
Nothing
let (ka', extraKw) =
partition (\(KeywordAI kw, _) ->
kw `Map.member` nameMap)
ka
v'' = Map.fromList [ (nameMap Map.! kw, Just t)
| (KeywordAI kw, t) <- ka']
`Map.union` v'
when (not (null extraKw) && isNothing ssp)
Nothing
let useDefault _ (Just v) = Just v
useDefault k _ = defaults !! k
v''' = Map.mapWithKey useDefault v''
when (any isNothing (Map.elems v''') && null sa && null ssa)
Nothing
let values = map (fromMaybe UTyTop . snd) (Map.toAscList v''')
entries = zip paramIdentifiers values
++ case sp of Nothing -> []
Just p -> [(getParamIdentifier p,
oneType TupleType)]
++ case ssp of Nothing -> []
Just p -> [(getParamIdentifier p,
oneType DictType)]
return $ Map.fromList entries
allTop = Map.fromList (zip paramIdentifiers (repeat UTyTop))
newEntries = fromMaybe allTop f
mapM_ (uncurry setType) (Map.toList newEntries) | 2,839 | getArguments c params =
do let ps = filter isRegularParameter params
paramIdentifiers = map getParamIdentifier ps
n = length ps
sp = find isStarParameter params
ssp = find isStarStarParameter params
nameMap = Map.fromList $ zip [n | Parameter (Name _ n) _ <- ps] [0..]
getDefault :: Parameter -> TF (Maybe UnionType)
getDefault (Parameter _ Nothing) = return Nothing
getDefault (Parameter _ (Just e)) = do t <- expressionType c e
return $ Just t
defaults <- mapM getDefault ps
args <- getAllFromL isArgumentIdentifier
removeFromL isArgumentIdentifier
let (pa, ka, sa, ssa) = splitArgs args
f = do let v = Map.fromList $ zip [0..n-1] (repeat Nothing)
(pa', extraPositional) =
partition (\(PositionalAI i, _) -> i < n) pa
v' = Map.fromList [ (i, Just t)
| (PositionalAI i, t) <- pa' ]
`Map.union`
v
when (not (null extraPositional) && isNothing sp)
Nothing
let (ka', extraKw) =
partition (\(KeywordAI kw, _) ->
kw `Map.member` nameMap)
ka
v'' = Map.fromList [ (nameMap Map.! kw, Just t)
| (KeywordAI kw, t) <- ka']
`Map.union` v'
when (not (null extraKw) && isNothing ssp)
Nothing
let useDefault _ (Just v) = Just v
useDefault k _ = defaults !! k
v''' = Map.mapWithKey useDefault v''
when (any isNothing (Map.elems v''') && null sa && null ssa)
Nothing
let values = map (fromMaybe UTyTop . snd) (Map.toAscList v''')
entries = zip paramIdentifiers values
++ case sp of Nothing -> []
Just p -> [(getParamIdentifier p,
oneType TupleType)]
++ case ssp of Nothing -> []
Just p -> [(getParamIdentifier p,
oneType DictType)]
return $ Map.fromList entries
allTop = Map.fromList (zip paramIdentifiers (repeat UTyTop))
newEntries = fromMaybe allTop f
mapM_ (uncurry setType) (Map.toList newEntries) | 2,785 | false | true | 0 | 23 | 1,382 | 821 | 403 | 418 | null | null |
joshcough/L5-Haskell | src/L/ReplTools.hs | mit | quickCompileString :: (FromSExpr i, Show o) => Compiler i o -> String -> String
quickCompileString l s = show . runVal $ compileString l s opts s | 145 | quickCompileString :: (FromSExpr i, Show o) => Compiler i o -> String -> String
quickCompileString l s = show . runVal $ compileString l s opts s | 145 | quickCompileString l s = show . runVal $ compileString l s opts s | 65 | false | true | 0 | 7 | 26 | 61 | 30 | 31 | null | null |
damoxc/ganeti | src/Ganeti/HTools/Program/Hspace.hs | gpl-2.0 | -- | Function to print stats for a given phase.
printStats :: Phase -> Cluster.CStats -> [(String, String)]
printStats ph cs =
map (\(s, fn) -> (printf "%s_%s" kind s, fn cs)) statsData
where kind = case ph of
PInitial -> "INI"
PFinal -> "FIN"
PTiered -> "TRL"
-- | Print failure reason and scores | 353 | printStats :: Phase -> Cluster.CStats -> [(String, String)]
printStats ph cs =
map (\(s, fn) -> (printf "%s_%s" kind s, fn cs)) statsData
where kind = case ph of
PInitial -> "INI"
PFinal -> "FIN"
PTiered -> "TRL"
-- | Print failure reason and scores | 305 | printStats ph cs =
map (\(s, fn) -> (printf "%s_%s" kind s, fn cs)) statsData
where kind = case ph of
PInitial -> "INI"
PFinal -> "FIN"
PTiered -> "TRL"
-- | Print failure reason and scores | 245 | true | true | 0 | 9 | 110 | 102 | 55 | 47 | null | null |
jfischoff/hs-mitsuba | tests/Tests/Mitsuba/Types.hs | bsd-3-clause | case_ward_toXML
= actualWard `assertElement` [xmlQQ|
<bsdf type="ward">
<string name="variant" value="ward" />
<float name="alphaU" value="1.0" />
<float name="alphaV" value="2.0" />
<spectrum name="specularReflectance" value="3.0" />
<spectrum name="diffuseReflectance" value="4.0" />
</bsdf>
|] | 348 | case_ward_toXML
= actualWard `assertElement` [xmlQQ|
<bsdf type="ward">
<string name="variant" value="ward" />
<float name="alphaU" value="1.0" />
<float name="alphaV" value="2.0" />
<spectrum name="specularReflectance" value="3.0" />
<spectrum name="diffuseReflectance" value="4.0" />
</bsdf>
|] | 348 | case_ward_toXML
= actualWard `assertElement` [xmlQQ|
<bsdf type="ward">
<string name="variant" value="ward" />
<float name="alphaU" value="1.0" />
<float name="alphaV" value="2.0" />
<spectrum name="specularReflectance" value="3.0" />
<spectrum name="diffuseReflectance" value="4.0" />
</bsdf>
|] | 348 | false | false | 1 | 5 | 80 | 19 | 11 | 8 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/main/DriverPhases.hs | bsd-3-clause | phaseInputExt (Cpp _) = "lpp" | 41 | phaseInputExt (Cpp _) = "lpp" | 41 | phaseInputExt (Cpp _) = "lpp" | 41 | false | false | 0 | 7 | 16 | 15 | 7 | 8 | null | null |
igraves/flow-arrow | examples/Processor.hs | bsd-3-clause | store :: Flow MState i ()
store = stall2 $ liftFlow store_ | 58 | store :: Flow MState i ()
store = stall2 $ liftFlow store_ | 58 | store = stall2 $ liftFlow store_ | 32 | false | true | 1 | 6 | 11 | 30 | 13 | 17 | null | null |
ganeti/htools | Ganeti/HTools/Text.hs | gpl-2.0 | loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" | 72 | loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" | 72 | loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" | 72 | false | false | 3 | 7 | 14 | 28 | 12 | 16 | null | null |
nushio3/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | readClassKey = mkPreludeClassUnique 13 | 49 | readClassKey = mkPreludeClassUnique 13 | 49 | readClassKey = mkPreludeClassUnique 13 | 49 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
aoanthony/independentfunctionalsemantics | src/Main.hs | bsd-3-clause | ss = (bss,(frs,(sus,dss))) | 27 | ss = (bss,(frs,(sus,dss))) | 27 | ss = (bss,(frs,(sus,dss))) | 27 | false | false | 0 | 7 | 3 | 24 | 15 | 9 | null | null |
sdiehl/ghc | compiler/utils/Bag.hs | bsd-3-clause | -- This one is a bit stricter! The bag will get completely evaluated.
unionBags :: Bag a -> Bag a -> Bag a
unionBags EmptyBag b = b | 132 | unionBags :: Bag a -> Bag a -> Bag a
unionBags EmptyBag b = b | 61 | unionBags EmptyBag b = b | 24 | true | true | 0 | 8 | 28 | 39 | 17 | 22 | null | null |
haskell-infra/hackage-server | Distribution/Server/Users/State.hs | bsd-3-clause | modifyHackageAdmins :: (UserList -> UserList) -> Update HackageAdmins ()
modifyHackageAdmins func = State.modify (\users -> users { adminList = func (adminList users) }) | 169 | modifyHackageAdmins :: (UserList -> UserList) -> Update HackageAdmins ()
modifyHackageAdmins func = State.modify (\users -> users { adminList = func (adminList users) }) | 169 | modifyHackageAdmins func = State.modify (\users -> users { adminList = func (adminList users) }) | 96 | false | true | 0 | 12 | 22 | 66 | 33 | 33 | null | null |
talanis85/mudblood | src/Mudblood/Screen/Gtk.hs | gpl-3.0 | handleMenu :: Key -> Screen u Bool
handleMenu k = do
st <- get
ctls <- askControls
case (scrMenu st) of
Nothing -> return False
Just (_, menu) ->
case stepMenu k menu of
Just (desc, KeyAction action) -> do
liftIO $ G.widgetHide (ctlTreeMenu ctls)
action
modify (\s -> s { scrMenu = Nothing })
return True
Just (desc, KeyMenu m) -> do
liftIO $ G.listStoreClear (ctlListMenu ctls)
liftIO $ forM_ (showMenu (KeyMenu m)) $ \(k,d) -> G.listStoreAppend (ctlListMenu ctls) $ show k ++ ": " ++ d
modify (\s -> s { scrMenu = Just (desc, KeyMenu m) })
return True
Nothing -> do
liftIO $ G.widgetHide (ctlTreeMenu ctls)
modify (\s -> s { scrMenu = Nothing })
return False | 968 | handleMenu :: Key -> Screen u Bool
handleMenu k = do
st <- get
ctls <- askControls
case (scrMenu st) of
Nothing -> return False
Just (_, menu) ->
case stepMenu k menu of
Just (desc, KeyAction action) -> do
liftIO $ G.widgetHide (ctlTreeMenu ctls)
action
modify (\s -> s { scrMenu = Nothing })
return True
Just (desc, KeyMenu m) -> do
liftIO $ G.listStoreClear (ctlListMenu ctls)
liftIO $ forM_ (showMenu (KeyMenu m)) $ \(k,d) -> G.listStoreAppend (ctlListMenu ctls) $ show k ++ ": " ++ d
modify (\s -> s { scrMenu = Just (desc, KeyMenu m) })
return True
Nothing -> do
liftIO $ G.widgetHide (ctlTreeMenu ctls)
modify (\s -> s { scrMenu = Nothing })
return False | 968 | handleMenu k = do
st <- get
ctls <- askControls
case (scrMenu st) of
Nothing -> return False
Just (_, menu) ->
case stepMenu k menu of
Just (desc, KeyAction action) -> do
liftIO $ G.widgetHide (ctlTreeMenu ctls)
action
modify (\s -> s { scrMenu = Nothing })
return True
Just (desc, KeyMenu m) -> do
liftIO $ G.listStoreClear (ctlListMenu ctls)
liftIO $ forM_ (showMenu (KeyMenu m)) $ \(k,d) -> G.listStoreAppend (ctlListMenu ctls) $ show k ++ ": " ++ d
modify (\s -> s { scrMenu = Just (desc, KeyMenu m) })
return True
Nothing -> do
liftIO $ G.widgetHide (ctlTreeMenu ctls)
modify (\s -> s { scrMenu = Nothing })
return False | 933 | false | true | 0 | 22 | 428 | 341 | 164 | 177 | null | null |
gfredericks/ridge | Ridge/RT.hs | epl-1.0 | assertTypes :: [(Object, Object)] -> Object -> Object
assertTypes [] val = val | 78 | assertTypes :: [(Object, Object)] -> Object -> Object
assertTypes [] val = val | 78 | assertTypes [] val = val | 24 | false | true | 0 | 9 | 12 | 41 | 20 | 21 | null | null |
elieux/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | ptrTyConKey = mkPreludeTyConUnique 74 | 65 | ptrTyConKey = mkPreludeTyConUnique 74 | 65 | ptrTyConKey = mkPreludeTyConUnique 74 | 65 | false | false | 0 | 5 | 31 | 9 | 4 | 5 | null | null |
sorki/odrive | src/LDrive/Tests/PWM.hs | bsd-3-clause | app :: (e -> ClockConfig)
-> (e -> PWMTimer)
-> (e -> ColoredLEDs)
-> Tower e ()
app _tocc totestpwm toleds = do
ldriveTowerDeps
pwm <- fmap totestpwm getEnv
leds <- fmap toleds getEnv
blink (Milliseconds 1000) [redLED leds]
PWM{..} <- pwmTower pwm
periodic <- period (Milliseconds 10)
monitor "simplecontroller" $ do
pwmout <- stateInit "pwmout" $ iarray [ival 0, ival 0, ival 0]
handler periodic "periodic" $ do
callbackV $ \p -> do
let time :: Uint64
time = signCast $ toIMicroseconds p
let val = castDefault $ (time `iShiftR` 6) .% (safeCast tim_period_clocks)
store (pwmout ! 0) val
store (pwmout ! 1) val
store (pwmout ! 2) val
pwm_set (constRef pwmout)
return () | 788 | app :: (e -> ClockConfig)
-> (e -> PWMTimer)
-> (e -> ColoredLEDs)
-> Tower e ()
app _tocc totestpwm toleds = do
ldriveTowerDeps
pwm <- fmap totestpwm getEnv
leds <- fmap toleds getEnv
blink (Milliseconds 1000) [redLED leds]
PWM{..} <- pwmTower pwm
periodic <- period (Milliseconds 10)
monitor "simplecontroller" $ do
pwmout <- stateInit "pwmout" $ iarray [ival 0, ival 0, ival 0]
handler periodic "periodic" $ do
callbackV $ \p -> do
let time :: Uint64
time = signCast $ toIMicroseconds p
let val = castDefault $ (time `iShiftR` 6) .% (safeCast tim_period_clocks)
store (pwmout ! 0) val
store (pwmout ! 1) val
store (pwmout ! 2) val
pwm_set (constRef pwmout)
return () | 788 | app _tocc totestpwm toleds = do
ldriveTowerDeps
pwm <- fmap totestpwm getEnv
leds <- fmap toleds getEnv
blink (Milliseconds 1000) [redLED leds]
PWM{..} <- pwmTower pwm
periodic <- period (Milliseconds 10)
monitor "simplecontroller" $ do
pwmout <- stateInit "pwmout" $ iarray [ival 0, ival 0, ival 0]
handler periodic "periodic" $ do
callbackV $ \p -> do
let time :: Uint64
time = signCast $ toIMicroseconds p
let val = castDefault $ (time `iShiftR` 6) .% (safeCast tim_period_clocks)
store (pwmout ! 0) val
store (pwmout ! 1) val
store (pwmout ! 2) val
pwm_set (constRef pwmout)
return () | 695 | false | true | 0 | 23 | 233 | 324 | 151 | 173 | null | null |
abbradar/yaxmpp | src/Network/XMPP/Stanza.hs | bsd-3-clause | checkOrFail :: Monad m => Maybe a -> m () -> MaybeT m a
checkOrFail Nothing finalize = MaybeT $ finalize >> return Nothing | 122 | checkOrFail :: Monad m => Maybe a -> m () -> MaybeT m a
checkOrFail Nothing finalize = MaybeT $ finalize >> return Nothing | 122 | checkOrFail Nothing finalize = MaybeT $ finalize >> return Nothing | 66 | false | true | 0 | 9 | 23 | 55 | 25 | 30 | null | null |
gereeter/simple-regions | src/Data/Resource/Handle.hs | mit | hSetBuffering :: (MonadSafe m, MonadIO m) => Handle s -> BufferMode -> RegionT s m ()
hSetBuffering h buffering = withResource h (\h' -> liftIO $ IO.hSetBuffering h' buffering) | 176 | hSetBuffering :: (MonadSafe m, MonadIO m) => Handle s -> BufferMode -> RegionT s m ()
hSetBuffering h buffering = withResource h (\h' -> liftIO $ IO.hSetBuffering h' buffering) | 176 | hSetBuffering h buffering = withResource h (\h' -> liftIO $ IO.hSetBuffering h' buffering) | 90 | false | true | 0 | 10 | 28 | 79 | 38 | 41 | null | null |
MichaelBurge/ToxicSludgeDB | Tests/ExampleQueries.hs | mit | test_aggregate :: Assertion
test_aggregate =
let query = "select bool_or(x) from (select false as x union all select true);"
expectedColumn = Column { columnName = "bool_or", columnType = TBool }
expectedStream = singleton_stream expectedColumn $ VBool True
in assertQueryResults nullEnvironment query expectedStream | 332 | test_aggregate :: Assertion
test_aggregate =
let query = "select bool_or(x) from (select false as x union all select true);"
expectedColumn = Column { columnName = "bool_or", columnType = TBool }
expectedStream = singleton_stream expectedColumn $ VBool True
in assertQueryResults nullEnvironment query expectedStream | 332 | test_aggregate =
let query = "select bool_or(x) from (select false as x union all select true);"
expectedColumn = Column { columnName = "bool_or", columnType = TBool }
expectedStream = singleton_stream expectedColumn $ VBool True
in assertQueryResults nullEnvironment query expectedStream | 304 | false | true | 0 | 10 | 57 | 63 | 33 | 30 | null | null |
ku-fpg/sunroof-compiler | Language/Sunroof/JS/Browser.hs | bsd-3-clause | -- | Decode the URI encoded in the given string.
decodeURI :: JSString -> JS t JSString
decodeURI str = fun "decodeURI" `apply` (str) | 133 | decodeURI :: JSString -> JS t JSString
decodeURI str = fun "decodeURI" `apply` (str) | 84 | decodeURI str = fun "decodeURI" `apply` (str) | 45 | true | true | 0 | 6 | 23 | 36 | 19 | 17 | null | null |
tanakh/hackage-mirror | Settings.hs | bsd-2-clause | parseExtra :: DefaultEnv -> Object -> Parser Extra
parseExtra _ o = Extra
<$> o .: "copyright"
<*> o .:? "analytics" | 125 | parseExtra :: DefaultEnv -> Object -> Parser Extra
parseExtra _ o = Extra
<$> o .: "copyright"
<*> o .:? "analytics" | 125 | parseExtra _ o = Extra
<$> o .: "copyright"
<*> o .:? "analytics" | 74 | false | true | 5 | 7 | 29 | 47 | 23 | 24 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Elements.hs | bsd-3-clause | defDialog ∷ Dialog
defDialog = Dialog Nothing Nothing Nothing | 61 | defDialog ∷ Dialog
defDialog = Dialog Nothing Nothing Nothing | 61 | defDialog = Dialog Nothing Nothing Nothing | 42 | false | true | 0 | 6 | 8 | 24 | 10 | 14 | null | null |
jwbuurlage/category-theory-programmers | examples/folds/folds.hs | mit | concatfm :: [[a]] -> [a]
concatfm = foldMap id | 46 | concatfm :: [[a]] -> [a]
concatfm = foldMap id | 46 | concatfm = foldMap id | 21 | false | true | 0 | 7 | 8 | 27 | 15 | 12 | null | null |
tjakway/ghcjvm | compiler/specialise/Rules.hs | bsd-3-clause | mkRuleBase :: [CoreRule] -> RuleBase
mkRuleBase rules = extendRuleBaseList emptyRuleBase rules | 94 | mkRuleBase :: [CoreRule] -> RuleBase
mkRuleBase rules = extendRuleBaseList emptyRuleBase rules | 94 | mkRuleBase rules = extendRuleBaseList emptyRuleBase rules | 57 | false | true | 0 | 6 | 10 | 29 | 14 | 15 | null | null |
petester42/haskell-hockey | src/Hockey/Types/Standings.hs | mit | toDivisionType "Atlantic" = Atlantic | 36 | toDivisionType "Atlantic" = Atlantic | 36 | toDivisionType "Atlantic" = Atlantic | 36 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
f1u77y/xmonad-contrib | XMonad/Hooks/EwmhDesktops.hs | bsd-3-clause | -- |
-- Generalized version of ewmhDesktopsEventHook that allows an arbitrary
-- user-specified function to transform the workspace list (post-sorting)
ewmhDesktopsEventHookCustom :: ([WindowSpace] -> [WindowSpace]) -> Event -> X All
ewmhDesktopsEventHookCustom f e = handle f e >> return (All True) | 299 | ewmhDesktopsEventHookCustom :: ([WindowSpace] -> [WindowSpace]) -> Event -> X All
ewmhDesktopsEventHookCustom f e = handle f e >> return (All True) | 147 | ewmhDesktopsEventHookCustom f e = handle f e >> return (All True) | 65 | true | true | 0 | 8 | 40 | 61 | 32 | 29 | null | null |
schell/germs | src/Parser.hs | mit | defRule :: Parser Definition
defRule = DefRule <$> rule <?> "Definition of Rule" | 80 | defRule :: Parser Definition
defRule = DefRule <$> rule <?> "Definition of Rule" | 80 | defRule = DefRule <$> rule <?> "Definition of Rule" | 51 | false | true | 0 | 6 | 12 | 22 | 11 | 11 | null | null |
kadena-io/pact | src-tool/Pact/Analyze/Feature.hs | bsd-3-clause | classTitle CTemporal = "Temporal" | 39 | classTitle CTemporal = "Temporal" | 39 | classTitle CTemporal = "Temporal" | 39 | false | false | 0 | 4 | 9 | 10 | 4 | 6 | null | null |
mcschroeder/ghc | compiler/hsSyn/HsBinds.hs | bsd-3-clause | isTypeLSig _ = False | 39 | isTypeLSig _ = False | 39 | isTypeLSig _ = False | 39 | false | false | 0 | 4 | 22 | 10 | 4 | 6 | null | null |
haskell/haddock | haddock-api/src/Haddock/Interface/Specialize.hs | bsd-2-clause | renameType (HsParTy x lt) = HsParTy x <$> renameLType lt | 56 | renameType (HsParTy x lt) = HsParTy x <$> renameLType lt | 56 | renameType (HsParTy x lt) = HsParTy x <$> renameLType lt | 56 | false | false | 0 | 7 | 9 | 27 | 12 | 15 | null | null |
haskell-distributed/distributed-process-client-server | src/Control/Distributed/Process/ManagedProcess/Server.hs | bsd-3-clause | check (State c) st _ = c st | 33 | check (State c) st _ = c st | 33 | check (State c) st _ = c st | 33 | false | false | 0 | 6 | 13 | 25 | 10 | 15 | null | null |
diagrams/diagrams-contrib | src/Diagrams/TwoD/Path/IntersectionExtras.hs | bsd-3-clause | -- | Turn a path a list of component trails, then cut those segments at all
-- their intersections.
--
-- <<diagrams/src_Diagrams_TwoD_Path_IntersectionExtras_explodeIntersectionsEx.svg#diagram=explodeIntersectionsEx&width=300>>
--
-- > explodeIntersectionsEx = onSections (explodeIntersections squares) colorLines
-- > where
-- > squares = square 1
-- > <> square 1 # rotate (1/8 @@ turn)
-- > colorLines = map (map lc)
-- > [ [ gray, red, orange, yellow, green, blue, indigo, violet]
-- > , [black, crimson, darkorange, gold, darkgreen, darkblue, midnightblue, darkviolet] ]
explodeIntersections :: (OrderedField n, Real n) => Path V2 n -> [[Located (Trail V2 n)]]
explodeIntersections = explodeIntersections' defEps | 798 | explodeIntersections :: (OrderedField n, Real n) => Path V2 n -> [[Located (Trail V2 n)]]
explodeIntersections = explodeIntersections' defEps | 142 | explodeIntersections = explodeIntersections' defEps | 51 | true | true | 0 | 11 | 179 | 67 | 40 | 27 | null | null |
oldmanmike/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | hsLInstDeclBinders (L _ (DataFamInstD { dfid_inst = fi }))
= hsDataFamInstBinders fi | 86 | hsLInstDeclBinders (L _ (DataFamInstD { dfid_inst = fi }))
= hsDataFamInstBinders fi | 86 | hsLInstDeclBinders (L _ (DataFamInstD { dfid_inst = fi }))
= hsDataFamInstBinders fi | 86 | false | false | 0 | 11 | 13 | 32 | 16 | 16 | null | null |
urbanslug/ghc | compiler/cmm/CmmMachOp.hs | bsd-3-clause | mo_WordTo64 dflags = MO_UU_Conv (wordWidth dflags) W64 | 58 | mo_WordTo64 dflags = MO_UU_Conv (wordWidth dflags) W64 | 58 | mo_WordTo64 dflags = MO_UU_Conv (wordWidth dflags) W64 | 58 | false | false | 0 | 7 | 10 | 20 | 9 | 11 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/ReplaceRouteTableAssociation.hs | mpl-2.0 | -- | 'ReplaceRouteTableAssociationResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'rrtarNewAssociationId' @::@ 'Maybe' 'Text'
--
replaceRouteTableAssociationResponse :: ReplaceRouteTableAssociationResponse
replaceRouteTableAssociationResponse = ReplaceRouteTableAssociationResponse
{ _rrtarNewAssociationId = Nothing
} | 371 | replaceRouteTableAssociationResponse :: ReplaceRouteTableAssociationResponse
replaceRouteTableAssociationResponse = ReplaceRouteTableAssociationResponse
{ _rrtarNewAssociationId = Nothing
} | 197 | replaceRouteTableAssociationResponse = ReplaceRouteTableAssociationResponse
{ _rrtarNewAssociationId = Nothing
} | 120 | true | true | 0 | 7 | 39 | 29 | 18 | 11 | null | null |
hvr/jhc | src/FrontEnd/Representation.hs | mit | fn :: Type -> Type -> Type
a `fn` b = TArrow a b | 59 | fn :: Type -> Type -> Type
a `fn` b = TArrow a b | 59 | a `fn` b = TArrow a b | 24 | false | true | 0 | 6 | 24 | 35 | 17 | 18 | null | null |
ublubu/tile-rider | src/TileRider/GameTile.hs | mit | tileNotE :: GameTile
tileNotE = GameTile (Rectangular False True True True) PathTile | 84 | tileNotE :: GameTile
tileNotE = GameTile (Rectangular False True True True) PathTile | 84 | tileNotE = GameTile (Rectangular False True True True) PathTile | 63 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
wellposed/hblas | tests/HBLAS/BLAS/Level2Spec.hs | bsd-3-clause | herSpec :: Spec
herSpec =
context "?HER" $ do
describe "CHER" $ do
it "4*4 a upper all 1+i's" $ do
matvecTest1CHER
describe "ZHER" $ do
it "4*4 a upper all 1+i's" $ do
matvecTest1ZHER | 221 | herSpec :: Spec
herSpec =
context "?HER" $ do
describe "CHER" $ do
it "4*4 a upper all 1+i's" $ do
matvecTest1CHER
describe "ZHER" $ do
it "4*4 a upper all 1+i's" $ do
matvecTest1ZHER | 221 | herSpec =
context "?HER" $ do
describe "CHER" $ do
it "4*4 a upper all 1+i's" $ do
matvecTest1CHER
describe "ZHER" $ do
it "4*4 a upper all 1+i's" $ do
matvecTest1ZHER | 205 | false | true | 0 | 19 | 72 | 65 | 27 | 38 | null | null |
nau/lasca-compiler | src/lib/Lasca/Codegen.hs | bsd-3-clause | constRef :: AST.Type -> SBS.ShortByteString -> C.Constant
constRef tpe name = let ptr = global tpe name in C.BitCast ptr ptrType | 129 | constRef :: AST.Type -> SBS.ShortByteString -> C.Constant
constRef tpe name = let ptr = global tpe name in C.BitCast ptr ptrType | 129 | constRef tpe name = let ptr = global tpe name in C.BitCast ptr ptrType | 71 | false | true | 0 | 9 | 21 | 53 | 25 | 28 | null | null |
atwupack/LearnOpenGL | src/LOGL/Application/Window.hs | bsd-3-clause | keyPressed :: Key -> Keys -> Bool
keyPressed = member | 53 | keyPressed :: Key -> Keys -> Bool
keyPressed = member | 53 | keyPressed = member | 19 | false | true | 0 | 6 | 9 | 19 | 10 | 9 | null | null |
fferreira/hnh | Closure.hs | gpl-3.0 | newVarNum :: State CloSt Int
newVarNum = do next <- get
put $ next + 1
return next | 112 | newVarNum :: State CloSt Int
newVarNum = do next <- get
put $ next + 1
return next | 112 | newVarNum = do next <- get
put $ next + 1
return next | 83 | false | true | 0 | 8 | 47 | 40 | 18 | 22 | null | null |
haslab/SecreC | src/Language/SecreC/Prover/Base.hs | gpl-3.0 | iExprTy (IBinOp IXor e1 e2) = BaseT bool | 40 | iExprTy (IBinOp IXor e1 e2) = BaseT bool | 40 | iExprTy (IBinOp IXor e1 e2) = BaseT bool | 40 | false | false | 0 | 6 | 7 | 23 | 10 | 13 | null | null |
rueshyna/gogol | gogol-blogger/gen/Network/Google/Blogger/Types/Product.hs | mpl-2.0 | -- | ID of the Blog that the post resource belongs to.
ppuiBlogId :: Lens' PostPerUserInfo (Maybe Text)
ppuiBlogId
= lens _ppuiBlogId (\ s a -> s{_ppuiBlogId = a}) | 165 | ppuiBlogId :: Lens' PostPerUserInfo (Maybe Text)
ppuiBlogId
= lens _ppuiBlogId (\ s a -> s{_ppuiBlogId = a}) | 110 | ppuiBlogId
= lens _ppuiBlogId (\ s a -> s{_ppuiBlogId = a}) | 61 | true | true | 1 | 9 | 30 | 52 | 25 | 27 | null | null |
henrytill/hecate | src/Hecate/Configuration.hs | apache-2.0 | lup
:: T.Text
-> Getter' [(T.Text, TOML.Value)] (Maybe TOML.Value)
lup = to . lookup | 88 | lup
:: T.Text
-> Getter' [(T.Text, TOML.Value)] (Maybe TOML.Value)
lup = to . lookup | 88 | lup = to . lookup | 17 | false | true | 1 | 10 | 17 | 54 | 26 | 28 | null | null |
leshchevds/ganeti | src/Ganeti/Metad/ConfigCore.hs | bsd-2-clause | exportedFunctions :: [Name]
exportedFunctions = [ 'echo
, 'updateConfig
] | 113 | exportedFunctions :: [Name]
exportedFunctions = [ 'echo
, 'updateConfig
] | 113 | exportedFunctions = [ 'echo
, 'updateConfig
] | 85 | false | true | 0 | 5 | 49 | 22 | 14 | 8 | null | null |
v0lkan/learning-haskell | session-005/001.back-to-the-future.hs | mit | -- Strings are lists of characters with special syntax
s :: String
s = "Hello, Haskell!" | 88 | s :: String
s = "Hello, Haskell!" | 33 | s = "Hello, Haskell!" | 21 | true | true | 0 | 6 | 15 | 19 | 8 | 11 | null | null |
adept/hledger | hledger-lib/Hledger/Data/Amount.hs | gpl-3.0 | -- | Get a string representation of an amount for debugging,
-- appropriate to the current debug level. 9 shows maximum detail.
showAmountDebug :: Amount -> String
showAmountDebug Amount{acommodity="AUTO"} = "(missing)" | 219 | showAmountDebug :: Amount -> String
showAmountDebug Amount{acommodity="AUTO"} = "(missing)" | 91 | showAmountDebug Amount{acommodity="AUTO"} = "(missing)" | 55 | true | true | 0 | 8 | 30 | 29 | 16 | 13 | null | null |
gitfoxi/Language.Eval | Language/Eval.hs | gpl-2.0 | shiftl :: Bits a => a -> Integer -> a
shiftl x b = shiftL x (fromIntegral b) | 76 | shiftl :: Bits a => a -> Integer -> a
shiftl x b = shiftL x (fromIntegral b) | 76 | shiftl x b = shiftL x (fromIntegral b) | 38 | false | true | 0 | 7 | 17 | 42 | 20 | 22 | null | null |
zoomhub/zoomhub | vendor/servant/servant-server/test/Servant/ServerSpec.hs | mit | queryParamApi :: Proxy QueryParamApi
queryParamApi = Proxy | 58 | queryParamApi :: Proxy QueryParamApi
queryParamApi = Proxy | 58 | queryParamApi = Proxy | 21 | false | true | 1 | 5 | 6 | 18 | 7 | 11 | null | null |
termite2/tsl | Abstract/BFormula.hs | bsd-3-clause | fAbsVars :: (?spec::Spec) => Formula -> [AbsVar]
fAbsVars = nub . fAbsVars' | 75 | fAbsVars :: (?spec::Spec) => Formula -> [AbsVar]
fAbsVars = nub . fAbsVars' | 75 | fAbsVars = nub . fAbsVars' | 26 | false | true | 1 | 9 | 11 | 39 | 19 | 20 | null | null |
ssaavedra/liquidhaskell | benchmarks/esop2013-submission/Splay.hs | bsd-3-clause | ----------------------------------------------------------------
{-| Creating a list from a set.
>>> toList (fromList [5,3])
[3,5]
>>> toList empty
[]
-}
toList :: Splay a -> [a]
toList t = inorder t []
where
inorder Leaf xs = xs
inorder (Node x l r) xs = inorder l (x : inorder r xs)
----------------------------------------------------------------
{-| Checking if this element is a member of a set?
>>> fst $ member 5 (fromList [5,3])
True
>>> fst $ member 1 (fromList [5,3])
False
-}
{-@ member :: Ord a => a -> OSplay a -> (Bool, OSplay a) @-} | 563 | toList :: Splay a -> [a]
toList t = inorder t []
where
inorder Leaf xs = xs
inorder (Node x l r) xs = inorder l (x : inorder r xs)
----------------------------------------------------------------
{-| Checking if this element is a member of a set?
>>> fst $ member 5 (fromList [5,3])
True
>>> fst $ member 1 (fromList [5,3])
False
-}
{-@ member :: Ord a => a -> OSplay a -> (Bool, OSplay a) @-} | 406 | toList t = inorder t []
where
inorder Leaf xs = xs
inorder (Node x l r) xs = inorder l (x : inorder r xs)
----------------------------------------------------------------
{-| Checking if this element is a member of a set?
>>> fst $ member 5 (fromList [5,3])
True
>>> fst $ member 1 (fromList [5,3])
False
-}
{-@ member :: Ord a => a -> OSplay a -> (Bool, OSplay a) @-} | 381 | true | true | 0 | 8 | 109 | 86 | 44 | 42 | null | null |
kumasento/accelerate | Data/Array/Accelerate/Interpreter.hs | bsd-3-clause | evalPrim PrimOrd = evalOrd | 43 | evalPrim PrimOrd = evalOrd | 43 | evalPrim PrimOrd = evalOrd | 43 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/DiffCheck.hs | bsd-3-clause | adjustErrors :: LMap -> ChkItv -> [TError a] -> [TError a]
adjustErrors lm cm = mapMaybe adjustError
where
adjustError (ErrSaved sp m) = (`ErrSaved` m) <$> adjustSrcSpan lm cm sp
adjustError e = Just e
------------------------------------------------------------------------- | 320 | adjustErrors :: LMap -> ChkItv -> [TError a] -> [TError a]
adjustErrors lm cm = mapMaybe adjustError
where
adjustError (ErrSaved sp m) = (`ErrSaved` m) <$> adjustSrcSpan lm cm sp
adjustError e = Just e
------------------------------------------------------------------------- | 320 | adjustErrors lm cm = mapMaybe adjustError
where
adjustError (ErrSaved sp m) = (`ErrSaved` m) <$> adjustSrcSpan lm cm sp
adjustError e = Just e
------------------------------------------------------------------------- | 261 | false | true | 0 | 11 | 80 | 97 | 47 | 50 | null | null |
meiersi/scyther-proof | src/Scyther/Theory/FOL.hs | gpl-3.0 | runEncoder :: Encoder a -> (a, EncoderState)
runEncoder m = runState m emptyEncoderState | 88 | runEncoder :: Encoder a -> (a, EncoderState)
runEncoder m = runState m emptyEncoderState | 88 | runEncoder m = runState m emptyEncoderState | 43 | false | true | 0 | 8 | 12 | 37 | 17 | 20 | null | null |
nfjinjing/bench-euler | src/Math/CombinatoricsGeneration.hs | bsd-3-clause | setsums (x:xs) n | x > n = setsums xs n
| otherwise = map (x:) (setsums (x:xs) (n-x)) ++ setsums xs n | 123 | setsums (x:xs) n | x > n = setsums xs n
| otherwise = map (x:) (setsums (x:xs) (n-x)) ++ setsums xs n | 123 | setsums (x:xs) n | x > n = setsums xs n
| otherwise = map (x:) (setsums (x:xs) (n-x)) ++ setsums xs n | 123 | false | false | 1 | 10 | 44 | 84 | 41 | 43 | null | null |
pseudonom/haskell-mechanism | src/Mechanism/Examples/PublicProject.hs | agpl-3.0 | game :: DirectQuasiGame Project (Util Double) Double
game = Game utilities mechanism | 84 | game :: DirectQuasiGame Project (Util Double) Double
game = Game utilities mechanism | 84 | game = Game utilities mechanism | 31 | false | true | 1 | 7 | 11 | 32 | 14 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.