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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IreneKnapp/Faction | libfaction/Distribution/Simple/Utils.hs | bsd-3-clause | -- | Wraps a list of words to a list of lines of words of a particular width.
wrapLine :: Int -> [String] -> [[String]]
wrapLine width = wrap 0 []
where wrap :: Int -> [String] -> [String] -> [[String]]
wrap 0 [] (w:ws)
| length w + 1 > width
= wrap (length w) [w] ws
wrap col line (w:ws)
| col + length w + 1 > width
= reverse line : wrap 0 [] (w:ws)
wrap col line (w:ws)
= let col' = col + length w + 1
in wrap col' (w:line) ws
wrap _ [] [] = []
wrap _ line [] = [reverse line]
-- -----------------------------------------------------------------------------
-- rawSystem variants | 694 | wrapLine :: Int -> [String] -> [[String]]
wrapLine width = wrap 0 []
where wrap :: Int -> [String] -> [String] -> [[String]]
wrap 0 [] (w:ws)
| length w + 1 > width
= wrap (length w) [w] ws
wrap col line (w:ws)
| col + length w + 1 > width
= reverse line : wrap 0 [] (w:ws)
wrap col line (w:ws)
= let col' = col + length w + 1
in wrap col' (w:line) ws
wrap _ [] [] = []
wrap _ line [] = [reverse line]
-- -----------------------------------------------------------------------------
-- rawSystem variants | 616 | wrapLine width = wrap 0 []
where wrap :: Int -> [String] -> [String] -> [[String]]
wrap 0 [] (w:ws)
| length w + 1 > width
= wrap (length w) [w] ws
wrap col line (w:ws)
| col + length w + 1 > width
= reverse line : wrap 0 [] (w:ws)
wrap col line (w:ws)
= let col' = col + length w + 1
in wrap col' (w:line) ws
wrap _ [] [] = []
wrap _ line [] = [reverse line]
-- -----------------------------------------------------------------------------
-- rawSystem variants | 574 | true | true | 7 | 14 | 227 | 282 | 143 | 139 | null | null |
basvandijk/usb-safe | System/USB/Safe.hs | bsd-3-clause | {-| Detach a kernel driver from an interface.
If successful, you will then be able to claim the interface and perform I/O.
Exceptions:
* 'USB.NotFoundException' if no kernel driver was active.
* 'USB.InvalidParamException' if the interface does not exist.
* 'USB.NoDeviceException' if the device has been disconnected.
* Another 'USB.USBException'.
-}
detachKernelDriver ∷ (pr `AncestorRegion` cr, MonadIO cr)
⇒ RegionalDeviceHandle pr → USB.InterfaceNumber → cr ()
detachKernelDriver regionalDevHndl =
liftIO ∘ USB.detachKernelDriver (getInternalDevHndl regionalDevHndl) | 604 | detachKernelDriver ∷ (pr `AncestorRegion` cr, MonadIO cr)
⇒ RegionalDeviceHandle pr → USB.InterfaceNumber → cr ()
detachKernelDriver regionalDevHndl =
liftIO ∘ USB.detachKernelDriver (getInternalDevHndl regionalDevHndl) | 242 | detachKernelDriver regionalDevHndl =
liftIO ∘ USB.detachKernelDriver (getInternalDevHndl regionalDevHndl) | 109 | true | true | 2 | 10 | 106 | 73 | 35 | 38 | null | null |
goromlagche/gli | src/gli/types.hs | bsd-3-clause | localYmlFile :: FilePath
localYmlFile = "gli.yml" | 49 | localYmlFile :: FilePath
localYmlFile = "gli.yml" | 49 | localYmlFile = "gli.yml" | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ekmett/containers | tests/intmap-properties.hs | bsd-3-clause | test_fromListWith :: Assertion
test_fromListWith = do
fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] @?= fromList [(3, "ab"), (5, "aba")]
fromListWith (++) [] @?= (empty :: SMap) | 203 | test_fromListWith :: Assertion
test_fromListWith = do
fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] @?= fromList [(3, "ab"), (5, "aba")]
fromListWith (++) [] @?= (empty :: SMap) | 203 | test_fromListWith = do
fromListWith (++) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"a")] @?= fromList [(3, "ab"), (5, "aba")]
fromListWith (++) [] @?= (empty :: SMap) | 172 | false | true | 0 | 10 | 33 | 113 | 68 | 45 | null | null |
lefant/kurt | src/Data/Goban/Types.hs | gpl-3.0 | showColorForBoard :: Color -> String
showColorForBoard Black = "x" | 66 | showColorForBoard :: Color -> String
showColorForBoard Black = "x" | 66 | showColorForBoard Black = "x" | 29 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/ModifySnapshotAttribute.hs | mpl-2.0 | -- | The ID of the snapshot.
msaSnapshotId :: Lens' ModifySnapshotAttribute Text
msaSnapshotId = lens _msaSnapshotId (\s a -> s { _msaSnapshotId = a }) | 151 | msaSnapshotId :: Lens' ModifySnapshotAttribute Text
msaSnapshotId = lens _msaSnapshotId (\s a -> s { _msaSnapshotId = a }) | 122 | msaSnapshotId = lens _msaSnapshotId (\s a -> s { _msaSnapshotId = a }) | 70 | true | true | 1 | 9 | 24 | 44 | 22 | 22 | null | null |
k0001/gtk2hs | tools/c2hs/doc/c2hs/lib/Ptr.hs | gpl-3.0 | -- Advance a pointer by a given number of bytes
--
plusPtr :: Ptr a -> Int -> Ptr b
plusPtr (Ptr p) d = Ptr (p `primPlusPtr` d) | 138 | plusPtr :: Ptr a -> Int -> Ptr b
plusPtr (Ptr p) d = Ptr (p `primPlusPtr` d) | 87 | plusPtr (Ptr p) d = Ptr (p `primPlusPtr` d) | 44 | true | true | 0 | 10 | 39 | 51 | 26 | 25 | null | null |
eugenkiss/loopgotowhile | tests/Language/LoopGotoWhile/Goto/Transform/Tests.hs | bsd-3-clause | tests :: [Test]
tests = [ testCase "goto/transform/strict/renaming1" testStrictRenaming1
, testCase "goto/transform/strict/renaming2" testStrictRenaming2
, testCase "goto/transform/strict/renaming3" testStrictRenaming3
, testCase "goto/transform/strict/renaming4" testStrictRenaming4
, testCase "goto/transform/strict/renaming5" testStrictRenaming5
, testCase "goto/transform/strict/assignment1" testStrictAssignment1
, testCase "goto/transform/strict/assignment2" testStrictAssignment2
, testCase "goto/transform/strict/arithmetic1" testStrictArithmetic1
{-, testCase "goto/transform/strict/arithmetic2" testStrictArithmetic2-}
{-, testCase "goto/transform/strict/arithmetic3" testStrictArithmetic3-}
{-, testCase "goto/transform/strict/arithmetic4" testStrictArithmetic4-}
{-, testCase "goto/transform/strict/arithmetic5" testStrictArithmetic5-}
{-, testCase "goto/transform/strict/arithmetic6" testStrictArithmetic6-}
, testCase "goto/transform/strict/arithmetic7" testStrictArithmetic7
, testCase "goto/transform/strict/arithmetic8" testStrictArithmetic8
{-, testCase "goto/transform/strict/control1" testStrictControl1-}
{-, testCase "goto/transform/strict/control2" testStrictControl2-}
{-, testCase "goto/transform/strict/control3" testStrictControl3-}
{-, testCase "goto/transform/strict/control4" testStrictControl4-}
{-, testCase "goto/transform/strict/control5" testStrictControl5-}
{-, testCase "goto/transform/strict/control6" testStrictControl6-}
{-, testCase "goto/transform/strict/control7" testStrictControl7-}
{-, testCase "goto/transform/strict/control8" testStrictControl8-}
, testCase "goto/transform/strict/control9" testStrictControl9
, testCase "goto/transform/strict/control10" testStrictControl10
{-, testCase "goto/transform/strict/control11" testStrictControl11-}
{-, testCase "goto/transform/strict/control12" testStrictControl12-}
{-, testCase "goto/transform/strict/control13" testStrictControl13-}
, testCase "goto/transform/strict/control14" testStrictControl14
, testCase "goto/transform/strict/control15" testStrictControl15
, testCase "goto/transform/strict/control16" testStrictControl16
, testCase "goto/transform/strict/control17" testStrictControl17
, testCase "goto/transform/while/towhile1" testToWhile1
] | 2,512 | tests :: [Test]
tests = [ testCase "goto/transform/strict/renaming1" testStrictRenaming1
, testCase "goto/transform/strict/renaming2" testStrictRenaming2
, testCase "goto/transform/strict/renaming3" testStrictRenaming3
, testCase "goto/transform/strict/renaming4" testStrictRenaming4
, testCase "goto/transform/strict/renaming5" testStrictRenaming5
, testCase "goto/transform/strict/assignment1" testStrictAssignment1
, testCase "goto/transform/strict/assignment2" testStrictAssignment2
, testCase "goto/transform/strict/arithmetic1" testStrictArithmetic1
{-, testCase "goto/transform/strict/arithmetic2" testStrictArithmetic2-}
{-, testCase "goto/transform/strict/arithmetic3" testStrictArithmetic3-}
{-, testCase "goto/transform/strict/arithmetic4" testStrictArithmetic4-}
{-, testCase "goto/transform/strict/arithmetic5" testStrictArithmetic5-}
{-, testCase "goto/transform/strict/arithmetic6" testStrictArithmetic6-}
, testCase "goto/transform/strict/arithmetic7" testStrictArithmetic7
, testCase "goto/transform/strict/arithmetic8" testStrictArithmetic8
{-, testCase "goto/transform/strict/control1" testStrictControl1-}
{-, testCase "goto/transform/strict/control2" testStrictControl2-}
{-, testCase "goto/transform/strict/control3" testStrictControl3-}
{-, testCase "goto/transform/strict/control4" testStrictControl4-}
{-, testCase "goto/transform/strict/control5" testStrictControl5-}
{-, testCase "goto/transform/strict/control6" testStrictControl6-}
{-, testCase "goto/transform/strict/control7" testStrictControl7-}
{-, testCase "goto/transform/strict/control8" testStrictControl8-}
, testCase "goto/transform/strict/control9" testStrictControl9
, testCase "goto/transform/strict/control10" testStrictControl10
{-, testCase "goto/transform/strict/control11" testStrictControl11-}
{-, testCase "goto/transform/strict/control12" testStrictControl12-}
{-, testCase "goto/transform/strict/control13" testStrictControl13-}
, testCase "goto/transform/strict/control14" testStrictControl14
, testCase "goto/transform/strict/control15" testStrictControl15
, testCase "goto/transform/strict/control16" testStrictControl16
, testCase "goto/transform/strict/control17" testStrictControl17
, testCase "goto/transform/while/towhile1" testToWhile1
] | 2,512 | tests = [ testCase "goto/transform/strict/renaming1" testStrictRenaming1
, testCase "goto/transform/strict/renaming2" testStrictRenaming2
, testCase "goto/transform/strict/renaming3" testStrictRenaming3
, testCase "goto/transform/strict/renaming4" testStrictRenaming4
, testCase "goto/transform/strict/renaming5" testStrictRenaming5
, testCase "goto/transform/strict/assignment1" testStrictAssignment1
, testCase "goto/transform/strict/assignment2" testStrictAssignment2
, testCase "goto/transform/strict/arithmetic1" testStrictArithmetic1
{-, testCase "goto/transform/strict/arithmetic2" testStrictArithmetic2-}
{-, testCase "goto/transform/strict/arithmetic3" testStrictArithmetic3-}
{-, testCase "goto/transform/strict/arithmetic4" testStrictArithmetic4-}
{-, testCase "goto/transform/strict/arithmetic5" testStrictArithmetic5-}
{-, testCase "goto/transform/strict/arithmetic6" testStrictArithmetic6-}
, testCase "goto/transform/strict/arithmetic7" testStrictArithmetic7
, testCase "goto/transform/strict/arithmetic8" testStrictArithmetic8
{-, testCase "goto/transform/strict/control1" testStrictControl1-}
{-, testCase "goto/transform/strict/control2" testStrictControl2-}
{-, testCase "goto/transform/strict/control3" testStrictControl3-}
{-, testCase "goto/transform/strict/control4" testStrictControl4-}
{-, testCase "goto/transform/strict/control5" testStrictControl5-}
{-, testCase "goto/transform/strict/control6" testStrictControl6-}
{-, testCase "goto/transform/strict/control7" testStrictControl7-}
{-, testCase "goto/transform/strict/control8" testStrictControl8-}
, testCase "goto/transform/strict/control9" testStrictControl9
, testCase "goto/transform/strict/control10" testStrictControl10
{-, testCase "goto/transform/strict/control11" testStrictControl11-}
{-, testCase "goto/transform/strict/control12" testStrictControl12-}
{-, testCase "goto/transform/strict/control13" testStrictControl13-}
, testCase "goto/transform/strict/control14" testStrictControl14
, testCase "goto/transform/strict/control15" testStrictControl15
, testCase "goto/transform/strict/control16" testStrictControl16
, testCase "goto/transform/strict/control17" testStrictControl17
, testCase "goto/transform/while/towhile1" testToWhile1
] | 2,496 | false | true | 0 | 6 | 402 | 166 | 92 | 74 | null | null |
danstiner/dupes | src/Dupes/Index/Internal/SQLite.hs | mit | containsPathWithStat :: Connection -> WorkingDirectoryPath -> FileStat -> IO Bool
containsPathWithStat connection path stat = do
maybeEntry <- getEntryByPath connection path
return $
case maybeEntry of
Just (FileCacheEntry _ stat' _) -> stat == stat'
Nothing -> False | 311 | containsPathWithStat :: Connection -> WorkingDirectoryPath -> FileStat -> IO Bool
containsPathWithStat connection path stat = do
maybeEntry <- getEntryByPath connection path
return $
case maybeEntry of
Just (FileCacheEntry _ stat' _) -> stat == stat'
Nothing -> False | 311 | containsPathWithStat connection path stat = do
maybeEntry <- getEntryByPath connection path
return $
case maybeEntry of
Just (FileCacheEntry _ stat' _) -> stat == stat'
Nothing -> False | 229 | false | true | 0 | 13 | 81 | 85 | 40 | 45 | null | null |
reidwilbur/aoc2016 | src/Day7.hs | bsd-3-clause | supportsSSL :: Address -> Bool
supportsSSL addr =
let abas = concat $ map (getABAs) $ seqs addr
hnts = hnets addr
in any (any (==True)) $ map (\hnet -> map (\aba -> hasBAB aba hnet) abas) hnts | 203 | supportsSSL :: Address -> Bool
supportsSSL addr =
let abas = concat $ map (getABAs) $ seqs addr
hnts = hnets addr
in any (any (==True)) $ map (\hnet -> map (\aba -> hasBAB aba hnet) abas) hnts | 203 | supportsSSL addr =
let abas = concat $ map (getABAs) $ seqs addr
hnts = hnets addr
in any (any (==True)) $ map (\hnet -> map (\aba -> hasBAB aba hnet) abas) hnts | 172 | false | true | 0 | 12 | 48 | 107 | 52 | 55 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | Country code in which tax is applicable.
attrCountry :: Lens' AccountTaxTaxRule (Maybe Text)
attrCountry
= lens _attrCountry (\ s a -> s{_attrCountry = a}) | 162 | attrCountry :: Lens' AccountTaxTaxRule (Maybe Text)
attrCountry
= lens _attrCountry (\ s a -> s{_attrCountry = a}) | 116 | attrCountry
= lens _attrCountry (\ s a -> s{_attrCountry = a}) | 64 | true | true | 0 | 9 | 27 | 48 | 25 | 23 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'VFM.foldlM''
vfm_foldlM' = VFM.foldlM' | 43 | vfm_foldlM' = VFM.foldlM' | 25 | vfm_foldlM' = VFM.foldlM' | 25 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
jhance/gba-hs | test/Test/GBA/Thumb/T2.hs | mit | tests :: TestTree
tests = testGroup "[t2] add/sub literal or register"
[ testGroup "[t2.0] parser"
[ tasParser1
, tasParser2
, tasParser3
, tasParser4
]
, testGroup "[t2.1] add"
[ tasAdd1
, tasAdd2
, tasAdd3
, tasAdd4
]
, testGroup "[t2.2] sub"
[ tasSub1
]
] | 370 | tests :: TestTree
tests = testGroup "[t2] add/sub literal or register"
[ testGroup "[t2.0] parser"
[ tasParser1
, tasParser2
, tasParser3
, tasParser4
]
, testGroup "[t2.1] add"
[ tasAdd1
, tasAdd2
, tasAdd3
, tasAdd4
]
, testGroup "[t2.2] sub"
[ tasSub1
]
] | 370 | tests = testGroup "[t2] add/sub literal or register"
[ testGroup "[t2.0] parser"
[ tasParser1
, tasParser2
, tasParser3
, tasParser4
]
, testGroup "[t2.1] add"
[ tasAdd1
, tasAdd2
, tasAdd3
, tasAdd4
]
, testGroup "[t2.2] sub"
[ tasSub1
]
] | 352 | false | true | 0 | 7 | 156 | 68 | 38 | 30 | null | null |
GaloisInc/sk-dev-platform | libs/SCD/src/SCD/M4/CheckTypeStmt.hs | bsd-3-clause | checkInterfaceElement (InterfaceElement TemplateType _ _ _) = [] | 64 | checkInterfaceElement (InterfaceElement TemplateType _ _ _) = [] | 64 | checkInterfaceElement (InterfaceElement TemplateType _ _ _) = [] | 64 | false | false | 0 | 7 | 7 | 23 | 11 | 12 | null | null |
mainland/nikola | examples/mandelbrot/Mandelbrot/NikolaV5.hs | bsd-3-clause | withPBOResource :: GL.BufferObject -> (CUG.Resource -> IO a) -> IO a
withPBOResource pbo =
bracket (CUGL.registerBuffer pbo CUG.RegisterNone)
CUG.unregisterResource | 180 | withPBOResource :: GL.BufferObject -> (CUG.Resource -> IO a) -> IO a
withPBOResource pbo =
bracket (CUGL.registerBuffer pbo CUG.RegisterNone)
CUG.unregisterResource | 180 | withPBOResource pbo =
bracket (CUGL.registerBuffer pbo CUG.RegisterNone)
CUG.unregisterResource | 111 | false | true | 0 | 10 | 34 | 64 | 29 | 35 | null | null |
mcschroeder/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | ctEvCoercion ev = pprPanic "ctEvCoercion" (ppr ev) | 50 | ctEvCoercion ev = pprPanic "ctEvCoercion" (ppr ev) | 50 | ctEvCoercion ev = pprPanic "ctEvCoercion" (ppr ev) | 50 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
brendanhay/gogol | gogol-cloudscheduler/gen/Network/Google/Resource/CloudScheduler/Projects/Locations/Get.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
plgUploadProtocol :: Lens' ProjectsLocationsGet (Maybe Text)
plgUploadProtocol
= lens _plgUploadProtocol
(\ s a -> s{_plgUploadProtocol = a}) | 211 | plgUploadProtocol :: Lens' ProjectsLocationsGet (Maybe Text)
plgUploadProtocol
= lens _plgUploadProtocol
(\ s a -> s{_plgUploadProtocol = a}) | 149 | plgUploadProtocol
= lens _plgUploadProtocol
(\ s a -> s{_plgUploadProtocol = a}) | 88 | true | true | 0 | 8 | 33 | 49 | 25 | 24 | null | null |
Erdwolf/autotool-bonn | src/Strings/Reverse/Data.hs | gpl-2.0 | semantics :: Exp a -> [a]
semantics x = case x of
Reverse y -> reverse $ semantics y
Plus y z -> semantics y ++ semantics z
Empty -> []
Item i -> [i] | 165 | semantics :: Exp a -> [a]
semantics x = case x of
Reverse y -> reverse $ semantics y
Plus y z -> semantics y ++ semantics z
Empty -> []
Item i -> [i] | 165 | semantics x = case x of
Reverse y -> reverse $ semantics y
Plus y z -> semantics y ++ semantics z
Empty -> []
Item i -> [i] | 139 | false | true | 5 | 7 | 50 | 59 | 32 | 27 | null | null |
tfausak/threase | haskeleton.hs | mit | updateCabal :: String -> IO ()
updateCabal = updateFile cabalPath | 65 | updateCabal :: String -> IO ()
updateCabal = updateFile cabalPath | 65 | updateCabal = updateFile cabalPath | 34 | false | true | 0 | 8 | 9 | 28 | 12 | 16 | null | null |
hsyl20/HaskellPU | lib/HaskellPU/HighDataTypes.hs | lgpl-3.0 | showHighMatrix :: HighMatrix (Matrix Float) -> IO ()
showHighMatrix = traverseHighMatrix waitAndShow | 100 | showHighMatrix :: HighMatrix (Matrix Float) -> IO ()
showHighMatrix = traverseHighMatrix waitAndShow | 100 | showHighMatrix = traverseHighMatrix waitAndShow | 47 | false | true | 0 | 8 | 11 | 32 | 15 | 17 | null | null |
avieth/type-grammar | Data/Type/Grammar.hs | bsd-3-clause | -- ULTIMATELY what we want is some function
--
-- parseGrammar
-- :: Proxy recursion
-- -> ty
-- -> Proxy grammar
-- -> ParseGrammarK recursion ty grammar
--
-- and we wish to compute ParseGrammarK only once.
--
-- With the type in hand, we should be able to get away with only traversing
-- it, rather than recomputing it for product/sum cases. We just need to grab
-- the associated symbol data constructors. If we have in hand the input symbol
-- sequence, as well as the grammar type, we can analyze both of them jointly.
--
-- How will we proceed with products? Evidently, the class ParseGrammarR
-- must produce the remainder so it can feed to the next one.
-- | NB we aim to compute ParseGrammarK as few times as possible, i.e. at most
-- once. That's why we state the variable @parsed@ and give an equality.
-- GHC may complain that it's redundant, but it's not!!
--
-- Would be cool if GHC did not create the coercion between parsed
-- and the PareGrammarK term, but rather, replaced every occurrence of
-- parsed with the RHS. Does that happen? If not, why not?
parseGrammarV
:: forall term grammar parsed .
( ParseGrammarR term parsed
, parsed ~ ParseGrammarK (GrammarMatch term) grammar '[grammar]
)
=> term
-> Proxy grammar
-> parsed
parseGrammarV term proxyGrammar = parseGrammarR term (Proxy :: Proxy parsed) | 1,397 | parseGrammarV
:: forall term grammar parsed .
( ParseGrammarR term parsed
, parsed ~ ParseGrammarK (GrammarMatch term) grammar '[grammar]
)
=> term
-> Proxy grammar
-> parsed
parseGrammarV term proxyGrammar = parseGrammarR term (Proxy :: Proxy parsed) | 288 | parseGrammarV term proxyGrammar = parseGrammarR term (Proxy :: Proxy parsed) | 76 | true | true | 0 | 12 | 309 | 114 | 69 | 45 | null | null |
ajmccluskey/visp-usage | src/VispUsage/Fetcher.hs | bsd-3-clause | fetch :: IO (Either Error (Text, Text))
fetch = do
mAuth <- mkAuth authFile
case mAuth of
Just auth -> getTwoMonthsUsage auth >>= return . Right
_ -> return $ Left NoAuth | 190 | fetch :: IO (Either Error (Text, Text))
fetch = do
mAuth <- mkAuth authFile
case mAuth of
Just auth -> getTwoMonthsUsage auth >>= return . Right
_ -> return $ Left NoAuth | 190 | fetch = do
mAuth <- mkAuth authFile
case mAuth of
Just auth -> getTwoMonthsUsage auth >>= return . Right
_ -> return $ Left NoAuth | 150 | false | true | 0 | 12 | 51 | 78 | 37 | 41 | null | null |
rleshchinskiy/vector | Data/Vector/Unboxed.hs | bsd-3-clause | foldr1 = G.foldr1 | 17 | foldr1 = G.foldr1 | 17 | foldr1 = G.foldr1 | 17 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
mikebenfield/ftensor | test/Tests/Math/Ftensor/General.hs | isc | case_index_4 = index m1 (0:-0:-N) @?= 1 | 39 | case_index_4 = index m1 (0:-0:-N) @?= 1 | 39 | case_index_4 = index m1 (0:-0:-N) @?= 1 | 39 | false | false | 2 | 8 | 6 | 31 | 13 | 18 | null | null |
ezyang/ghc | compiler/utils/Util.hs | bsd-3-clause | filterByList _ _ = [] | 35 | filterByList _ _ = [] | 35 | filterByList _ _ = [] | 35 | false | false | 0 | 5 | 18 | 13 | 6 | 7 | null | null |
oist/aws-scheduler | MysqlRequests.hs | mit | unavail :: IO [(Int, String)] -- slot ID, prof ID
unavail = do info <- getConnectionInfo
conn <- connectMySQL info
map extract <$> quickQuery' conn sql_unavail []
where extract :: [SqlValue] -> (Int, String)
extract [a,b] = (fromSql a, fromSql b) | 290 | unavail :: IO [(Int, String)]
unavail = do info <- getConnectionInfo
conn <- connectMySQL info
map extract <$> quickQuery' conn sql_unavail []
where extract :: [SqlValue] -> (Int, String)
extract [a,b] = (fromSql a, fromSql b) | 270 | unavail = do info <- getConnectionInfo
conn <- connectMySQL info
map extract <$> quickQuery' conn sql_unavail []
where extract :: [SqlValue] -> (Int, String)
extract [a,b] = (fromSql a, fromSql b) | 240 | true | true | 0 | 9 | 84 | 106 | 55 | 51 | null | null |
ekr/tamarin-prover | lib/theory/src/Theory/Model/Rule.hs | gpl-3.0 | getRuleName :: HasRuleName (Rule i) => Rule i -> String
getRuleName ru = case ruleName ru of
IntrInfo i -> case i of
ConstrRule x -> "Constr" ++ (prefixIfReserved ('c' : BC.unpack x))
DestrRule x -> "Destr" ++ (prefixIfReserved ('d' : BC.unpack x))
CoerceRule -> "Coerce"
IRecvRule -> "Recv"
ISendRule -> "Send"
PubConstrRule -> "PubConstr"
FreshConstrRule -> "FreshConstr"
IEqualityRule -> "Equality"
ProtoInfo p -> case p of
FreshRule -> "FreshRule"
StandRule s -> s
-- | Returns a protocol rule's name | 960 | getRuleName :: HasRuleName (Rule i) => Rule i -> String
getRuleName ru = case ruleName ru of
IntrInfo i -> case i of
ConstrRule x -> "Constr" ++ (prefixIfReserved ('c' : BC.unpack x))
DestrRule x -> "Destr" ++ (prefixIfReserved ('d' : BC.unpack x))
CoerceRule -> "Coerce"
IRecvRule -> "Recv"
ISendRule -> "Send"
PubConstrRule -> "PubConstr"
FreshConstrRule -> "FreshConstr"
IEqualityRule -> "Equality"
ProtoInfo p -> case p of
FreshRule -> "FreshRule"
StandRule s -> s
-- | Returns a protocol rule's name | 960 | getRuleName ru = case ruleName ru of
IntrInfo i -> case i of
ConstrRule x -> "Constr" ++ (prefixIfReserved ('c' : BC.unpack x))
DestrRule x -> "Destr" ++ (prefixIfReserved ('d' : BC.unpack x))
CoerceRule -> "Coerce"
IRecvRule -> "Recv"
ISendRule -> "Send"
PubConstrRule -> "PubConstr"
FreshConstrRule -> "FreshConstr"
IEqualityRule -> "Equality"
ProtoInfo p -> case p of
FreshRule -> "FreshRule"
StandRule s -> s
-- | Returns a protocol rule's name | 904 | false | true | 0 | 17 | 536 | 187 | 88 | 99 | null | null |
vTurbine/ghc | compiler/typecheck/TcBinds.hs | bsd-3-clause | tcLhsId :: TcSigFun -> LetBndrSpec -> Name -> TcM MonoBindInfo
tcLhsId sig_fn no_gen name
| Just (TcIdSig sig) <- sig_fn name
= -- A partial type signature on a FunBind, in a mixed group
-- e.g. f :: _ -> _
-- f x = ...g...
-- Just g = ...f...
-- Hence always typechecked with InferGen; hence LetLclBndr
--
-- A compelete type sig on a FunBind is checked with CheckGen
-- and does not go via tcLhsId
do { inst_sig <- tcInstSig sig
; the_id <- newSigLetBndr no_gen name inst_sig
; return (MBI { mbi_poly_name = name
, mbi_sig = Just inst_sig
, mbi_mono_id = the_id }) }
| otherwise
= -- No type signature, plan InferGen (LetLclBndr) or NoGen (LetGblBndr)
do { mono_ty <- newOpenFlexiTyVarTy
; mono_id <- newLetBndr no_gen name mono_ty
; return (MBI { mbi_poly_name = name
, mbi_sig = Nothing
, mbi_mono_id = mono_id }) } | 1,017 | tcLhsId :: TcSigFun -> LetBndrSpec -> Name -> TcM MonoBindInfo
tcLhsId sig_fn no_gen name
| Just (TcIdSig sig) <- sig_fn name
= -- A partial type signature on a FunBind, in a mixed group
-- e.g. f :: _ -> _
-- f x = ...g...
-- Just g = ...f...
-- Hence always typechecked with InferGen; hence LetLclBndr
--
-- A compelete type sig on a FunBind is checked with CheckGen
-- and does not go via tcLhsId
do { inst_sig <- tcInstSig sig
; the_id <- newSigLetBndr no_gen name inst_sig
; return (MBI { mbi_poly_name = name
, mbi_sig = Just inst_sig
, mbi_mono_id = the_id }) }
| otherwise
= -- No type signature, plan InferGen (LetLclBndr) or NoGen (LetGblBndr)
do { mono_ty <- newOpenFlexiTyVarTy
; mono_id <- newLetBndr no_gen name mono_ty
; return (MBI { mbi_poly_name = name
, mbi_sig = Nothing
, mbi_mono_id = mono_id }) } | 1,017 | tcLhsId sig_fn no_gen name
| Just (TcIdSig sig) <- sig_fn name
= -- A partial type signature on a FunBind, in a mixed group
-- e.g. f :: _ -> _
-- f x = ...g...
-- Just g = ...f...
-- Hence always typechecked with InferGen; hence LetLclBndr
--
-- A compelete type sig on a FunBind is checked with CheckGen
-- and does not go via tcLhsId
do { inst_sig <- tcInstSig sig
; the_id <- newSigLetBndr no_gen name inst_sig
; return (MBI { mbi_poly_name = name
, mbi_sig = Just inst_sig
, mbi_mono_id = the_id }) }
| otherwise
= -- No type signature, plan InferGen (LetLclBndr) or NoGen (LetGblBndr)
do { mono_ty <- newOpenFlexiTyVarTy
; mono_id <- newLetBndr no_gen name mono_ty
; return (MBI { mbi_poly_name = name
, mbi_sig = Nothing
, mbi_mono_id = mono_id }) } | 954 | false | true | 0 | 12 | 349 | 194 | 102 | 92 | null | null |
sapek/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | -- not "div"
t1 `closes` t2 |
t1 `elem` blockTags &&
t2 `notElem` (blockTags ++ eitherBlockOrInline) = True | 113 | t1 `closes` t2 |
t1 `elem` blockTags &&
t2 `notElem` (blockTags ++ eitherBlockOrInline) = True | 100 | t1 `closes` t2 |
t1 `elem` blockTags &&
t2 `notElem` (blockTags ++ eitherBlockOrInline) = True | 100 | true | false | 0 | 10 | 23 | 44 | 24 | 20 | null | null |
elieux/ghc | compiler/rename/RnTypes.hs | bsd-3-clause | extract_tv :: RdrName -> FreeKiTyVars -> FreeKiTyVars
extract_tv tv acc
| isRdrTyVar tv = case acc of (kvs,tvs) -> (kvs, tv : tvs)
| otherwise = acc | 156 | extract_tv :: RdrName -> FreeKiTyVars -> FreeKiTyVars
extract_tv tv acc
| isRdrTyVar tv = case acc of (kvs,tvs) -> (kvs, tv : tvs)
| otherwise = acc | 156 | extract_tv tv acc
| isRdrTyVar tv = case acc of (kvs,tvs) -> (kvs, tv : tvs)
| otherwise = acc | 102 | false | true | 1 | 10 | 34 | 69 | 34 | 35 | null | null |
tilltheis/propositional-logic | src/PropositionalLogic/Logic.hs | bsd-3-clause | reconnect f (Disjunction x y) = f x y | 37 | reconnect f (Disjunction x y) = f x y | 37 | reconnect f (Disjunction x y) = f x y | 37 | false | false | 0 | 7 | 8 | 24 | 11 | 13 | null | null |
alanz/haxl-play | src/simple.hs | unlicense | getResult :: Request a -> IO (Result a)
getResult req = undefined | 65 | getResult :: Request a -> IO (Result a)
getResult req = undefined | 65 | getResult req = undefined | 25 | false | true | 0 | 8 | 11 | 30 | 14 | 16 | null | null |
pgj/bead | src/Bead/Controller/UserStories.hs | bsd-3-clause | unsubscribeFromCourse :: GroupKey -> UserStory ()
unsubscribeFromCourse gk = logAction INFO ("unsubscribes from group: " ++ show gk) $ do
u <- username
join $ persistence $ do
registered <- Persist.isUserInGroup u gk
case registered of
False -> return . errorPage . userError $ msg_UserStoryError_NoGroupAdminOfGroup "You are not group admin for the group."
True -> do
ck <- Persist.courseOfGroup gk
s <- (&&) <$> Persist.isThereASubmissionForGroup u gk
<*> Persist.isThereASubmissionForCourse u ck
if s then (return . errorPage . userError $ msg_UserStoryError_AlreadyHasSubmission "You have already submitted some solution for the assignments of the course.")
else do
Persist.unsubscribe u ck gk
return . putStatusMessage $
msg_UserStory_SuccessfulCourseUnsubscription "Unregistration was successful."
-- | Adds a new group to the given course | 972 | unsubscribeFromCourse :: GroupKey -> UserStory ()
unsubscribeFromCourse gk = logAction INFO ("unsubscribes from group: " ++ show gk) $ do
u <- username
join $ persistence $ do
registered <- Persist.isUserInGroup u gk
case registered of
False -> return . errorPage . userError $ msg_UserStoryError_NoGroupAdminOfGroup "You are not group admin for the group."
True -> do
ck <- Persist.courseOfGroup gk
s <- (&&) <$> Persist.isThereASubmissionForGroup u gk
<*> Persist.isThereASubmissionForCourse u ck
if s then (return . errorPage . userError $ msg_UserStoryError_AlreadyHasSubmission "You have already submitted some solution for the assignments of the course.")
else do
Persist.unsubscribe u ck gk
return . putStatusMessage $
msg_UserStory_SuccessfulCourseUnsubscription "Unregistration was successful."
-- | Adds a new group to the given course | 972 | unsubscribeFromCourse gk = logAction INFO ("unsubscribes from group: " ++ show gk) $ do
u <- username
join $ persistence $ do
registered <- Persist.isUserInGroup u gk
case registered of
False -> return . errorPage . userError $ msg_UserStoryError_NoGroupAdminOfGroup "You are not group admin for the group."
True -> do
ck <- Persist.courseOfGroup gk
s <- (&&) <$> Persist.isThereASubmissionForGroup u gk
<*> Persist.isThereASubmissionForCourse u ck
if s then (return . errorPage . userError $ msg_UserStoryError_AlreadyHasSubmission "You have already submitted some solution for the assignments of the course.")
else do
Persist.unsubscribe u ck gk
return . putStatusMessage $
msg_UserStory_SuccessfulCourseUnsubscription "Unregistration was successful."
-- | Adds a new group to the given course | 922 | false | true | 0 | 20 | 243 | 207 | 97 | 110 | null | null |
brendanhay/gogol | gogol-firebasehosting/gen/Network/Google/Resource/FirebaseHosting/Sites/Domains/Get.hs | mpl-2.0 | -- | OAuth access token.
sdgAccessToken :: Lens' SitesDomainsGet (Maybe Text)
sdgAccessToken
= lens _sdgAccessToken
(\ s a -> s{_sdgAccessToken = a}) | 157 | sdgAccessToken :: Lens' SitesDomainsGet (Maybe Text)
sdgAccessToken
= lens _sdgAccessToken
(\ s a -> s{_sdgAccessToken = a}) | 132 | sdgAccessToken
= lens _sdgAccessToken
(\ s a -> s{_sdgAccessToken = a}) | 79 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
megantti/rtorrent-cli | Main.hs | mit | filesRequired :: Bool -> Opts -> Bool
filesRequired doShow opts = (doShow && showFiles opts) || check (cmd opts)
where
check (Just (CExec _ _)) = True
check _ = False | 176 | filesRequired :: Bool -> Opts -> Bool
filesRequired doShow opts = (doShow && showFiles opts) || check (cmd opts)
where
check (Just (CExec _ _)) = True
check _ = False | 176 | filesRequired doShow opts = (doShow && showFiles opts) || check (cmd opts)
where
check (Just (CExec _ _)) = True
check _ = False | 138 | false | true | 0 | 8 | 40 | 88 | 40 | 48 | null | null |
MyForteIsTimeTravel/HaskellEngine | src/Window.hs | bsd-3-clause | -- | height of render window
-------------------------------------
-- | render target
-------------------------------------
window :: Display; window = InWindow "HaskellEngine" (width, height) (10, 10) | 202 | window :: Display
window = InWindow "HaskellEngine" (width, height) (10, 10) | 76 | window = InWindow "HaskellEngine" (width, height) (10, 10) | 58 | true | true | 3 | 6 | 23 | 43 | 22 | 21 | null | null |
djoyner/hap-probe-rrd-writer | src/RRD.hs | bsd-3-clause | filePath = T.unpack . rrdFilename | 33 | filePath = T.unpack . rrdFilename | 33 | filePath = T.unpack . rrdFilename | 33 | false | false | 2 | 5 | 4 | 17 | 6 | 11 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/Utility/Matrix.hs | bsd-3-clause | cropMat :: Int -- ^ crop width = @w@
-> Int -- ^ crop height = @h@
-> Int -- ^ X start position = @x0@
-> Int -- ^ Y start position = @y0@
-> Matrix a -- ^ /size/ = @(xa,ya)@
-> Matrix a -- ^ /size/ = @(minimum [w,xa-x0], minimum [h,xa-x0])@
cropMat w h pX pY = takeMat w h . dropMat pX pY | 350 | cropMat :: Int -- ^ crop width = @w@
-> Int -- ^ crop height = @h@
-> Int -- ^ X start position = @x0@
-> Int -- ^ Y start position = @y0@
-> Matrix a -- ^ /size/ = @(xa,ya)@
-> Matrix a
cropMat w h pX pY = takeMat w h . dropMat pX pY | 295 | cropMat w h pX pY = takeMat w h . dropMat pX pY | 47 | true | true | 0 | 10 | 127 | 66 | 34 | 32 | null | null |
dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | The Berkshelf version.
ccBerkshelfVersion :: Lens' ChefConfiguration (Maybe Text)
ccBerkshelfVersion =
lens _ccBerkshelfVersion (\s a -> s { _ccBerkshelfVersion = a }) | 176 | ccBerkshelfVersion :: Lens' ChefConfiguration (Maybe Text)
ccBerkshelfVersion =
lens _ccBerkshelfVersion (\s a -> s { _ccBerkshelfVersion = a }) | 148 | ccBerkshelfVersion =
lens _ccBerkshelfVersion (\s a -> s { _ccBerkshelfVersion = a }) | 89 | true | true | 0 | 9 | 27 | 46 | 25 | 21 | null | null |
matonix/pfds | src/PFDS/Sec3/Ex7.hs | bsd-3-clause | mrg [] ts2 = ts2 | 16 | mrg [] ts2 = ts2 | 16 | mrg [] ts2 = ts2 | 16 | false | false | 1 | 5 | 4 | 18 | 6 | 12 | null | null |
romanb/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/UpdateEnvironment.hs | mpl-2.0 | -- | The name of the 'SolutionStack' deployed with this environment.
uerSolutionStackName :: Lens' UpdateEnvironmentResponse (Maybe Text)
uerSolutionStackName =
lens _uerSolutionStackName (\s a -> s { _uerSolutionStackName = a }) | 233 | uerSolutionStackName :: Lens' UpdateEnvironmentResponse (Maybe Text)
uerSolutionStackName =
lens _uerSolutionStackName (\s a -> s { _uerSolutionStackName = a }) | 164 | uerSolutionStackName =
lens _uerSolutionStackName (\s a -> s { _uerSolutionStackName = a }) | 95 | true | true | 0 | 9 | 33 | 46 | 25 | 21 | null | null |
sawatani/bitcoin-hall | src/Fathens/Bitcoin/Wallet/Keys.hs | gpl-3.0 | (@+) :: EC.Point -> EC.Point -> EC.Point
(@+) a b = pointAdd curve a b | 70 | (@+) :: EC.Point -> EC.Point -> EC.Point
(@+) a b = pointAdd curve a b | 70 | (@+) a b = pointAdd curve a b | 29 | false | true | 0 | 9 | 14 | 47 | 23 | 24 | null | null |
rueshyna/gogol | gogol-deploymentmanager/gen/Network/Google/DeploymentManager/Types/Product.hs | mpl-2.0 | -- | Trusted attributes discharged by the service.
cSvc :: Lens' Condition (Maybe Text)
cSvc = lens _cSvc (\ s a -> s{_cSvc = a}) | 129 | cSvc :: Lens' Condition (Maybe Text)
cSvc = lens _cSvc (\ s a -> s{_cSvc = a}) | 78 | cSvc = lens _cSvc (\ s a -> s{_cSvc = a}) | 41 | true | true | 0 | 9 | 24 | 46 | 25 | 21 | null | null |
acowley/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | pprTcTyVarDetails (FlatSkol {}) = ptext (sLit "fsk") | 55 | pprTcTyVarDetails (FlatSkol {}) = ptext (sLit "fsk") | 55 | pprTcTyVarDetails (FlatSkol {}) = ptext (sLit "fsk") | 55 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
pgj/bead | src/Bead/Controller/Pages.hs | bsd-3-clause | newGroupAssignmentPreview gk = UserView . NewGroupAssignmentPreview gk | 71 | newGroupAssignmentPreview gk = UserView . NewGroupAssignmentPreview gk | 71 | newGroupAssignmentPreview gk = UserView . NewGroupAssignmentPreview gk | 71 | false | false | 0 | 6 | 7 | 16 | 7 | 9 | null | null |
pxqr/algorithm-wm | src/Program.hs | mit | isEmptyProgram :: Program -> Bool
isEmptyProgram (Program []) = True | 68 | isEmptyProgram :: Program -> Bool
isEmptyProgram (Program []) = True | 68 | isEmptyProgram (Program []) = True | 34 | false | true | 0 | 8 | 9 | 26 | 13 | 13 | null | null |
flipstone/orville | orville-postgresql/test/PopperTest.hs | mit | leafTable :: O.TableDefinition Leaf Leaf LeafId
leafTable =
O.mkTableDefinition $
O.TableParams
{ O.tblName = "leaf"
, O.tblPrimaryKey = O.primaryKey leafIdField
, O.tblMapper =
Leaf <$> O.attrField leafId leafIdField <*>
O.attrField leafBranchId branchForeignIdField
, O.tblGetKey = leafId
, O.tblSafeToDelete = []
, O.tblComments = O.noComments
} | 396 | leafTable :: O.TableDefinition Leaf Leaf LeafId
leafTable =
O.mkTableDefinition $
O.TableParams
{ O.tblName = "leaf"
, O.tblPrimaryKey = O.primaryKey leafIdField
, O.tblMapper =
Leaf <$> O.attrField leafId leafIdField <*>
O.attrField leafBranchId branchForeignIdField
, O.tblGetKey = leafId
, O.tblSafeToDelete = []
, O.tblComments = O.noComments
} | 396 | leafTable =
O.mkTableDefinition $
O.TableParams
{ O.tblName = "leaf"
, O.tblPrimaryKey = O.primaryKey leafIdField
, O.tblMapper =
Leaf <$> O.attrField leafId leafIdField <*>
O.attrField leafBranchId branchForeignIdField
, O.tblGetKey = leafId
, O.tblSafeToDelete = []
, O.tblComments = O.noComments
} | 348 | false | true | 0 | 11 | 92 | 113 | 60 | 53 | null | null |
NightElfik/L-systems-in-Haskell | src/LSystem/DataTypes.hs | unlicense | evalSymbol :: SymbolExpr -> SymbolDouble
evalSymbol = evalSymbolVar [] | 70 | evalSymbol :: SymbolExpr -> SymbolDouble
evalSymbol = evalSymbolVar [] | 70 | evalSymbol = evalSymbolVar [] | 29 | false | true | 0 | 7 | 8 | 27 | 11 | 16 | null | null |
ezyang/ghc | libraries/base/Foreign/C/Error.hs | bsd-3-clause | eNOSYS = Errno (CONST_ENOSYS) | 38 | eNOSYS = Errno (CONST_ENOSYS) | 38 | eNOSYS = Errno (CONST_ENOSYS) | 38 | false | false | 0 | 6 | 12 | 12 | 6 | 6 | null | null |
olsner/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprMatchContextNoun :: (Outputable (NameOrRdrName id),Outputable id)
=> HsMatchContext id -> SDoc
pprMatchContextNoun (FunRhs (L _ fun) _) = text "equation for"
<+> quotes (ppr fun) | 239 | pprMatchContextNoun :: (Outputable (NameOrRdrName id),Outputable id)
=> HsMatchContext id -> SDoc
pprMatchContextNoun (FunRhs (L _ fun) _) = text "equation for"
<+> quotes (ppr fun) | 239 | pprMatchContextNoun (FunRhs (L _ fun) _) = text "equation for"
<+> quotes (ppr fun) | 121 | false | true | 0 | 9 | 82 | 74 | 36 | 38 | null | null |
noughtmare/yi | yi-core/src/Yi/MiniBuffer.hs | gpl-2.0 | -- | Prompts for a buffer name, turns it into a 'BufferRef' and passes
-- it on to the handler function. Uses all known buffers for hinting.
promptingForBuffer :: T.Text -- ^ Prompt
-> (BufferRef -> YiM ()) -- ^ Handler
-> ([BufferRef] -> [BufferRef] -> [BufferRef])
-- ^ Hint pre-processor. It takes the list of open
-- buffers and a list of all buffers, and should
-- spit out all the buffers to possibly hint, in
-- the wanted order. Note the hinter uses name
-- prefix for filtering regardless of what you do
-- here.
-> YiM ()
promptingForBuffer prompt act hh = do
openBufs <- fmap bufkey . toList <$> use windowsA
names <- withEditor $ do
bs <- toList . fmap bkey <$> getBufferStack
let choices = hh openBufs bs
prefix <- gets commonNamePrefix
forM choices $ \k ->
gets (shortIdentString (length prefix) . findBufferWith k)
withMinibufferFin prompt names (withEditor . getBufferWithName >=> act)
-- | Prompts the user for comment syntax to use for the current mode. | 1,187 | promptingForBuffer :: T.Text -- ^ Prompt
-> (BufferRef -> YiM ()) -- ^ Handler
-> ([BufferRef] -> [BufferRef] -> [BufferRef])
-- ^ Hint pre-processor. It takes the list of open
-- buffers and a list of all buffers, and should
-- spit out all the buffers to possibly hint, in
-- the wanted order. Note the hinter uses name
-- prefix for filtering regardless of what you do
-- here.
-> YiM ()
promptingForBuffer prompt act hh = do
openBufs <- fmap bufkey . toList <$> use windowsA
names <- withEditor $ do
bs <- toList . fmap bkey <$> getBufferStack
let choices = hh openBufs bs
prefix <- gets commonNamePrefix
forM choices $ \k ->
gets (shortIdentString (length prefix) . findBufferWith k)
withMinibufferFin prompt names (withEditor . getBufferWithName >=> act)
-- | Prompts the user for comment syntax to use for the current mode. | 1,046 | promptingForBuffer prompt act hh = do
openBufs <- fmap bufkey . toList <$> use windowsA
names <- withEditor $ do
bs <- toList . fmap bkey <$> getBufferStack
let choices = hh openBufs bs
prefix <- gets commonNamePrefix
forM choices $ \k ->
gets (shortIdentString (length prefix) . findBufferWith k)
withMinibufferFin prompt names (withEditor . getBufferWithName >=> act)
-- | Prompts the user for comment syntax to use for the current mode. | 484 | true | true | 0 | 18 | 387 | 212 | 106 | 106 | null | null |
bcoppens/HaskellSshClient | src/Ssh/Cryption.hs | gpl-3.0 | padTo :: Int -> Word8 -> [Word8] -> [Word8]
padTo to with l = (replicate (to - length l) with) ++ l | 99 | padTo :: Int -> Word8 -> [Word8] -> [Word8]
padTo to with l = (replicate (to - length l) with) ++ l | 99 | padTo to with l = (replicate (to - length l) with) ++ l | 55 | false | true | 0 | 10 | 21 | 58 | 30 | 28 | null | null |
themad/hmpf | src/Main.hs | gpl-3.0 | playlists :: ServerPartT IO Response
playlists = msum [ playlistsIndex, restPath playlistsLoad ] | 96 | playlists :: ServerPartT IO Response
playlists = msum [ playlistsIndex, restPath playlistsLoad ] | 96 | playlists = msum [ playlistsIndex, restPath playlistsLoad ] | 59 | false | true | 1 | 7 | 12 | 32 | 14 | 18 | null | null |
bitemyapp/hakaru | Language/Hakaru/Parser/Parser.hs | bsd-3-clause | beta_ :: Parser Dist
beta_ = do
reserved "beta"
Pair a (Pair b Unit) <- pairs
return $ Beta a b | 104 | beta_ :: Parser Dist
beta_ = do
reserved "beta"
Pair a (Pair b Unit) <- pairs
return $ Beta a b | 104 | beta_ = do
reserved "beta"
Pair a (Pair b Unit) <- pairs
return $ Beta a b | 83 | false | true | 0 | 11 | 29 | 58 | 24 | 34 | null | null |
enolan/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | processModuleDocs :: Archive -> Idris ()
processModuleDocs ar = do
ds <- getEntry [] "ibc_moduledocs" ar
mapM_ (\ (n, d) -> updateIState (\i ->
i { idris_moduledocs = addDef n d (idris_moduledocs i) })) ds | 226 | processModuleDocs :: Archive -> Idris ()
processModuleDocs ar = do
ds <- getEntry [] "ibc_moduledocs" ar
mapM_ (\ (n, d) -> updateIState (\i ->
i { idris_moduledocs = addDef n d (idris_moduledocs i) })) ds | 226 | processModuleDocs ar = do
ds <- getEntry [] "ibc_moduledocs" ar
mapM_ (\ (n, d) -> updateIState (\i ->
i { idris_moduledocs = addDef n d (idris_moduledocs i) })) ds | 185 | false | true | 0 | 17 | 55 | 93 | 47 | 46 | null | null |
vincenthz/hs-foundation | foundation/Foundation/Check/Config.hs | bsd-3-clause | parseArgs :: [String] -> Config -> Either ParamError Config
parseArgs [] cfg = Right cfg | 105 | parseArgs :: [String] -> Config -> Either ParamError Config
parseArgs [] cfg = Right cfg | 105 | parseArgs [] cfg = Right cfg | 45 | false | true | 0 | 7 | 31 | 37 | 18 | 19 | null | null |
ekalosak/haskell-practice | pr8.hs | lgpl-3.0 | -- Compress
nnon :: (Eq a) => [a] -> a -> [a]
nnon [] a = [] | 61 | nnon :: (Eq a) => [a] -> a -> [a]
nnon [] a = [] | 48 | nnon [] a = [] | 14 | true | true | 0 | 10 | 17 | 50 | 25 | 25 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | jobQueueSizeHardLimit :: Int
jobQueueSizeHardLimit = 5000 | 57 | jobQueueSizeHardLimit :: Int
jobQueueSizeHardLimit = 5000 | 57 | jobQueueSizeHardLimit = 5000 | 28 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
philopon/apiary-benchmark | src/yesod.hs | mit | handleNum39R :: Handler TypedContent; handleNum39R = returnBS "deep" | 68 | handleNum39R :: Handler TypedContent
handleNum39R = returnBS "deep" | 67 | handleNum39R = returnBS "deep" | 30 | false | true | 1 | 5 | 7 | 21 | 9 | 12 | null | null |
patrickherrmann/advent | src/Day18.hs | bsd-3-clause | standardRules :: Grid -> Coord -> Bool
standardRules g c = shouldStayOn || shouldTurnOn
where
currentState = g ! c
shouldStayOn = currentState && neighborsActive `elem` [2, 3]
shouldTurnOn = not currentState && neighborsActive == 3
neighborsActive = length $ filter id $ map (g !) $ neighbors c | 312 | standardRules :: Grid -> Coord -> Bool
standardRules g c = shouldStayOn || shouldTurnOn
where
currentState = g ! c
shouldStayOn = currentState && neighborsActive `elem` [2, 3]
shouldTurnOn = not currentState && neighborsActive == 3
neighborsActive = length $ filter id $ map (g !) $ neighbors c | 312 | standardRules g c = shouldStayOn || shouldTurnOn
where
currentState = g ! c
shouldStayOn = currentState && neighborsActive `elem` [2, 3]
shouldTurnOn = not currentState && neighborsActive == 3
neighborsActive = length $ filter id $ map (g !) $ neighbors c | 273 | false | true | 0 | 8 | 66 | 107 | 56 | 51 | null | null |
keithduncan/logplex-parse | src/Text/Syslog/Parser.hs | mit | procid = nilvalue <|> countBetween 1 128 printascii <?> "process id" | 68 | procid = nilvalue <|> countBetween 1 128 printascii <?> "process id" | 68 | procid = nilvalue <|> countBetween 1 128 printascii <?> "process id" | 68 | false | false | 0 | 7 | 10 | 21 | 10 | 11 | null | null |
byorgey/BlogLiterately | src/Text/BlogLiterately/Image.hs | gpl-3.0 | -- | Read the list of previously uploaded images and their associated URLs from
-- a special dotfile (namely, @.BlogLiterately-uploaded-images@).
readUploadedImages :: IO (M.Map FilePath URL)
readUploadedImages = do
e <- doesFileExist uploadedImagesFile
case e of
False -> return M.empty
True -> do
txt <- readFile uploadedImagesFile
let m = fromMaybe (M.empty) (readMay txt)
length txt `seq` return m | 434 | readUploadedImages :: IO (M.Map FilePath URL)
readUploadedImages = do
e <- doesFileExist uploadedImagesFile
case e of
False -> return M.empty
True -> do
txt <- readFile uploadedImagesFile
let m = fromMaybe (M.empty) (readMay txt)
length txt `seq` return m | 286 | readUploadedImages = do
e <- doesFileExist uploadedImagesFile
case e of
False -> return M.empty
True -> do
txt <- readFile uploadedImagesFile
let m = fromMaybe (M.empty) (readMay txt)
length txt `seq` return m | 240 | true | true | 0 | 17 | 91 | 110 | 52 | 58 | null | null |
limansky/wbxml | src/Wbxml/Tables.hs | bsd-3-clause | wml13Root = "wml" | 17 | wml13Root = "wml" | 17 | wml13Root = "wml" | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
lihuanglx/disjoint-intersection | src/Source/Syntax.hs | bsd-3-clause | ebindt :: Alpha a => (String, a) -> Expr -> Bind (TmName, Embed a) Expr
ebindt (n, e1) = bind (s2n n, embed e1) | 111 | ebindt :: Alpha a => (String, a) -> Expr -> Bind (TmName, Embed a) Expr
ebindt (n, e1) = bind (s2n n, embed e1) | 111 | ebindt (n, e1) = bind (s2n n, embed e1) | 39 | false | true | 0 | 10 | 23 | 74 | 37 | 37 | null | null |
ghc-android/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | proxyPrimTyConKey :: Unique
proxyPrimTyConKey = mkPreludeTyConUnique 176 | 72 | proxyPrimTyConKey :: Unique
proxyPrimTyConKey = mkPreludeTyConUnique 176 | 72 | proxyPrimTyConKey = mkPreludeTyConUnique 176 | 44 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
michalkonecny/aern | aern-double/src/Numeric/AERN/DoubleBasis/Interval.hs | bsd-3-clause | -- | Convenience Unicode notation for 'top'
(⊤) :: DI
(⊤) = (BRO.⊤) sampleDI | 76 | (⊤) :: DI
(⊤) = (BRO.⊤) sampleDI | 32 | (⊤) = (BRO.⊤) sampleDI | 22 | true | true | 0 | 6 | 13 | 23 | 15 | 8 | null | null |
jeffreyrosenbluth/flourine | src/Fluorine/HTML.hs | bsd-3-clause | html :: [A.Attr i] -> [HTML i] -> HTML i
html xs = element (tagName "html") xs | 78 | html :: [A.Attr i] -> [HTML i] -> HTML i
html xs = element (tagName "html") xs | 78 | html xs = element (tagName "html") xs | 37 | false | true | 0 | 9 | 16 | 56 | 25 | 31 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | nicsParameters :: FrozenSet String
nicsParameters = ConstantUtils.mkSet (Map.keys nicsParameterTypes) | 101 | nicsParameters :: FrozenSet String
nicsParameters = ConstantUtils.mkSet (Map.keys nicsParameterTypes) | 101 | nicsParameters = ConstantUtils.mkSet (Map.keys nicsParameterTypes) | 66 | false | true | 0 | 8 | 8 | 27 | 13 | 14 | null | null |
chwarr/bond | compiler/src/Language/Bond/Codegen/Java/Util.hs | mit | isPrimitiveNonEnumBondType BT_UInt32 = True | 43 | isPrimitiveNonEnumBondType BT_UInt32 = True | 43 | isPrimitiveNonEnumBondType BT_UInt32 = True | 43 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
IreneKnapp/direct-http | Haskell/Network/HTTP.hs | mit | parseCookies :: String -> [Cookie]
parseCookies value =
let findSeparator string
= let quotePoint = if (length string > 0) && (string !! 0 == '"')
then 1 + (findBalancingQuote $ drop 1 string)
else 0
maybeSemicolonPoint
= case (findIndex (\c -> (c == ';') || (c == ','))
$ drop quotePoint string)
of Nothing -> Nothing
Just index -> Just $ index + quotePoint
in maybeSemicolonPoint
findBalancingQuote string
= let consume accumulator ('\\' : c : rest) = consume (accumulator + 2) rest
consume accumulator ('"' : rest) = accumulator
consume accumulator (c : rest) = consume (accumulator + 1) rest
consume accumulator "" = accumulator
in consume 0 string
split [] = []
split string = case findSeparator string of
Nothing -> [string]
Just index ->
let (first, rest) = splitAt index string
in first : (split $ drop 1 rest)
splitNameValuePair string = case elemIndex '=' (filterNameValuePair string) of
Nothing -> (string, "")
Just index -> let (first, rest)
= splitAt index
(filterNameValuePair
string)
in (first, filterValue (drop 1 rest))
filterNameValuePair string
= reverse $ dropWhile isSpace $ reverse $ dropWhile isSpace string
filterValue string = if (length string > 0) && ((string !! 0) == '"')
then take (findBalancingQuote $ drop 1 string)
$ drop 1 string
else string
pairs = map splitNameValuePair $ split value
(version, pairs') = case pairs of
("$Version", versionString) : rest
-> case parseInt versionString of
Nothing -> (0, rest)
Just version -> (version, rest)
_ -> (0, pairs)
takeCookie pairs = case pairs of
(name, value) : pairs'
| (length name > 0) && (take 1 name /= "$")
-> let (maybePath, maybeDomain, pairs'')
= takePathAndDomain pairs'
in (Cookie {
cookieName = name,
cookieValue = value,
cookieVersion = version,
cookiePath = maybePath,
cookieDomain = maybeDomain,
cookieMaxAge = Nothing,
cookieSecure = False,
cookieComment = Nothing
}
: takeCookie pairs'')
_ : pairs' -> takeCookie pairs'
[] -> []
takePathAndDomain pairs = let (maybePath, pairs')
= case pairs of ("$Path", path) : rest
-> (Just path, rest)
_ -> (Nothing, pairs)
(maybeDomain, pairs'')
= case pairs' of ("$Domain", domain) : rest
-> (Just domain, rest)
_ -> (Nothing, pairs')
in (maybePath, maybeDomain, pairs'')
in takeCookie pairs' | 4,341 | parseCookies :: String -> [Cookie]
parseCookies value =
let findSeparator string
= let quotePoint = if (length string > 0) && (string !! 0 == '"')
then 1 + (findBalancingQuote $ drop 1 string)
else 0
maybeSemicolonPoint
= case (findIndex (\c -> (c == ';') || (c == ','))
$ drop quotePoint string)
of Nothing -> Nothing
Just index -> Just $ index + quotePoint
in maybeSemicolonPoint
findBalancingQuote string
= let consume accumulator ('\\' : c : rest) = consume (accumulator + 2) rest
consume accumulator ('"' : rest) = accumulator
consume accumulator (c : rest) = consume (accumulator + 1) rest
consume accumulator "" = accumulator
in consume 0 string
split [] = []
split string = case findSeparator string of
Nothing -> [string]
Just index ->
let (first, rest) = splitAt index string
in first : (split $ drop 1 rest)
splitNameValuePair string = case elemIndex '=' (filterNameValuePair string) of
Nothing -> (string, "")
Just index -> let (first, rest)
= splitAt index
(filterNameValuePair
string)
in (first, filterValue (drop 1 rest))
filterNameValuePair string
= reverse $ dropWhile isSpace $ reverse $ dropWhile isSpace string
filterValue string = if (length string > 0) && ((string !! 0) == '"')
then take (findBalancingQuote $ drop 1 string)
$ drop 1 string
else string
pairs = map splitNameValuePair $ split value
(version, pairs') = case pairs of
("$Version", versionString) : rest
-> case parseInt versionString of
Nothing -> (0, rest)
Just version -> (version, rest)
_ -> (0, pairs)
takeCookie pairs = case pairs of
(name, value) : pairs'
| (length name > 0) && (take 1 name /= "$")
-> let (maybePath, maybeDomain, pairs'')
= takePathAndDomain pairs'
in (Cookie {
cookieName = name,
cookieValue = value,
cookieVersion = version,
cookiePath = maybePath,
cookieDomain = maybeDomain,
cookieMaxAge = Nothing,
cookieSecure = False,
cookieComment = Nothing
}
: takeCookie pairs'')
_ : pairs' -> takeCookie pairs'
[] -> []
takePathAndDomain pairs = let (maybePath, pairs')
= case pairs of ("$Path", path) : rest
-> (Just path, rest)
_ -> (Nothing, pairs)
(maybeDomain, pairs'')
= case pairs' of ("$Domain", domain) : rest
-> (Just domain, rest)
_ -> (Nothing, pairs')
in (maybePath, maybeDomain, pairs'')
in takeCookie pairs' | 4,341 | parseCookies value =
let findSeparator string
= let quotePoint = if (length string > 0) && (string !! 0 == '"')
then 1 + (findBalancingQuote $ drop 1 string)
else 0
maybeSemicolonPoint
= case (findIndex (\c -> (c == ';') || (c == ','))
$ drop quotePoint string)
of Nothing -> Nothing
Just index -> Just $ index + quotePoint
in maybeSemicolonPoint
findBalancingQuote string
= let consume accumulator ('\\' : c : rest) = consume (accumulator + 2) rest
consume accumulator ('"' : rest) = accumulator
consume accumulator (c : rest) = consume (accumulator + 1) rest
consume accumulator "" = accumulator
in consume 0 string
split [] = []
split string = case findSeparator string of
Nothing -> [string]
Just index ->
let (first, rest) = splitAt index string
in first : (split $ drop 1 rest)
splitNameValuePair string = case elemIndex '=' (filterNameValuePair string) of
Nothing -> (string, "")
Just index -> let (first, rest)
= splitAt index
(filterNameValuePair
string)
in (first, filterValue (drop 1 rest))
filterNameValuePair string
= reverse $ dropWhile isSpace $ reverse $ dropWhile isSpace string
filterValue string = if (length string > 0) && ((string !! 0) == '"')
then take (findBalancingQuote $ drop 1 string)
$ drop 1 string
else string
pairs = map splitNameValuePair $ split value
(version, pairs') = case pairs of
("$Version", versionString) : rest
-> case parseInt versionString of
Nothing -> (0, rest)
Just version -> (version, rest)
_ -> (0, pairs)
takeCookie pairs = case pairs of
(name, value) : pairs'
| (length name > 0) && (take 1 name /= "$")
-> let (maybePath, maybeDomain, pairs'')
= takePathAndDomain pairs'
in (Cookie {
cookieName = name,
cookieValue = value,
cookieVersion = version,
cookiePath = maybePath,
cookieDomain = maybeDomain,
cookieMaxAge = Nothing,
cookieSecure = False,
cookieComment = Nothing
}
: takeCookie pairs'')
_ : pairs' -> takeCookie pairs'
[] -> []
takePathAndDomain pairs = let (maybePath, pairs')
= case pairs of ("$Path", path) : rest
-> (Just path, rest)
_ -> (Nothing, pairs)
(maybeDomain, pairs'')
= case pairs' of ("$Domain", domain) : rest
-> (Just domain, rest)
_ -> (Nothing, pairs')
in (maybePath, maybeDomain, pairs'')
in takeCookie pairs' | 4,306 | false | true | 0 | 21 | 2,476 | 939 | 488 | 451 | null | null |
khajavi/pandoc | src/Text/Pandoc/Writers/MediaWiki.hs | gpl-2.0 | -- note: str should NOT be escaped
inlineToMediaWiki _ (TeX _) = return "" | 76 | inlineToMediaWiki _ (TeX _) = return "" | 39 | inlineToMediaWiki _ (TeX _) = return "" | 39 | true | false | 1 | 6 | 15 | 23 | 10 | 13 | null | null |
dhess/gpio | examples/Sysfs.hs | bsd-3-clause | run (GlobalOptions ListPins) = runNativeSysfs listPins | 54 | run (GlobalOptions ListPins) = runNativeSysfs listPins | 54 | run (GlobalOptions ListPins) = runNativeSysfs listPins | 54 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
DavidAlphaFox/ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | lkList lk (x:xs) = lm_cons >.> lk x >=> lkList lk xs | 52 | lkList lk (x:xs) = lm_cons >.> lk x >=> lkList lk xs | 52 | lkList lk (x:xs) = lm_cons >.> lk x >=> lkList lk xs | 52 | false | false | 0 | 7 | 11 | 36 | 16 | 20 | null | null |
shayan-najd/HsParser | OutputableInstances.hs | gpl-3.0 | ppr_expr (HsArrForm (L _ (HsVar (L _ v))) (Just _) [arg1, arg2])
= sep [pprCmdArg (unLoc arg1), hsep [pprInfixOcc v, pprCmdArg (unLoc arg2)]] | 143 | ppr_expr (HsArrForm (L _ (HsVar (L _ v))) (Just _) [arg1, arg2])
= sep [pprCmdArg (unLoc arg1), hsep [pprInfixOcc v, pprCmdArg (unLoc arg2)]] | 143 | ppr_expr (HsArrForm (L _ (HsVar (L _ v))) (Just _) [arg1, arg2])
= sep [pprCmdArg (unLoc arg1), hsep [pprInfixOcc v, pprCmdArg (unLoc arg2)]] | 143 | false | false | 0 | 12 | 24 | 93 | 46 | 47 | null | null |
mikegehard/haskellBookExercises | morseCode/src/Main.hs | mit | main :: IO ()
main = do
mode <- getArgs
case mode of
[arg] ->
case arg of
"from" -> convertFromMorse
"to" -> convertToMorse
_ -> argError
_ -> argError
where
argError = do
putStrLn "Please specify the first argument as being 'from' or 'to'."
exitFailure | 361 | main :: IO ()
main = do
mode <- getArgs
case mode of
[arg] ->
case arg of
"from" -> convertFromMorse
"to" -> convertToMorse
_ -> argError
_ -> argError
where
argError = do
putStrLn "Please specify the first argument as being 'from' or 'to'."
exitFailure | 361 | main = do
mode <- getArgs
case mode of
[arg] ->
case arg of
"from" -> convertFromMorse
"to" -> convertToMorse
_ -> argError
_ -> argError
where
argError = do
putStrLn "Please specify the first argument as being 'from' or 'to'."
exitFailure | 347 | false | true | 1 | 12 | 153 | 93 | 41 | 52 | null | null |
mzini/hosa | src/HoSA/Data/Index.hs | mit | ixSum ts = Sum ts | 17 | ixSum ts = Sum ts | 17 | ixSum ts = Sum ts | 17 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
acowley/ghc | compiler/coreSyn/CoreStats.hs | bsd-3-clause | exprSize :: CoreExpr -> Int
-- ^ A measure of the size of the expressions, strictly greater than 0
-- It also forces the expression pretty drastically as a side effect
-- Counts *leaves*, not internal nodes. Types and coercions are not counted.
exprSize (Var v) = v `seq` 1 | 281 | exprSize :: CoreExpr -> Int
exprSize (Var v) = v `seq` 1 | 64 | exprSize (Var v) = v `seq` 1 | 36 | true | true | 0 | 9 | 57 | 41 | 21 | 20 | null | null |
seL4/capDL-tool | CapDL/PrintIsabelle.hs | bsd-2-clause | printRight Write = text "Write" | 31 | printRight Write = text "Write" | 31 | printRight Write = text "Write" | 31 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
mpsk2/LatteCompiler | src/Latte/Compile/Text.hs | mit | emptyProgram :: [String]
emptyProgram = (startProgram ["main"] ["puts, printf"]) ++ (functionStart "main" 2) ++ [
" mov rdi, message",
" call puts",
" xor rsi, rsi"
] ++ printInt ++ [
" xor rax, rax"] ++ functionEnd ++ [
"message:",
" db \"Hello, world!\", 0"] ++ (endProgram []) | 332 | emptyProgram :: [String]
emptyProgram = (startProgram ["main"] ["puts, printf"]) ++ (functionStart "main" 2) ++ [
" mov rdi, message",
" call puts",
" xor rsi, rsi"
] ++ printInt ++ [
" xor rax, rax"] ++ functionEnd ++ [
"message:",
" db \"Hello, world!\", 0"] ++ (endProgram []) | 332 | emptyProgram = (startProgram ["main"] ["puts, printf"]) ++ (functionStart "main" 2) ++ [
" mov rdi, message",
" call puts",
" xor rsi, rsi"
] ++ printInt ++ [
" xor rax, rax"] ++ functionEnd ++ [
"message:",
" db \"Hello, world!\", 0"] ++ (endProgram []) | 307 | false | true | 0 | 14 | 100 | 90 | 50 | 40 | null | null |
ribag/ganeti-experiments | test/hs/Test/Ganeti/Ssconf.hs | gpl-2.0 | prop_ReadShow :: Ssconf.SSConf -> Property
prop_ReadShow = testSerialisation | 76 | prop_ReadShow :: Ssconf.SSConf -> Property
prop_ReadShow = testSerialisation | 76 | prop_ReadShow = testSerialisation | 33 | false | true | 0 | 6 | 7 | 17 | 9 | 8 | null | null |
nomeata/ghc | compiler/cmm/OldCmm.hs | bsd-3-clause | mapBlockStmts :: (i -> i') -> GenBasicBlock i -> GenBasicBlock i'
mapBlockStmts f (BasicBlock id bs) = BasicBlock id (map f bs) | 127 | mapBlockStmts :: (i -> i') -> GenBasicBlock i -> GenBasicBlock i'
mapBlockStmts f (BasicBlock id bs) = BasicBlock id (map f bs) | 127 | mapBlockStmts f (BasicBlock id bs) = BasicBlock id (map f bs) | 61 | false | true | 0 | 7 | 21 | 58 | 28 | 30 | null | null |
flocc-net/flocc | v0.1/Compiler/Front/Common.hs | apache-2.0 | lr (Right f) (Left t) = Right (f t) | 35 | lr (Right f) (Left t) = Right (f t) | 35 | lr (Right f) (Left t) = Right (f t) | 35 | false | false | 1 | 7 | 8 | 34 | 15 | 19 | null | null |
tyoko-dev/coreutils-haskell | src/rmdir.hs | agpl-3.0 | main :: IO ()
main = do args <- getArgs
mapM_ removeDirectory args | 76 | main :: IO ()
main = do args <- getArgs
mapM_ removeDirectory args | 76 | main = do args <- getArgs
mapM_ removeDirectory args | 62 | false | true | 0 | 7 | 22 | 31 | 14 | 17 | null | null |
damianfral/clay | src/Clay/Background.hs | bsd-3-clause | backgroundAttachments :: [BackgroundAttachment] -> Css
backgroundAttachments = key "background-attachment" | 106 | backgroundAttachments :: [BackgroundAttachment] -> Css
backgroundAttachments = key "background-attachment" | 106 | backgroundAttachments = key "background-attachment" | 51 | false | true | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
christiaanb/ghc | compiler/types/TyCon.hs | bsd-3-clause | isClosedSynFamilyTyCon_maybe _ = Nothing | 63 | isClosedSynFamilyTyCon_maybe _ = Nothing | 63 | isClosedSynFamilyTyCon_maybe _ = Nothing | 63 | false | false | 0 | 5 | 26 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-admin-reports/gen/Network/Google/Reports/Types/Product.hs | mpl-2.0 | -- | The human readable messages for a warning are: - Data is not available
-- warning - Sorry, data for date yyyy-mm-dd for application
-- \"\`application name\`\" is not available. - Partial data is available
-- warning - Data for date yyyy-mm-dd for application \"\`application
-- name\`\" is not available right now, please try again after a few hours.
urwiMessage :: Lens' UsageReportsWarningsItem (Maybe Text)
urwiMessage
= lens _urwiMessage (\ s a -> s{_urwiMessage = a}) | 480 | urwiMessage :: Lens' UsageReportsWarningsItem (Maybe Text)
urwiMessage
= lens _urwiMessage (\ s a -> s{_urwiMessage = a}) | 123 | urwiMessage
= lens _urwiMessage (\ s a -> s{_urwiMessage = a}) | 64 | true | true | 0 | 9 | 78 | 52 | 29 | 23 | null | null |
project-oak/silveroak | cava/Cava2HDL/Cava2SystemVerilog.hs | apache-2.0 | isGndOrVcc _ = False | 20 | isGndOrVcc _ = False | 20 | isGndOrVcc _ = False | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
phonohawk/HsOpenSSL | OpenSSL/X509/Request.hs | cc0-1.0 | -- |@'signX509Req'@ signs a certificate request with a subject private
-- key.
signX509Req :: KeyPair key =>
X509Req -- ^ The request to be signed.
-> key -- ^ The private key to sign with.
-> Maybe Digest -- ^ A hashing algorithm to use. If
-- @Nothing@ the most suitable algorithm
-- for the key is automatically used.
-> IO ()
signX509Req req pkey mDigest
= withX509ReqPtr req $ \ reqPtr ->
withPKeyPtr' pkey $ \ pkeyPtr ->
do digest <- case mDigest of
Just md -> return md
Nothing -> pkeyDefaultMD pkey
withMDPtr digest $ \ digestPtr ->
_sign reqPtr pkeyPtr digestPtr
>>= failIf_ (== 0)
-- |@'verifyX509Req'@ verifies a signature of certificate request with
-- a subject public key. | 914 | signX509Req :: KeyPair key =>
X509Req -- ^ The request to be signed.
-> key -- ^ The private key to sign with.
-> Maybe Digest -- ^ A hashing algorithm to use. If
-- @Nothing@ the most suitable algorithm
-- for the key is automatically used.
-> IO ()
signX509Req req pkey mDigest
= withX509ReqPtr req $ \ reqPtr ->
withPKeyPtr' pkey $ \ pkeyPtr ->
do digest <- case mDigest of
Just md -> return md
Nothing -> pkeyDefaultMD pkey
withMDPtr digest $ \ digestPtr ->
_sign reqPtr pkeyPtr digestPtr
>>= failIf_ (== 0)
-- |@'verifyX509Req'@ verifies a signature of certificate request with
-- a subject public key. | 835 | signX509Req req pkey mDigest
= withX509ReqPtr req $ \ reqPtr ->
withPKeyPtr' pkey $ \ pkeyPtr ->
do digest <- case mDigest of
Just md -> return md
Nothing -> pkeyDefaultMD pkey
withMDPtr digest $ \ digestPtr ->
_sign reqPtr pkeyPtr digestPtr
>>= failIf_ (== 0)
-- |@'verifyX509Req'@ verifies a signature of certificate request with
-- a subject public key. | 459 | true | true | 0 | 15 | 349 | 143 | 72 | 71 | null | null |
ezyang/ghc | compiler/basicTypes/Id.hs | bsd-3-clause | setIdOneShotInfo :: Id -> OneShotInfo -> Id
setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id | 118 | setIdOneShotInfo :: Id -> OneShotInfo -> Id
setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id | 118 | setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id | 74 | false | true | 0 | 8 | 14 | 40 | 20 | 20 | null | null |
mydaum/cabal | Cabal/Distribution/Version.hs | bsd-3-clause | doesNotTouch (UpperBound u ub) (LowerBound l lb) =
u < l
|| (u == l && ub == ExclusiveBound && lb == ExclusiveBound) | 125 | doesNotTouch (UpperBound u ub) (LowerBound l lb) =
u < l
|| (u == l && ub == ExclusiveBound && lb == ExclusiveBound) | 125 | doesNotTouch (UpperBound u ub) (LowerBound l lb) =
u < l
|| (u == l && ub == ExclusiveBound && lb == ExclusiveBound) | 125 | false | false | 1 | 9 | 31 | 60 | 30 | 30 | null | null |
nfjinjing/mps | src/MPS/Math/MathsPrimitives.hs | bsd-3-clause | partialProducts xs = scanl1 (*) xs | 34 | partialProducts xs = scanl1 (*) xs | 34 | partialProducts xs = scanl1 (*) xs | 34 | false | false | 0 | 5 | 5 | 16 | 8 | 8 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/State/Messages.hs | bsd-3-clause | maybeNotify :: PostToAdd -> MH ()
maybeNotify (OldPost _) = do
return () | 76 | maybeNotify :: PostToAdd -> MH ()
maybeNotify (OldPost _) = do
return () | 76 | maybeNotify (OldPost _) = do
return () | 42 | false | true | 0 | 8 | 16 | 37 | 17 | 20 | null | null |
spechub/Hets | PGIP/ParseProofScript.hs | gpl-2.0 | parseContent :: FilePath -> String -> Either String [LitCommand]
parseContent fp str = let
l = number $ lines str
(es, rs) = partitionEithers $ map
(\ (s, i) -> parseSingleLine fp i s) l
in if null es then Right rs else
Left $ unlines es | 252 | parseContent :: FilePath -> String -> Either String [LitCommand]
parseContent fp str = let
l = number $ lines str
(es, rs) = partitionEithers $ map
(\ (s, i) -> parseSingleLine fp i s) l
in if null es then Right rs else
Left $ unlines es | 252 | parseContent fp str = let
l = number $ lines str
(es, rs) = partitionEithers $ map
(\ (s, i) -> parseSingleLine fp i s) l
in if null es then Right rs else
Left $ unlines es | 187 | false | true | 0 | 13 | 61 | 113 | 57 | 56 | null | null |
MarcusVoelker/Recolang | Text/LParse/Transformers.hs | mit | pParse :: (t -> t) -> Parser r t a -> Parser r t a
pParse f p = Parser (pFunc p . f) | 84 | pParse :: (t -> t) -> Parser r t a -> Parser r t a
pParse f p = Parser (pFunc p . f) | 84 | pParse f p = Parser (pFunc p . f) | 33 | false | true | 0 | 8 | 23 | 58 | 28 | 30 | null | null |
spechub/Hets | SoftFOL/Sign.hs | gpl-2.0 | emptySPLogicalPart :: SPLogicalPart
emptySPLogicalPart = SPLogicalPart { symbolList = Nothing,
declarationList = Nothing,
formulaLists = [],
clauseLists = [],
proofLists = []
} | 359 | emptySPLogicalPart :: SPLogicalPart
emptySPLogicalPart = SPLogicalPart { symbolList = Nothing,
declarationList = Nothing,
formulaLists = [],
clauseLists = [],
proofLists = []
} | 359 | emptySPLogicalPart = SPLogicalPart { symbolList = Nothing,
declarationList = Nothing,
formulaLists = [],
clauseLists = [],
proofLists = []
} | 323 | false | true | 0 | 7 | 205 | 49 | 30 | 19 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | enumClass_RDR = nameRdrName enumClassName | 51 | enumClass_RDR = nameRdrName enumClassName | 51 | enumClass_RDR = nameRdrName enumClassName | 51 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
jschaf/hudson-dev | src/Language/Hudson/Parser.hs | bsd-3-clause | newline = tokenP (withEmpty NewlineTok) <?> "newline" | 57 | newline = tokenP (withEmpty NewlineTok) <?> "newline" | 57 | newline = tokenP (withEmpty NewlineTok) <?> "newline" | 57 | false | false | 0 | 8 | 10 | 19 | 9 | 10 | null | null |
mydaum/cabal | Cabal/Distribution/PackageDescription/Parse.hs | bsd-3-clause | -- ---------------------------------------------------------------------------
-- The Library type
libFieldDescrs :: [FieldDescr Library]
libFieldDescrs =
[ listFieldWithSep vcat "exposed-modules" disp parseModuleNameQ
exposedModules (\mods lib -> lib{exposedModules=mods})
, commaListFieldWithSep vcat "reexported-modules" disp parse
reexportedModules (\mods lib -> lib{reexportedModules=mods})
, listFieldWithSep vcat "signatures" disp parseModuleNameQ
signatures (\mods lib -> lib{signatures=mods})
, boolField "exposed"
libExposed (\val lib -> lib{libExposed=val})
] ++ map biToLib binfoFieldDescrs
where biToLib = liftField libBuildInfo (\bi lib -> lib{libBuildInfo=bi}) | 719 | libFieldDescrs :: [FieldDescr Library]
libFieldDescrs =
[ listFieldWithSep vcat "exposed-modules" disp parseModuleNameQ
exposedModules (\mods lib -> lib{exposedModules=mods})
, commaListFieldWithSep vcat "reexported-modules" disp parse
reexportedModules (\mods lib -> lib{reexportedModules=mods})
, listFieldWithSep vcat "signatures" disp parseModuleNameQ
signatures (\mods lib -> lib{signatures=mods})
, boolField "exposed"
libExposed (\val lib -> lib{libExposed=val})
] ++ map biToLib binfoFieldDescrs
where biToLib = liftField libBuildInfo (\bi lib -> lib{libBuildInfo=bi}) | 619 | libFieldDescrs =
[ listFieldWithSep vcat "exposed-modules" disp parseModuleNameQ
exposedModules (\mods lib -> lib{exposedModules=mods})
, commaListFieldWithSep vcat "reexported-modules" disp parse
reexportedModules (\mods lib -> lib{reexportedModules=mods})
, listFieldWithSep vcat "signatures" disp parseModuleNameQ
signatures (\mods lib -> lib{signatures=mods})
, boolField "exposed"
libExposed (\val lib -> lib{libExposed=val})
] ++ map biToLib binfoFieldDescrs
where biToLib = liftField libBuildInfo (\bi lib -> lib{libBuildInfo=bi}) | 580 | true | true | 0 | 11 | 110 | 189 | 105 | 84 | null | null |
weiningl/SFTypes | Parser.hs | bsd-3-clause | subst x v (Lambda y body)
| x == y = Lambda y body
| otherwise = Lambda y (subst x v body) | 94 | subst x v (Lambda y body)
| x == y = Lambda y body
| otherwise = Lambda y (subst x v body) | 94 | subst x v (Lambda y body)
| x == y = Lambda y body
| otherwise = Lambda y (subst x v body) | 94 | false | false | 1 | 8 | 26 | 58 | 27 | 31 | null | null |
akc/sym | Sym/Perm/SSYT.hs | bsd-3-clause | removePQ :: SSYTPair -> (SSYTPair, (Entry, Entry))
removePQ (SSYTPair p q) = (SSYTPair p' q', (e1, e2))
where
(q', k, e1) = removeQ q
(p', e2) = removeP p k
-- | The Robinson-Schensted-Knuth (RSK) algorithm. | 227 | removePQ :: SSYTPair -> (SSYTPair, (Entry, Entry))
removePQ (SSYTPair p q) = (SSYTPair p' q', (e1, e2))
where
(q', k, e1) = removeQ q
(p', e2) = removeP p k
-- | The Robinson-Schensted-Knuth (RSK) algorithm. | 227 | removePQ (SSYTPair p q) = (SSYTPair p' q', (e1, e2))
where
(q', k, e1) = removeQ q
(p', e2) = removeP p k
-- | The Robinson-Schensted-Knuth (RSK) algorithm. | 176 | false | true | 0 | 7 | 55 | 93 | 52 | 41 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.