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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mightymoose/liquidhaskell | benchmarks/ghc-7.4.1/IO/Handle/Internals.hs | bsd-3-clause | withHandle__' :: String -> Handle -> MVar Handle__ -> (Handle__ -> IO Handle__)
-> IO ()
withHandle__' fun h m act =
mask_ $ do
h' <- do_operation fun h act m
checkHandleInvariants h'
putMVar m h'
return () | 234 | withHandle__' :: String -> Handle -> MVar Handle__ -> (Handle__ -> IO Handle__)
-> IO ()
withHandle__' fun h m act =
mask_ $ do
h' <- do_operation fun h act m
checkHandleInvariants h'
putMVar m h'
return () | 234 | withHandle__' fun h m act =
mask_ $ do
h' <- do_operation fun h act m
checkHandleInvariants h'
putMVar m h'
return () | 131 | false | true | 0 | 11 | 66 | 96 | 43 | 53 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Math/Internal/Sphere.hs | mit | sphereCntx :: C.Context
sphereCntx = mempty {
C.ctxTypesTable = Map.fromList [
(C.TypeName "Sphere", [t| Sphere |])
]
} | 136 | sphereCntx :: C.Context
sphereCntx = mempty {
C.ctxTypesTable = Map.fromList [
(C.TypeName "Sphere", [t| Sphere |])
]
} | 135 | sphereCntx = mempty {
C.ctxTypesTable = Map.fromList [
(C.TypeName "Sphere", [t| Sphere |])
]
} | 111 | false | true | 0 | 11 | 34 | 46 | 27 | 19 | null | null |
Persi/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | g_Case = tryWordToken "case" T_Case | 35 | g_Case = tryWordToken "case" T_Case | 35 | g_Case = tryWordToken "case" T_Case | 35 | false | false | 1 | 5 | 4 | 14 | 5 | 9 | null | null |
facebookincubator/duckling | Duckling/AmountOfMoney/VI/Corpus.hs | bsd-3-clause | corpus :: Corpus
corpus = (testContext {locale = makeLocale VI Nothing}, testOptions, allExamples) | 98 | corpus :: Corpus
corpus = (testContext {locale = makeLocale VI Nothing}, testOptions, allExamples) | 98 | corpus = (testContext {locale = makeLocale VI Nothing}, testOptions, allExamples) | 81 | false | true | 0 | 9 | 12 | 40 | 20 | 20 | null | null |
cabrera/stack | src/Stack/Build/Execute.hs | bsd-3-clause | printBuildOutput :: (MonadIO m, MonadBaseControl IO m, MonadLogger m)
=> Bool -- ^ exclude TH loading?
-> Bool -- ^ convert paths to absolute?
-> LogLevel
-> Handle -> m ()
printBuildOutput excludeTHLoading makeAbsolute level outH = void $
CB.... | 2,129 | printBuildOutput :: (MonadIO m, MonadBaseControl IO m, MonadLogger m)
=> Bool -- ^ exclude TH loading?
-> Bool -- ^ convert paths to absolute?
-> LogLevel
-> Handle -> m ()
printBuildOutput excludeTHLoading makeAbsolute level outH = void $
CB.... | 2,129 | printBuildOutput excludeTHLoading makeAbsolute level outH = void $
CB.sourceHandle outH
$$ CB.lines
=$ CL.map stripCarriageReturn
=$ CL.filter (not . isTHLoading)
=$ CL.mapM toAbsolutePath
=$ CL.mapM_ (monadLoggerLog $(TH.location >>= liftLoc) "" level)
where
-- | Is this line a Templ... | 1,888 | false | true | 12 | 16 | 704 | 615 | 294 | 321 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x06C2' = "\x06C1\x0654" | 39 | decomposeChar '\x06C2' = "\x06C1\x0654" | 39 | decomposeChar '\x06C2' = "\x06C1\x0654" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
epicvrvs/Veles | Source/Veles/Client.hs | gpl-3.0 | -- | Modifies the buffer of the client environment.
modifyBuffer :: Monad m => (DB.ByteString -> DB.ByteString) -> ClientEnvironmentT m ()
modifyBuffer f = modify modifier
where
modifier state = ClientEnvironmentData (clientConnection state) (f (clientBuffer state))
-- | Replaces the buffer of the client environ... | 325 | modifyBuffer :: Monad m => (DB.ByteString -> DB.ByteString) -> ClientEnvironmentT m ()
modifyBuffer f = modify modifier
where
modifier state = ClientEnvironmentData (clientConnection state) (f (clientBuffer state))
-- | Replaces the buffer of the client environment. | 273 | modifyBuffer f = modify modifier
where
modifier state = ClientEnvironmentData (clientConnection state) (f (clientBuffer state))
-- | Replaces the buffer of the client environment. | 186 | true | true | 0 | 9 | 51 | 82 | 40 | 42 | null | null |
cchalmers/geometry | benchmarks/Samples.hs | bsd-3-clause | -- Triangles -----------------------------------------------------------
randomTriangles :: Word64 -> [Located (Trail V2 Double)]
randomTriangles seed = go (floats seed) where
go (r1:r2:r3:r4:rs) = (triangle w # rotate a `at` mkP2 x y) : go rs
where
w = r1 * 10 + 0.1
a = r2 @@ turn
x = r3 * 100 - 50
... | 342 | randomTriangles :: Word64 -> [Located (Trail V2 Double)]
randomTriangles seed = go (floats seed) where
go (r1:r2:r3:r4:rs) = (triangle w # rotate a `at` mkP2 x y) : go rs
where
w = r1 * 10 + 0.1
a = r2 @@ turn
x = r3 * 100 - 50
y = r4 * 100 - 50
| 268 | randomTriangles seed = go (floats seed) where
go (r1:r2:r3:r4:rs) = (triangle w # rotate a `at` mkP2 x y) : go rs
where
w = r1 * 10 + 0.1
a = r2 @@ turn
x = r3 * 100 - 50
y = r4 * 100 - 50
| 211 | true | true | 10 | 11 | 83 | 181 | 80 | 101 | null | null |
zoranbosnjak/longrun | test/TestWait.hs | gpl-3.0 | testTimeout :: Test
testTimeout = testLogsOfMatch "timeout" DEBUG procTimeout
[ (INFO,"start")
, (INFO, "spawned")
, (INFO, "awoke")
, (INFO, "Just \"hello\"")
] | 181 | testTimeout :: Test
testTimeout = testLogsOfMatch "timeout" DEBUG procTimeout
[ (INFO,"start")
, (INFO, "spawned")
, (INFO, "awoke")
, (INFO, "Just \"hello\"")
] | 181 | testTimeout = testLogsOfMatch "timeout" DEBUG procTimeout
[ (INFO,"start")
, (INFO, "spawned")
, (INFO, "awoke")
, (INFO, "Just \"hello\"")
] | 161 | false | true | 0 | 6 | 41 | 57 | 34 | 23 | null | null |
ddssff/lens | src/Data/Bits/Lens.hs | bsd-3-clause | -- | Traverse over all the bytes in an integral type, from the low end.
--
-- The byte position is available as the index.
--
-- >>> toListOf bytewise (1312301580 :: Word32)
-- [12,34,56,78]
--
-- If you supply this an 'Integer', the result will be an infinite 'Traversal',
-- which can be productively consumed, but not... | 782 | bytewise :: (Integral b, Bits b) => IndexedTraversal' Int b Word8
bytewise f b = foldr step 0 <$> traverse g bs where
g n = (,) n <$> indexed f n (fromIntegral $ b `shiftR` (n*8))
bs = takeWhile hasByte [0..]
hasByte n = complementBit b (n*8) /= b
step (n,x) r = r .|. (fromIntegral x `shiftL` (n*8))
| 309 | bytewise f b = foldr step 0 <$> traverse g bs where
g n = (,) n <$> indexed f n (fromIntegral $ b `shiftR` (n*8))
bs = takeWhile hasByte [0..]
hasByte n = complementBit b (n*8) /= b
step (n,x) r = r .|. (fromIntegral x `shiftL` (n*8))
| 243 | true | true | 0 | 12 | 150 | 187 | 103 | 84 | null | null |
avieth/diplomacy | Diplomacy/Turn.hs | bsd-3-clause | firstTurn = Turn Z | 18 | firstTurn = Turn Z | 18 | firstTurn = Turn Z | 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
CindyLinz/Haskell.js | trans/src/CollectData.hs | mit | declHeadName (DHApp l head tyVarBind) = declHeadName head | 57 | declHeadName (DHApp l head tyVarBind) = declHeadName head | 57 | declHeadName (DHApp l head tyVarBind) = declHeadName head | 57 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
plaimi/tempuhs-server | src/Tempuhs/Server/Spock.hs | agpl-3.0 | jsonSuccess :: ActionE ()
-- | 'jsonSuccess' generates an empty JSON object.
jsonSuccess = json $ object [] | 107 | jsonSuccess :: ActionE ()
jsonSuccess = json $ object [] | 56 | jsonSuccess = json $ object [] | 30 | true | true | 0 | 7 | 17 | 26 | 13 | 13 | null | null |
c19/Exercism-Haskell | collatz-conjecture/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen/Paths_collatz_conjecture.hs | mit | getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 118 | getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 118 | getDataFileName name = do
dir <- getDataDir
return (dir ++ "/" ++ name) | 75 | false | true | 0 | 10 | 22 | 45 | 21 | 24 | null | null |
fmthoma/ghc | compiler/utils/Pretty.hs | bsd-3-clause | fill g (p:ps) = fill1 g (reduceDoc p) (_ILIT(0)) ps | 51 | fill g (p:ps) = fill1 g (reduceDoc p) (_ILIT(0)) ps | 51 | fill g (p:ps) = fill1 g (reduceDoc p) (_ILIT(0)) ps | 51 | false | false | 0 | 8 | 9 | 42 | 21 | 21 | null | null |
brenov/set | interpreter/Expressions.hs | mit | eval (Int x p) (Division _) (Real y _) =
let z = integerToFloat(x) / y in Real z p | 87 | eval (Int x p) (Division _) (Real y _) =
let z = integerToFloat(x) / y in Real z p | 87 | eval (Int x p) (Division _) (Real y _) =
let z = integerToFloat(x) / y in Real z p | 87 | false | false | 0 | 11 | 24 | 65 | 30 | 35 | null | null |
Bolt64/my_code | haskell/sieve_correct.hs | mit | --notMultipleOf :: Int -> (Int -> Bool)
notMultipleOf x = \y -> (y `mod` x) /= 0 | 80 | notMultipleOf x = \y -> (y `mod` x) /= 0 | 40 | notMultipleOf x = \y -> (y `mod` x) /= 0 | 40 | true | false | 0 | 8 | 16 | 28 | 16 | 12 | null | null |
VictorDenisov/suffixarray | Tests/Tests.hs | gpl-2.0 | main = runTestTT tests | 22 | main = runTestTT tests | 22 | main = runTestTT tests | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ben-schulz/Idris-dev | Setup.hs | bsd-3-clause | mymake = "gmake" | 16 | mymake = "gmake" | 16 | mymake = "gmake" | 16 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
qnikst/network-transport | src/Network/Transport/Internal.hs | bsd-3-clause | -- | Deserialize 32-bit from network byte order
-- Throws an IO exception if this is not a valid integer.
decodeInt32 :: Num a => ByteString -> a
decodeInt32 bs
| BS.length bs /= 4 = throw $ userError "decodeInt32: Invalid length"
| otherwise = BSI.inlinePerformIO $ do
let (fp, offset, _) = BSI.toFore... | 489 | decodeInt32 :: Num a => ByteString -> a
decodeInt32 bs
| BS.length bs /= 4 = throw $ userError "decodeInt32: Invalid length"
| otherwise = BSI.inlinePerformIO $ do
let (fp, offset, _) = BSI.toForeignPtr bs
withForeignPtr fp $ \p -> do
w32 <- peekByteOff p offset
return (fromInteg... | 383 | decodeInt32 bs
| BS.length bs /= 4 = throw $ userError "decodeInt32: Invalid length"
| otherwise = BSI.inlinePerformIO $ do
let (fp, offset, _) = BSI.toForeignPtr bs
withForeignPtr fp $ \p -> do
w32 <- peekByteOff p offset
return (fromIntegral . ntohl $ w32)
-- | Serialize 16-bi... | 343 | true | true | 1 | 16 | 120 | 132 | 63 | 69 | null | null |
k-bx/riak-haskell-client | tests/Utils.hs | apache-2.0 | config :: Config
config = $$(decodeFile "tests/test.yaml") | 58 | config :: Config
config = $$(decodeFile "tests/test.yaml") | 58 | config = $$(decodeFile "tests/test.yaml") | 41 | false | true | 0 | 8 | 6 | 25 | 10 | 15 | null | null |
brendanhay/gogol | gogol-serviceconsumermanagement/gen/Network/Google/ServiceConsumerManagement/Types/Product.hs | mpl-2.0 | -- | The overrides that were created.
vbbcporOverrides :: Lens' V1Beta1BatchCreateProducerOverridesResponse [V1Beta1QuotaOverride]
vbbcporOverrides
= lens _vbbcporOverrides
(\ s a -> s{_vbbcporOverrides = a})
. _Default
. _Coerce | 249 | vbbcporOverrides :: Lens' V1Beta1BatchCreateProducerOverridesResponse [V1Beta1QuotaOverride]
vbbcporOverrides
= lens _vbbcporOverrides
(\ s a -> s{_vbbcporOverrides = a})
. _Default
. _Coerce | 211 | vbbcporOverrides
= lens _vbbcporOverrides
(\ s a -> s{_vbbcporOverrides = a})
. _Default
. _Coerce | 118 | true | true | 0 | 11 | 46 | 53 | 28 | 25 | null | null |
rueshyna/gogol | gogol-debugger/gen/Network/Google/Debugger/Types/Product.hs | mpl-2.0 | -- | Breakpoint status. The status includes an error flag and a human
-- readable message. This field is usually unset. The message can be either
-- informational or an error message. Regardless, clients should always
-- display the text message back to the user. Error status indicates
-- complete failure of the breakp... | 621 | bStatus :: Lens' Breakpoint (Maybe StatusMessage)
bStatus = lens _bStatus (\ s a -> s{_bStatus = a}) | 100 | bStatus = lens _bStatus (\ s a -> s{_bStatus = a}) | 50 | true | true | 1 | 9 | 100 | 58 | 32 | 26 | null | null |
josejuan/Haskell-Spaceship-Meteorite | Math/Space2D.hs | mit | toVector :: Vertexf -> Vector3 GLfloat
toVector (Vertex3 x y z) = Vector3 x y z | 80 | toVector :: Vertexf -> Vector3 GLfloat
toVector (Vertex3 x y z) = Vector3 x y z | 79 | toVector (Vertex3 x y z) = Vector3 x y z | 40 | false | true | 0 | 7 | 16 | 38 | 18 | 20 | null | null |
jqyu/bustle-chi | src/Rad/QL/Internal/Types.hs | bsd-3-clause | applyErrs :: ((a -> b), [d]) -> (a, [d]) -> (b, [d])
applyErrs (f, errs) (x, errs') = (f x, errs <> errs') | 106 | applyErrs :: ((a -> b), [d]) -> (a, [d]) -> (b, [d])
applyErrs (f, errs) (x, errs') = (f x, errs <> errs') | 106 | applyErrs (f, errs) (x, errs') = (f x, errs <> errs') | 53 | false | true | 0 | 8 | 22 | 83 | 49 | 34 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | {-
- Title of the part, as shown when the part is right clicked in-game. For example "Mk1-2 Command Pod".
-}
getPartTitle :: KRPCHS.SpaceCenter.Part -> RPCContext (Data.Text.Text)
getPartTitle thisArg = do
let r = makeRequest "SpaceCenter" "Part_get_Title" [makeArgument 0 thisArg]
res <- sendRequest r
pro... | 336 | getPartTitle :: KRPCHS.SpaceCenter.Part -> RPCContext (Data.Text.Text)
getPartTitle thisArg = do
let r = makeRequest "SpaceCenter" "Part_get_Title" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 225 | getPartTitle thisArg = do
let r = makeRequest "SpaceCenter" "Part_get_Title" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 154 | true | true | 0 | 13 | 59 | 76 | 35 | 41 | null | null |
kindaro/BraVal | src/Text/BraVal/Types.hs | isc | table = [ ( '(', ORound )
, ( '[', OSquare )
, ( '{', OCurled )
, ( '}', CCurled )
, ( ']', CSquare )
, ( ')', CRound )
] | 177 | table = [ ( '(', ORound )
, ( '[', OSquare )
, ( '{', OCurled )
, ( '}', CCurled )
, ( ']', CSquare )
, ( ')', CRound )
] | 177 | table = [ ( '(', ORound )
, ( '[', OSquare )
, ( '{', OCurled )
, ( '}', CCurled )
, ( ']', CSquare )
, ( ')', CRound )
] | 177 | false | false | 0 | 6 | 88 | 60 | 39 | 21 | null | null |
dmitmel/goiteens-hw-in-haskell | Utils/Math/MoreMath/BigInt.hs | apache-2.0 | bitPlus (bitA:bitsA) (bitB:bitsB)
| bitA && bitB = b0 : bitPlus1 (bitPlus bitsA bitsB)
| bitA || bitB = b1 : bitPlus bitsA bitsB
| otherwise = b0 : bitPlus bitsA bitsB | 182 | bitPlus (bitA:bitsA) (bitB:bitsB)
| bitA && bitB = b0 : bitPlus1 (bitPlus bitsA bitsB)
| bitA || bitB = b1 : bitPlus bitsA bitsB
| otherwise = b0 : bitPlus bitsA bitsB | 182 | bitPlus (bitA:bitsA) (bitB:bitsB)
| bitA && bitB = b0 : bitPlus1 (bitPlus bitsA bitsB)
| bitA || bitB = b1 : bitPlus bitsA bitsB
| otherwise = b0 : bitPlus bitsA bitsB | 182 | false | false | 0 | 9 | 46 | 90 | 42 | 48 | null | null |
mtesseract/silverratio-jeopardy | src/jeopardy.hs | gpl-2.0 | audioSilenceBackground :: IORef State -> IO ()
audioSilenceBackground state' = do
state <- readIORef state'
audioSilenceBackground' (stateAudio state)
----------
-- Main --
----------
-- Main function. Parses command line arguments, starts up the game. | 260 | audioSilenceBackground :: IORef State -> IO ()
audioSilenceBackground state' = do
state <- readIORef state'
audioSilenceBackground' (stateAudio state)
----------
-- Main --
----------
-- Main function. Parses command line arguments, starts up the game. | 260 | audioSilenceBackground state' = do
state <- readIORef state'
audioSilenceBackground' (stateAudio state)
----------
-- Main --
----------
-- Main function. Parses command line arguments, starts up the game. | 213 | false | true | 0 | 9 | 41 | 52 | 25 | 27 | null | null |
amccausl/Swish | Swish/HaskellRDF/N3FormatterTest.hs | lgpl-2.1 | qb2p24 = ScopedName base2 "p24" | 31 | qb2p24 = ScopedName base2 "p24" | 31 | qb2p24 = ScopedName base2 "p24" | 31 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
suzumiyasmith/Hipmunk-Utils | src/Physics/Hipmunk/Utils.hs | bsd-3-clause | getPosition :: Body -> IO (V2 Double)
getPosition b = do
(Vector x y) <- get $ position b
return $ V2 x y | 109 | getPosition :: Body -> IO (V2 Double)
getPosition b = do
(Vector x y) <- get $ position b
return $ V2 x y | 109 | getPosition b = do
(Vector x y) <- get $ position b
return $ V2 x y | 71 | false | true | 0 | 9 | 27 | 61 | 28 | 33 | null | null |
urbanslug/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayOptc _ WayDyn = [] | 28 | wayOptc _ WayDyn = [] | 28 | wayOptc _ WayDyn = [] | 28 | false | false | 1 | 6 | 11 | 15 | 6 | 9 | null | null |
flazz/tooHS | src/Sprite/Terrain.hs | bsd-3-clause | re :: Vertex3 Float -> Vertex3 Float
re v@(Vertex3 x y z) | isEven y = v
| otherwise = Vertex3 (x + 2) y z | 127 | re :: Vertex3 Float -> Vertex3 Float
re v@(Vertex3 x y z) | isEven y = v
| otherwise = Vertex3 (x + 2) y z | 127 | re v@(Vertex3 x y z) | isEven y = v
| otherwise = Vertex3 (x + 2) y z | 90 | false | true | 6 | 7 | 46 | 68 | 33 | 35 | null | null |
ezyang/ghc | libraries/ghci/GHCi/RemoteTypes.hs | bsd-3-clause | -- We can discard type information if we want
toHValueRef :: RemoteRef a -> RemoteRef HValue
toHValueRef = unsafeCoerce | 119 | toHValueRef :: RemoteRef a -> RemoteRef HValue
toHValueRef = unsafeCoerce | 73 | toHValueRef = unsafeCoerce | 26 | true | true | 0 | 7 | 18 | 28 | 12 | 16 | null | null |
pbl64k/HackerRank-Contests | 2014-10-10-FP/Infer/i.nlp2.hs | bsd-2-clause | disp c m Bool = ("bool", c, m) | 30 | disp c m Bool = ("bool", c, m) | 30 | disp c m Bool = ("bool", c, m) | 30 | false | false | 0 | 5 | 7 | 22 | 12 | 10 | null | null |
ariep/text-index | src/Data/Search/Results.hs | bsd-3-clause | fromPSQ :: PSQ.OrdPSQ id w v -> T id w v
fromPSQ = PSQ | 54 | fromPSQ :: PSQ.OrdPSQ id w v -> T id w v
fromPSQ = PSQ | 54 | fromPSQ = PSQ | 13 | false | true | 0 | 7 | 13 | 31 | 15 | 16 | null | null |
NorfairKing/super-user-spark | src/SuperUserSpark/Bake.hs | mit | rootOf :: BakeCardReference -> Path Abs Dir
rootOf bcr =
parent $
case bcr of
(BakeCardCompiled fp) -> fp
(BakeCardUncompiled (StrongCardFileReference fp _)) -> fp | 187 | rootOf :: BakeCardReference -> Path Abs Dir
rootOf bcr =
parent $
case bcr of
(BakeCardCompiled fp) -> fp
(BakeCardUncompiled (StrongCardFileReference fp _)) -> fp | 187 | rootOf bcr =
parent $
case bcr of
(BakeCardCompiled fp) -> fp
(BakeCardUncompiled (StrongCardFileReference fp _)) -> fp | 143 | false | true | 2 | 8 | 48 | 68 | 32 | 36 | null | null |
jml/graphql-api | src/GraphQL/Internal/Syntax/Encoder.hs | bsd-3-clause | argument :: AST.Argument -> Text
argument (AST.Argument name v) = unName name <> ":" <> value v | 95 | argument :: AST.Argument -> Text
argument (AST.Argument name v) = unName name <> ":" <> value v | 95 | argument (AST.Argument name v) = unName name <> ":" <> value v | 62 | false | true | 0 | 8 | 16 | 44 | 21 | 23 | null | null |
phylake/avm3 | llvm/emitter.hs | mit | toLLVMOps (PushByte a:ops) = do
t1 <- nextR $ P I32
t2 <- nextR I32
returnR ops
[
Comment "PushByte"
, Alloca t1
, StoreC I32 (fromIntegral a) t1
, Load t2 t1 -- the next instruction is expecting a value
] | 237 | toLLVMOps (PushByte a:ops) = do
t1 <- nextR $ P I32
t2 <- nextR I32
returnR ops
[
Comment "PushByte"
, Alloca t1
, StoreC I32 (fromIntegral a) t1
, Load t2 t1 -- the next instruction is expecting a value
] | 237 | toLLVMOps (PushByte a:ops) = do
t1 <- nextR $ P I32
t2 <- nextR I32
returnR ops
[
Comment "PushByte"
, Alloca t1
, StoreC I32 (fromIntegral a) t1
, Load t2 t1 -- the next instruction is expecting a value
] | 237 | false | false | 0 | 11 | 73 | 88 | 41 | 47 | null | null |
jgm/pandoc-types | src/Text/Pandoc/Walk.hs | bsd-3-clause | queryInline f (Superscript xs)= query f xs | 42 | queryInline f (Superscript xs)= query f xs | 42 | queryInline f (Superscript xs)= query f xs | 42 | false | false | 0 | 7 | 6 | 22 | 10 | 12 | null | null |
Bugfry/exercism | exercism/haskell/robot-simulator/src/Robot.hs | mit | turnRight bearing = succ bearing | 32 | turnRight bearing = succ bearing | 32 | turnRight bearing = succ bearing | 32 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
nbrunt/JSHOP | src/old/ver2/LexerMonad.hs | mit | monadicLexer' :: (Token -> P a) -> P a
monadicLexer' cont = do
chr <- get
case (rest chr) of
('\n':xs) -> do
put chr {rest = xs, lineno = (lineno chr) + 1, nl = True}
monadicLexer' cont
('/':'*':xs) -> do
put chr {rest = xs}
scanComment cont
... | 1,367 | monadicLexer' :: (Token -> P a) -> P a
monadicLexer' cont = do
chr <- get
case (rest chr) of
('\n':xs) -> do
put chr {rest = xs, lineno = (lineno chr) + 1, nl = True}
monadicLexer' cont
('/':'*':xs) -> do
put chr {rest = xs}
scanComment cont
... | 1,367 | monadicLexer' cont = do
chr <- get
case (rest chr) of
('\n':xs) -> do
put chr {rest = xs, lineno = (lineno chr) + 1, nl = True}
monadicLexer' cont
('/':'*':xs) -> do
put chr {rest = xs}
scanComment cont
_ -> do
let (token, xs) =... | 1,328 | false | true | 0 | 17 | 541 | 216 | 108 | 108 | null | null |
TOSPIO/yi | src/library/Yi/UI/Pango/Gnome.hs | gpl-2.0 | watchSystemFont :: (FontDescription -> IO ()) -> IO ()
watchSystemFont cb = do
gconf <- gconfGetDefault
gconfAddDir gconf "/desktop/gnome/interface"
watch gconf monospaceFontKey (cb <=< fontDescriptionFromString) | 218 | watchSystemFont :: (FontDescription -> IO ()) -> IO ()
watchSystemFont cb = do
gconf <- gconfGetDefault
gconfAddDir gconf "/desktop/gnome/interface"
watch gconf monospaceFontKey (cb <=< fontDescriptionFromString) | 218 | watchSystemFont cb = do
gconf <- gconfGetDefault
gconfAddDir gconf "/desktop/gnome/interface"
watch gconf monospaceFontKey (cb <=< fontDescriptionFromString) | 163 | false | true | 0 | 9 | 30 | 67 | 31 | 36 | null | null |
emwap/feldspar-compiler | lib/Feldspar/Compiler/Imperative/Frontend.hs | bsd-3-clause | if' ce tb (Just eb) = Switch ce [(Pat (litB True), tb), (Pat (litB False), eb)] | 79 | if' ce tb (Just eb) = Switch ce [(Pat (litB True), tb), (Pat (litB False), eb)] | 79 | if' ce tb (Just eb) = Switch ce [(Pat (litB True), tb), (Pat (litB False), eb)] | 79 | false | false | 0 | 10 | 15 | 61 | 31 | 30 | null | null |
flowbox-public/imagemagick | Graphics/ImageMagick/MagickWand/PixelIterator.hs | apache-2.0 | pixelIterator :: (MonadResource m) => Ptr MagickWand -> m (ReleaseKey, PPixelIterator)
pixelIterator w = allocate (F.newPixelIterator w) destroy
where destroy = void . F.destroyPixelIterator | 192 | pixelIterator :: (MonadResource m) => Ptr MagickWand -> m (ReleaseKey, PPixelIterator)
pixelIterator w = allocate (F.newPixelIterator w) destroy
where destroy = void . F.destroyPixelIterator | 192 | pixelIterator w = allocate (F.newPixelIterator w) destroy
where destroy = void . F.destroyPixelIterator | 105 | false | true | 0 | 8 | 25 | 66 | 33 | 33 | null | null |
abhinav/tbr | app/TBR/Core.hs | mit | -- | Queries the given list of books for books that match the given criteria.
query :: Text -> BookList -> BookList
query q = Set.filter matcher
where matcher = (||) <$> match . bookTitle
<*> match . bookAuthor
match = tokenMatch q
-- | Expects exactly one book and throws an error if... | 343 | query :: Text -> BookList -> BookList
query q = Set.filter matcher
where matcher = (||) <$> match . bookTitle
<*> match . bookAuthor
match = tokenMatch q
-- | Expects exactly one book and throws an error if that is not satisfied. | 265 | query q = Set.filter matcher
where matcher = (||) <$> match . bookTitle
<*> match . bookAuthor
match = tokenMatch q
-- | Expects exactly one book and throws an error if that is not satisfied. | 227 | true | true | 2 | 8 | 93 | 74 | 34 | 40 | null | null |
DavidEichmann/GameGeometry | src/Geometry/RayTrace.hs | bsd-3-clause | rayTrace :: forall p hasSeg. (Fractional p, Ord p, HasSeg hasSeg p)
=> [hasSeg]
-> Ray p
-> [(Pos p, hasSeg)]
rayTrace edges ray@(Ray' rayStart _)
-- Sort by distance to ray start
= sortOn (qd rayStart . fst)
-- Get all segment based ray traces.
. mapMaybe rayTraceSeg
$ edges
where
... | 612 | rayTrace :: forall p hasSeg. (Fractional p, Ord p, HasSeg hasSeg p)
=> [hasSeg]
-> Ray p
-> [(Pos p, hasSeg)]
rayTrace edges ray@(Ray' rayStart _)
-- Sort by distance to ray start
= sortOn (qd rayStart . fst)
-- Get all segment based ray traces.
. mapMaybe rayTraceSeg
$ edges
where
... | 612 | rayTrace edges ray@(Ray' rayStart _)
-- Sort by distance to ray start
= sortOn (qd rayStart . fst)
-- Get all segment based ray traces.
. mapMaybe rayTraceSeg
$ edges
where
rayTraceSeg :: hasSeg -> Maybe (Pos p, hasSeg)
rayTraceSeg seg = do
intersectPoint <- toClosest... | 490 | false | true | 0 | 13 | 165 | 177 | 91 | 86 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeInstanceAttribute.hs | mpl-2.0 | -- | The instance type.
diar1InstanceType :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
diar1InstanceType =
lens _diar1InstanceType (\s a -> s { _diar1InstanceType = a }) | 194 | diar1InstanceType :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
diar1InstanceType =
lens _diar1InstanceType (\s a -> s { _diar1InstanceType = a }) | 170 | diar1InstanceType =
lens _diar1InstanceType (\s a -> s { _diar1InstanceType = a }) | 86 | true | true | 0 | 9 | 27 | 46 | 25 | 21 | null | null |
girving/duck | duck/TypeSet.hs | bsd-3-clause | -- |@subset s t@ tries to turn @t@ into @s@ via variable substitutions,
-- but not the other way round. In other words, subset succeeds if it finds
-- a variable substituion M s.t. S(s) <= S(t|M).
--
-- Note that the occurs check is unnecessary here due to directedness. In
-- particular, all constraint bindings are o... | 1,418 | subset :: TypeMonad m => TypeVal -> TypePat -> m (Either [Var] TypeEnv)
subset t t' = runEnv $ subset' t t' >>= subsetFix Map.empty | 131 | subset t t' = runEnv $ subset' t t' >>= subsetFix Map.empty | 59 | true | true | 2 | 12 | 262 | 90 | 53 | 37 | null | null |
conal/shady-render | src/Shady/MechanicsGL.hs | agpl-3.0 | -- Strangely, glUniform1i etc want locations as GLint, while
-- glGetUniformLoc wants them as GLuint
-- Make a single BufferObject
mkBuffer :: IO BufferObject
mkBuffer = head <$> genObjectNames 1 | 197 | mkBuffer :: IO BufferObject
mkBuffer = head <$> genObjectNames 1 | 64 | mkBuffer = head <$> genObjectNames 1 | 36 | true | true | 0 | 6 | 31 | 24 | 13 | 11 | null | null |
FranklinChen/reddit | src/Reddit.hs | bsd-2-clause | -- | Run a 'Reddit' or 'RedditT' action with custom settings. You probably won't need this function for
-- most things, but it's handy if you want to persist a connection over multiple 'Reddit' sessions or
-- use a custom user agent string.
runResumeRedditWith :: MonadIO m => RedditOptions -> RedditT m a -> m (Eith... | 990 | runResumeRedditWith :: MonadIO m => RedditOptions -> RedditT m a -> m (Either (APIError RedditError, Maybe (RedditT m a)) a)
runResumeRedditWith (RedditOptions rl man lm _ua) reddit = do
manager <- case man of
Just m -> return m
Nothing -> liftIO $ newManager tlsManagerSettings
loginCreds <- case lm of
... | 745 | runResumeRedditWith (RedditOptions rl man lm _ua) reddit = do
manager <- case man of
Just m -> return m
Nothing -> liftIO $ newManager tlsManagerSettings
loginCreds <- case lm of
Anonymous -> return $ Right Nothing
StoredDetails ld -> return $ Right $ Just ld
Credentials user pass -> liftM (fmap... | 620 | true | true | 0 | 16 | 205 | 289 | 139 | 150 | null | null |
giogadi/hs-motion-planning | lib-src/Data/Spaces/StandardSpace.hs | mit | stateDistanceSqrd _ _ _ =
error "StandardSpace.stateDistanceSqrd: spaces and states don't line up!" | 101 | stateDistanceSqrd _ _ _ =
error "StandardSpace.stateDistanceSqrd: spaces and states don't line up!" | 101 | stateDistanceSqrd _ _ _ =
error "StandardSpace.stateDistanceSqrd: spaces and states don't line up!" | 101 | false | false | 1 | 5 | 14 | 17 | 6 | 11 | null | null |
rvion/stack | src/Stack/Package.hs | bsd-3-clause | warnMultiple
:: MonadLogger m
=> DotCabalDescriptor -> Path b t -> [Path b t] -> m ()
warnMultiple name candidate rest =
$logWarn
("There were multiple candidates for the Cabal entry \"" <>
showName name <>
"\" (" <>
T.intercalate "," (map (T.pack . toFilePath) rest) <>
... | 784 | warnMultiple
:: MonadLogger m
=> DotCabalDescriptor -> Path b t -> [Path b t] -> m ()
warnMultiple name candidate rest =
$logWarn
("There were multiple candidates for the Cabal entry \"" <>
showName name <>
"\" (" <>
T.intercalate "," (map (T.pack . toFilePath) rest) <>
... | 784 | warnMultiple name candidate rest =
$logWarn
("There were multiple candidates for the Cabal entry \"" <>
showName name <>
"\" (" <>
T.intercalate "," (map (T.pack . toFilePath) rest) <>
"), picking " <>
T.pack (toFilePath candidate))
where showName (DotCabalModu... | 690 | false | true | 3 | 15 | 206 | 209 | 103 | 106 | null | null |
Ferdinand-vW/sessiontypes | src/Control/SessionTypes/Interactive.hs | gpl-3.0 | -- | For this function tThe user will act as the dual to the given `STTerm`. User interaction is only required
-- when the given program does a receive or an offer.
--
-- A possible interaction goes as follows:
--
-- @
-- prog = do
-- send 5
-- x <- recv
-- offer (eps x) (eps "")
--
-- main = interactive prog
-- @
-... | 543 | interactive :: (MonadIO m, HasConstraints '[Read, Show, Typeable] s, Show a) => STTerm m s r a -> m a
interactive (Send _ r) = interactive r | 140 | interactive (Send _ r) = interactive r | 38 | true | true | 0 | 8 | 116 | 92 | 55 | 37 | null | null |
koterpillar/labyrinth | testsuite/TestLabyrinth/Move/Movement.hs | mit | test_to_pit = do
let lab = applyState interesting_labyrinth $ do
currentTurn .= 1
(cell (Pos 3 2) . cbullets) .= 1
(cell (Pos 4 0) . cgrenades) .= 1
(player 1 . pgrenades) .= 0
(player 1 . pbullets) .= 0
assertMoveUpdates'
lab
(Move [goTowards U])
... | 1,010 | test_to_pit = do
let lab = applyState interesting_labyrinth $ do
currentTurn .= 1
(cell (Pos 3 2) . cbullets) .= 1
(cell (Pos 4 0) . cgrenades) .= 1
(player 1 . pgrenades) .= 0
(player 1 . pbullets) .= 0
assertMoveUpdates'
lab
(Move [goTowards U])
... | 1,010 | test_to_pit = do
let lab = applyState interesting_labyrinth $ do
currentTurn .= 1
(cell (Pos 3 2) . cbullets) .= 1
(cell (Pos 4 0) . cgrenades) .= 1
(player 1 . pgrenades) .= 0
(player 1 . pbullets) .= 0
assertMoveUpdates'
lab
(Move [goTowards U])
... | 1,010 | false | false | 1 | 18 | 392 | 426 | 197 | 229 | null | null |
drcabana/euler-fp | source/hs/P26.hs | epl-1.0 | firstRepeatedElt xs =
fre xs Map.empty
where
fre xs seen =
let x = head xs
in if (Map.member x seen) then x
else fre (tail xs) (Map.insert x x seen) | 177 | firstRepeatedElt xs =
fre xs Map.empty
where
fre xs seen =
let x = head xs
in if (Map.member x seen) then x
else fre (tail xs) (Map.insert x x seen) | 177 | firstRepeatedElt xs =
fre xs Map.empty
where
fre xs seen =
let x = head xs
in if (Map.member x seen) then x
else fre (tail xs) (Map.insert x x seen) | 177 | false | false | 0 | 11 | 59 | 85 | 40 | 45 | null | null |
urbanslug/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp _ res IndexOffAddrOp_Float args = doIndexOffAddrOp Nothing f32 res args | 100 | emitPrimOp _ res IndexOffAddrOp_Float args = doIndexOffAddrOp Nothing f32 res args | 100 | emitPrimOp _ res IndexOffAddrOp_Float args = doIndexOffAddrOp Nothing f32 res args | 100 | false | false | 1 | 5 | 28 | 26 | 11 | 15 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/CocoStudio.hs | bsd-3-clause | csLoader_createNodeOfVisibleSize :: (M1.StdStringValue arg'1) => arg'1 -> HoppyP.IO M5.Node
csLoader_createNodeOfVisibleSize arg'1 =
M1.withStdStringPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap M5.Node
(csLoader_createNodeOfVisibleSize' arg'1') | 274 | csLoader_createNodeOfVisibleSize :: (M1.StdStringValue arg'1) => arg'1 -> HoppyP.IO M5.Node
csLoader_createNodeOfVisibleSize arg'1 =
M1.withStdStringPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap M5.Node
(csLoader_createNodeOfVisibleSize' arg'1') | 274 | csLoader_createNodeOfVisibleSize arg'1 =
M1.withStdStringPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap M5.Node
(csLoader_createNodeOfVisibleSize' arg'1') | 182 | false | true | 2 | 8 | 29 | 82 | 38 | 44 | null | null |
fpco/hlint | src/Hint/Import.hs | bsd-3-clause | multiExport :: Module S -> [Idea]
multiExport x =
[ rawIdea Warning "Use import/export shortcut" (toSrcSpan $ ann hd)
(unlines $ prettyPrint hd : map prettyPrint imps)
(Just $ unlines $ prettyPrint newhd : map prettyPrint newimps)
[]
| Module l (Just hd) _ imp _ <- [x]
, let asNames ... | 1,040 | multiExport :: Module S -> [Idea]
multiExport x =
[ rawIdea Warning "Use import/export shortcut" (toSrcSpan $ ann hd)
(unlines $ prettyPrint hd : map prettyPrint imps)
(Just $ unlines $ prettyPrint newhd : map prettyPrint newimps)
[]
| Module l (Just hd) _ imp _ <- [x]
, let asNames ... | 1,040 | multiExport x =
[ rawIdea Warning "Use import/export shortcut" (toSrcSpan $ ann hd)
(unlines $ prettyPrint hd : map prettyPrint imps)
(Just $ unlines $ prettyPrint newhd : map prettyPrint newimps)
[]
| Module l (Just hd) _ imp _ <- [x]
, let asNames = mapMaybe importAs imp
, let ... | 1,006 | false | true | 0 | 16 | 294 | 427 | 217 | 210 | null | null |
petabricks/petabricks | scripts/oldtuner2/src/GP/Genetic.hs | mit | advancePath :: Subtree -> Subtree
advancePath subtree = subtree { path = (tail . path) subtree } | 96 | advancePath :: Subtree -> Subtree
advancePath subtree = subtree { path = (tail . path) subtree } | 96 | advancePath subtree = subtree { path = (tail . path) subtree } | 62 | false | true | 0 | 10 | 16 | 40 | 20 | 20 | null | null |
edofic/core.js | src/Immediate/Dependencies.hs | mit | usedModuleExp (Case e _ _ alts) = usedModuleExp e `S.union` usedModuleAlts alts | 79 | usedModuleExp (Case e _ _ alts) = usedModuleExp e `S.union` usedModuleAlts alts | 79 | usedModuleExp (Case e _ _ alts) = usedModuleExp e `S.union` usedModuleAlts alts | 79 | false | false | 0 | 6 | 11 | 36 | 17 | 19 | null | null |
ezyang/ghc | testsuite/tests/codeGen/should_run/T9533.hs | bsd-3-clause | test = case x - y of
5 -> "C"
-1 -> "A"
_ -> "B" | 76 | test = case x - y of
5 -> "C"
-1 -> "A"
_ -> "B" | 76 | test = case x - y of
5 -> "C"
-1 -> "A"
_ -> "B" | 76 | false | false | 0 | 8 | 43 | 34 | 17 | 17 | null | null |
rjohnsondev/haskellshop | src/Render/Alerts.hs | bsd-2-clause | splicesFromAlert :: Splices (RuntimeSplice AppHandler (Text, Text) -> C.Splice AppHandler)
splicesFromAlert = do "level" ## C.pureSplice $ C.textSplice fst
"msg" ## C.pureSplice $ C.textSplice snd | 220 | splicesFromAlert :: Splices (RuntimeSplice AppHandler (Text, Text) -> C.Splice AppHandler)
splicesFromAlert = do "level" ## C.pureSplice $ C.textSplice fst
"msg" ## C.pureSplice $ C.textSplice snd | 220 | splicesFromAlert = do "level" ## C.pureSplice $ C.textSplice fst
"msg" ## C.pureSplice $ C.textSplice snd | 129 | false | true | 2 | 10 | 48 | 76 | 35 | 41 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/TagValues/Get.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
tvgUploadProtocol :: Lens' TagValuesGet (Maybe Text)
tvgUploadProtocol
= lens _tvgUploadProtocol
(\ s a -> s{_tvgUploadProtocol = a}) | 203 | tvgUploadProtocol :: Lens' TagValuesGet (Maybe Text)
tvgUploadProtocol
= lens _tvgUploadProtocol
(\ s a -> s{_tvgUploadProtocol = a}) | 141 | tvgUploadProtocol
= lens _tvgUploadProtocol
(\ s a -> s{_tvgUploadProtocol = a}) | 88 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
mcschroeder/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprSkolInfo (RuleSkol name) = text "the RULE" <+> pprRuleName name | 68 | pprSkolInfo (RuleSkol name) = text "the RULE" <+> pprRuleName name | 68 | pprSkolInfo (RuleSkol name) = text "the RULE" <+> pprRuleName name | 68 | false | false | 0 | 7 | 11 | 25 | 11 | 14 | null | null |
elieux/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | sb :: Word -> [a] -> [a] -> SnocBuilder a
sb lp f r
| lp < 255 || (lp .&. (lp + 1)) /= 0 = SnocBuilder lp f r
| otherwise = SnocBuilder lp (f ++ reverse r) [] | 187 | sb :: Word -> [a] -> [a] -> SnocBuilder a
sb lp f r
| lp < 255 || (lp .&. (lp + 1)) /= 0 = SnocBuilder lp f r
| otherwise = SnocBuilder lp (f ++ reverse r) [] | 187 | sb lp f r
| lp < 255 || (lp .&. (lp + 1)) /= 0 = SnocBuilder lp f r
| otherwise = SnocBuilder lp (f ++ reverse r) [] | 145 | false | true | 1 | 13 | 69 | 104 | 52 | 52 | null | null |
athanclark/lucid-foundation | src/Lucid/Foundation/Structure/Visibility.hs | bsd-3-clause | visible_for_xxlarge_up_ :: T.Text
visible_for_xxlarge_up_ = " visible-for-xxlarge-up " | 86 | visible_for_xxlarge_up_ :: T.Text
visible_for_xxlarge_up_ = " visible-for-xxlarge-up " | 86 | visible_for_xxlarge_up_ = " visible-for-xxlarge-up " | 52 | false | true | 0 | 7 | 7 | 20 | 8 | 12 | null | null |
coolhacks/scripts-hacks | examples/shellcheck-master/ShellCheck/Parser.hs | mit | specialVariable = oneOf "@*#?-$!" | 33 | specialVariable = oneOf "@*#?-$!" | 33 | specialVariable = oneOf "@*#?-$!" | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rueshyna/gogol | gogol-affiliates/gen/Network/Google/Resource/GAN/Advertisers/List.hs | mpl-2.0 | -- | Max number of items to return in this page. Optional. Defaults to 20.
alMaxResults :: Lens' AdvertisersList (Maybe Word32)
alMaxResults
= lens _alMaxResults (\ s a -> s{_alMaxResults = a})
. mapping _Coerce | 219 | alMaxResults :: Lens' AdvertisersList (Maybe Word32)
alMaxResults
= lens _alMaxResults (\ s a -> s{_alMaxResults = a})
. mapping _Coerce | 144 | alMaxResults
= lens _alMaxResults (\ s a -> s{_alMaxResults = a})
. mapping _Coerce | 91 | true | true | 1 | 9 | 42 | 56 | 28 | 28 | null | null |
573/leksah | src/IDE/Workspaces.hs | gpl-2.0 | packageTry :: PackageAction -> IDEAction
packageTry f = workspaceTry $ do
maybePackage <- lift $ readIDE activePack
case maybePackage of
Just p -> runPackage f p
Nothing -> do
window <- lift getMainWindow
resp <- liftIO $ do
md... | 1,238 | packageTry :: PackageAction -> IDEAction
packageTry f = workspaceTry $ do
maybePackage <- lift $ readIDE activePack
case maybePackage of
Just p -> runPackage f p
Nothing -> do
window <- lift getMainWindow
resp <- liftIO $ do
md... | 1,238 | packageTry f = workspaceTry $ do
maybePackage <- lift $ readIDE activePack
case maybePackage of
Just p -> runPackage f p
Nothing -> do
window <- lift getMainWindow
resp <- liftIO $ do
md <- messageDialogNew (Just window) [] Mes... | 1,197 | false | true | 0 | 20 | 553 | 281 | 124 | 157 | null | null |
opqdonut/riot | Riot/UI.hs | gpl-2.0 | calc_scroll s asc csc_fn msc_fn text size =
max 0 (min msc (csc + asc))
where
msc = msc_fn text size
csc = csc_fn s | 140 | calc_scroll s asc csc_fn msc_fn text size =
max 0 (min msc (csc + asc))
where
msc = msc_fn text size
csc = csc_fn s | 140 | calc_scroll s asc csc_fn msc_fn text size =
max 0 (min msc (csc + asc))
where
msc = msc_fn text size
csc = csc_fn s | 140 | false | false | 1 | 9 | 49 | 60 | 29 | 31 | null | null |
lordi/flowskell | src/Flowskell/Display.hs | gpl-2.0 | unitQuad = do
let texCoord2f = texCoord :: TexCoord2 GLfloat -> IO ()
vertex3f = vertex :: Vertex3 GLfloat -> IO ()
renderPrimitive Quads $ do
texCoord2f (TexCoord2 1 1); vertex3f (Vertex3 (-1) (-1) 0 )
texCoord2f (TexCoord2 1 0); vertex3f (Vertex3 (-1) 1 0 )
texCoord2f (TexCoord2 0 0); ver... | 416 | unitQuad = do
let texCoord2f = texCoord :: TexCoord2 GLfloat -> IO ()
vertex3f = vertex :: Vertex3 GLfloat -> IO ()
renderPrimitive Quads $ do
texCoord2f (TexCoord2 1 1); vertex3f (Vertex3 (-1) (-1) 0 )
texCoord2f (TexCoord2 1 0); vertex3f (Vertex3 (-1) 1 0 )
texCoord2f (TexCoord2 0 0); ver... | 416 | unitQuad = do
let texCoord2f = texCoord :: TexCoord2 GLfloat -> IO ()
vertex3f = vertex :: Vertex3 GLfloat -> IO ()
renderPrimitive Quads $ do
texCoord2f (TexCoord2 1 1); vertex3f (Vertex3 (-1) (-1) 0 )
texCoord2f (TexCoord2 1 0); vertex3f (Vertex3 (-1) 1 0 )
texCoord2f (TexCoord2 0 0); ver... | 416 | false | false | 1 | 15 | 111 | 208 | 96 | 112 | null | null |
christiaanb/ghc | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | noVars :: FV
noVars _ _ = emptyVarSet | 37 | noVars :: FV
noVars _ _ = emptyVarSet | 37 | noVars _ _ = emptyVarSet | 24 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
leichunfeng/learnyouahaskell | Functionally-Solving-Problems.hs | mit | -------------------------------------
-- Reverse Polish notation calculator
-------------------------------------
--solveRPN :: (Num a, Read a) => String -> a
--solveRPN = head . foldl foldingFunction [] . words
-- where foldingFunction (x:y:ys) "*" = (x * y):ys
-- foldingFunction (x:y:ys) "+" = (x + y... | 1,172 | solveRPN :: String -> Float
solveRPN = head . foldl foldingFunction [] . words
where foldingFunction (x:y:ys) "*" = (x * y):ys
foldingFunction (x:y:ys) "+" = (x + y):ys
foldingFunction (x:y:ys) "-" = (y - x):ys
foldingFunction (x:y:ys) "/" = (y / x):ys
foldingFuncti... | 721 | solveRPN = head . foldl foldingFunction [] . words
where foldingFunction (x:y:ys) "*" = (x * y):ys
foldingFunction (x:y:ys) "+" = (x + y):ys
foldingFunction (x:y:ys) "-" = (y - x):ys
foldingFunction (x:y:ys) "/" = (y / x):ys
foldingFunction (x:y:ys) "^" = (y ** x):y... | 693 | true | true | 1 | 8 | 292 | 275 | 146 | 129 | null | null |
fmapfmapfmap/amazonka | amazonka-swf/gen/Network/AWS/SWF/RespondActivityTaskCompleted.hs | mpl-2.0 | -- | The result of the activity task. It is a free form string that is
-- implementation specific.
ratcResult :: Lens' RespondActivityTaskCompleted (Maybe Text)
ratcResult = lens _ratcResult (\ s a -> s{_ratcResult = a}) | 220 | ratcResult :: Lens' RespondActivityTaskCompleted (Maybe Text)
ratcResult = lens _ratcResult (\ s a -> s{_ratcResult = a}) | 121 | ratcResult = lens _ratcResult (\ s a -> s{_ratcResult = a}) | 59 | true | true | 0 | 9 | 35 | 47 | 26 | 21 | null | null |
kazu-yamamoto/network-uri | tests/uri001.hs | bsd-3-clause | isAbsRfT _ = False | 22 | isAbsRfT _ = False | 22 | isAbsRfT _ = False | 22 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
jjeffrey/grafos | grafos.hs | mit | esFormaTriangular :: Aristas -> Bool
esFormaTriangular = snd . foldr (\filaAlta (filaBaja, tof) ->
if length filaAlta == 1 + length filaBaja
then (filaAlta, tof)
else (filaAlta, False)) ([], True) | 268 | esFormaTriangular :: Aristas -> Bool
esFormaTriangular = snd . foldr (\filaAlta (filaBaja, tof) ->
if length filaAlta == 1 + length filaBaja
then (filaAlta, tof)
else (filaAlta, False)) ([], True) | 268 | esFormaTriangular = snd . foldr (\filaAlta (filaBaja, tof) ->
if length filaAlta == 1 + length filaBaja
then (filaAlta, tof)
else (filaAlta, False)) ([], True) | 231 | false | true | 0 | 12 | 101 | 82 | 46 | 36 | null | null |
bjpop/berp | libs/src/Berp/Base/StdTypes/Type.hs | bsd-3-clause | {- Compute the linearization of a class with respect to its base classes.
From the Python Pep "The Python 2.3 Method Resolution Order":
"the linearization of C is the sum of C plus the merge of the
linearizations of the parents and the list of the parents."
L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1... | 1,426 | mro :: Object -> [Object] -> [Object]
mro klass bases
= klass : merge (map getMro bases ++ [bases])
where
getMro :: Object -> [Object]
getMro (Type { object_mro = obj }) = getTupleElements obj
getMro _other = error "Fatal error: object's base is not a type" -- XXX fixme
{-
From the Python Pep "The Pyt... | 1,092 | mro klass bases
= klass : merge (map getMro bases ++ [bases])
where
getMro :: Object -> [Object]
getMro (Type { object_mro = obj }) = getTupleElements obj
getMro _other = error "Fatal error: object's base is not a type" -- XXX fixme
{-
From the Python Pep "The Python 2.3 Method Resolution Order":
t... | 1,054 | true | true | 0 | 9 | 322 | 108 | 56 | 52 | null | null |
cbpark/GluinoStopPolarization | exe/Jet/Hist1D.hs | gpl-3.0 | saveHist :: Args -> IO ()
saveHist (Args infiles variable outfile) = mkHist infiles outfile variable histData | 109 | saveHist :: Args -> IO ()
saveHist (Args infiles variable outfile) = mkHist infiles outfile variable histData | 109 | saveHist (Args infiles variable outfile) = mkHist infiles outfile variable histData | 83 | false | true | 0 | 7 | 16 | 42 | 20 | 22 | null | null |
KarimxD/Evolverbetert | src/Parameters.hs | mit | pGenDel = 3e-4 :: Prob | 26 | pGenDel = 3e-4 :: Prob | 26 | pGenDel = 3e-4 :: Prob | 26 | false | false | 0 | 4 | 8 | 9 | 5 | 4 | null | null |
deggis/guesswork | src/Guesswork/Math/Statistics.hs | bsd-3-clause | avg xs = sum xs / (fromIntegral . length $ xs) | 46 | avg xs = sum xs / (fromIntegral . length $ xs) | 46 | avg xs = sum xs / (fromIntegral . length $ xs) | 46 | false | false | 0 | 8 | 10 | 27 | 13 | 14 | null | null |
JustusAdam/dictcc | lib/DictCC/Serialize.hs | bsd-3-clause | handlePage :: Cursor -> Either T.Text TranslationTable
handlePage c =
let
main = attributeIs "id" "maincontent" &/ element "table"
in
case c $// main of
[_, transTable, _] -> findTranslations transTable
_ -> Left "No translations found" | 277 | handlePage :: Cursor -> Either T.Text TranslationTable
handlePage c =
let
main = attributeIs "id" "maincontent" &/ element "table"
in
case c $// main of
[_, transTable, _] -> findTranslations transTable
_ -> Left "No translations found" | 277 | handlePage c =
let
main = attributeIs "id" "maincontent" &/ element "table"
in
case c $// main of
[_, transTable, _] -> findTranslations transTable
_ -> Left "No translations found" | 222 | false | true | 0 | 10 | 77 | 83 | 40 | 43 | null | null |
rvion/ride | jetpack/src/Network/Wai/Handler/Warp/AsWai.hs | bsd-3-clause | -- wai_socketConnection :: Socket -> IO Connection
wai_socketConnection = I.socketConnection | 92 | wai_socketConnection = I.socketConnection | 41 | wai_socketConnection = I.socketConnection | 41 | true | false | 0 | 5 | 9 | 9 | 5 | 4 | null | null |
snowleopard/alga | src/Algebra/Graph/Label.hs | mit | -- | An alias for 'mempty'.
zero :: Monoid a => a
zero = mempty | 63 | zero :: Monoid a => a
zero = mempty | 35 | zero = mempty | 13 | true | true | 0 | 7 | 14 | 26 | 11 | 15 | null | null |
geocurnoff/nikki | src/Base/Types.hs | lgpl-3.0 | epToCenterPosition :: Size Double -> EditorPosition -> Qt.Position Double
epToCenterPosition size ep = epToPosition size ep +~ fmap (/ 2) (size2position size) | 158 | epToCenterPosition :: Size Double -> EditorPosition -> Qt.Position Double
epToCenterPosition size ep = epToPosition size ep +~ fmap (/ 2) (size2position size) | 158 | epToCenterPosition size ep = epToPosition size ep +~ fmap (/ 2) (size2position size) | 84 | false | true | 0 | 9 | 21 | 60 | 28 | 32 | null | null |
NoobsEnslaver/hDromParser | Main.hs | gpl-3.0 | --import Control.Monad(liftM)
--import System.Directory(renameFile)
{-
TODO:
Take next options of grabbing from command line
-selecting region
-selecting marks
-file path for save results
-result type (db, file, etc) (?)
Realize next features:
-parse description of the car
-parse comments about the c... | 577 | marks = ["audi", "bmw", "chevrolet"] | 36 | marks = ["audi", "bmw", "chevrolet"] | 36 | true | false | 1 | 5 | 104 | 21 | 12 | 9 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Ruby.hs | gpl-2.0 | regex_'27'28'5cw'2b'29'27 = compileRegex True "'(\\w+)'" | 56 | regex_'27'28'5cw'2b'29'27 = compileRegex True "'(\\w+)'" | 56 | regex_'27'28'5cw'2b'29'27 = compileRegex True "'(\\w+)'" | 56 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
YellPika/Hannel | src/Control/Concurrent/Transactional/Event/SyncLock.hs | mit | acquire :: SyncLock -> IO Bool
acquire lock = do
synced' <- isSynced lock
if synced' then
return False
else do
synced'' <- takeMVar $ status lock
when synced'' $ putMVar (status lock) True
return $ not synced'' | 255 | acquire :: SyncLock -> IO Bool
acquire lock = do
synced' <- isSynced lock
if synced' then
return False
else do
synced'' <- takeMVar $ status lock
when synced'' $ putMVar (status lock) True
return $ not synced'' | 255 | acquire lock = do
synced' <- isSynced lock
if synced' then
return False
else do
synced'' <- takeMVar $ status lock
when synced'' $ putMVar (status lock) True
return $ not synced'' | 224 | false | true | 0 | 13 | 82 | 90 | 40 | 50 | null | null |
cfredric/arithmoi | Math/NumberTheory/Unsafe.hs | mit | unsafeRead :: (MArray a e m, Ix i) => a i e -> i -> m e
unsafeRead = readArray | 78 | unsafeRead :: (MArray a e m, Ix i) => a i e -> i -> m e
unsafeRead = readArray | 78 | unsafeRead = readArray | 22 | false | true | 0 | 8 | 19 | 46 | 23 | 23 | null | null |
matthiasgoergens/redgrep | src/Red.hs | bsd-3-clause | fold'
:: forall a
. (Maybe [a] -> Re a a) -- Sym
-> (forall x y . Re a x -> Re a y -> Re a (Either x y)) -- Alt
-> (forall x y . Re a x -> Re a y -> Re a (x,y)) -- Cut
-> (forall x y . Re a x -> Re a y -> Re a (x,y)) -- Seq
-> (forall x . Re a x -> Re a [x]) -- Rep
-> (forall x . Re a x -> ... | 921 | fold'
:: forall a
. (Maybe [a] -> Re a a) -- Sym
-> (forall x y . Re a x -> Re a y -> Re a (Either x y)) -- Alt
-> (forall x y . Re a x -> Re a y -> Re a (x,y)) -- Cut
-> (forall x y . Re a x -> Re a y -> Re a (x,y)) -- Seq
-> (forall x . Re a x -> Re a [x]) -- Rep
-> (forall x . Re a x -> ... | 921 | fold' sym alt cut seq rep not eps nil fmap =
let h :: forall y. Re a y -> Re a y
h re = case re of
Sym char -> sym char
Alt x y -> alt (h x) (h y)
Cut x y -> cut (h x) (h y)
Seq x y -> seq (h x) (h y)
Rep x -> rep (h x)
Not x -> not (h ... | 418 | false | true | 0 | 20 | 403 | 565 | 281 | 284 | null | null |
agocorona/transient-universe | tests/hasrocket.hs | mit | rmap= unsafePerformIO $ newIORef M.empty | 40 | rmap= unsafePerformIO $ newIORef M.empty | 40 | rmap= unsafePerformIO $ newIORef M.empty | 40 | false | false | 3 | 6 | 4 | 21 | 7 | 14 | null | null |
bitemyapp/ghc | libraries/template-haskell/Language/Haskell/TH/Ppr.hs | bsd-3-clause | pprFunArgType ty@((ArrowT `AppT` _) `AppT` _) = parens (ppr ty) | 63 | pprFunArgType ty@((ArrowT `AppT` _) `AppT` _) = parens (ppr ty) | 63 | pprFunArgType ty@((ArrowT `AppT` _) `AppT` _) = parens (ppr ty) | 63 | false | false | 1 | 10 | 9 | 45 | 22 | 23 | null | null |
rahulmutt/ghcvm | compiler/Eta/Types/TypeRep.hs | bsd-3-clause | tidyOpenTyVar :: TidyEnv -> TyVar -> (TidyEnv, TyVar)
-- ^ Treat a new 'TyVar' as a binder, and give it a fresh tidy name
-- using the environment if one has not already been allocated. See
-- also 'tidyTyVarBndr'
tidyOpenTyVar env@(_, subst) tyvar
= case lookupVarEnv subst tyvar of
Just tyvar' -> (env, tyvar... | 445 | tidyOpenTyVar :: TidyEnv -> TyVar -> (TidyEnv, TyVar)
tidyOpenTyVar env@(_, subst) tyvar
= case lookupVarEnv subst tyvar of
Just tyvar' -> (env, tyvar') -- Already substituted
Nothing -> tidyTyVarBndr env tyvar -- Treat it as a binder
--------------- | 285 | tidyOpenTyVar env@(_, subst) tyvar
= case lookupVarEnv subst tyvar of
Just tyvar' -> (env, tyvar') -- Already substituted
Nothing -> tidyTyVarBndr env tyvar -- Treat it as a binder
--------------- | 231 | true | true | 0 | 8 | 103 | 80 | 45 | 35 | null | null |
dysinger/amazonka | amazonka-s3/gen/Network/AWS/S3/CompleteMultipartUpload.hs | mpl-2.0 | -- | 'CompleteMultipartUploadResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'cmur1Bucket' @::@ 'Maybe' 'Text'
--
-- * 'cmur1ETag' @::@ 'Maybe' 'Text'
--
-- * 'cmur1Expiration' @::@ 'Maybe' 'Text'
--
-- * 'cmur1Key' @::@ 'Maybe' 'Text'
--
-- * 'cmur1Location' @::@ 'Maybe' 'T... | 974 | completeMultipartUploadResponse :: CompleteMultipartUploadResponse
completeMultipartUploadResponse = CompleteMultipartUploadResponse
{ _cmur1Location = Nothing
, _cmur1Bucket = Nothing
, _cmur1Key = Nothing
, _cmur1Expiration = Nothing
, _cmur1ETa... | 482 | completeMultipartUploadResponse = CompleteMultipartUploadResponse
{ _cmur1Location = Nothing
, _cmur1Bucket = Nothing
, _cmur1Key = Nothing
, _cmur1Expiration = Nothing
, _cmur1ETag = Nothing
, _cmur1ServerSideEncryption = Noth... | 415 | true | true | 0 | 7 | 233 | 85 | 60 | 25 | null | null |
diffusionkinetics/open | dampf/lib/Dampf/Internal/Env.hs | mit | resolveArray :: Vector Value -> IO (Vector Value)
resolveArray = mapM resolveEnvVars | 84 | resolveArray :: Vector Value -> IO (Vector Value)
resolveArray = mapM resolveEnvVars | 84 | resolveArray = mapM resolveEnvVars | 34 | false | true | 0 | 9 | 11 | 36 | 15 | 21 | null | null |
k32/zenmaster | Data/TernaryTree.hs | unlicense | foldWithKey' trail f TNode{_val=v, _eq=e, _left=l, _right=r, _key=k} a =
let
trail' = k:trail
this = case v of
Just x -> f (reverse trail') x
Nothing -> id
in
foldWithKey' trail f r $ foldWithKey' trail' f e $ this $ foldWithKey' trail f l a | 283 | foldWithKey' trail f TNode{_val=v, _eq=e, _left=l, _right=r, _key=k} a =
let
trail' = k:trail
this = case v of
Just x -> f (reverse trail') x
Nothing -> id
in
foldWithKey' trail f r $ foldWithKey' trail' f e $ this $ foldWithKey' trail f l a | 283 | foldWithKey' trail f TNode{_val=v, _eq=e, _left=l, _right=r, _key=k} a =
let
trail' = k:trail
this = case v of
Just x -> f (reverse trail') x
Nothing -> id
in
foldWithKey' trail f r $ foldWithKey' trail' f e $ this $ foldWithKey' trail f l a | 283 | false | false | 0 | 14 | 88 | 135 | 68 | 67 | null | null |
Tener/HaNS | src/Hans/Message/Ip4.hs | bsd-3-clause | moreFragments :: IP4Header -> IP4Header
moreFragments hdr = hdr { ip4MoreFragments = True } | 91 | moreFragments :: IP4Header -> IP4Header
moreFragments hdr = hdr { ip4MoreFragments = True } | 91 | moreFragments hdr = hdr { ip4MoreFragments = True } | 51 | false | true | 0 | 6 | 13 | 26 | 14 | 12 | null | null |
julienschmaltz/madl | examples/Examples/ReorderTestNetwork2.hs | mit | reorder_buffer :: Int -> Int -> MFunctionDisj -> Macro Channel
reorder_buffer idSize returnSize matchFunction =
mkMacro (reorder_buffer_network idSize returnSize matchFunction) ("reorder_buffer_" +++ showT idSize +++ "_" +++ showT returnSize) reorder_buffer_interface | 272 | reorder_buffer :: Int -> Int -> MFunctionDisj -> Macro Channel
reorder_buffer idSize returnSize matchFunction =
mkMacro (reorder_buffer_network idSize returnSize matchFunction) ("reorder_buffer_" +++ showT idSize +++ "_" +++ showT returnSize) reorder_buffer_interface | 272 | reorder_buffer idSize returnSize matchFunction =
mkMacro (reorder_buffer_network idSize returnSize matchFunction) ("reorder_buffer_" +++ showT idSize +++ "_" +++ showT returnSize) reorder_buffer_interface | 209 | false | true | 0 | 10 | 34 | 76 | 35 | 41 | null | null |
solarus/quickgen | testing/Language/Simple.hs | gpl-3.0 | succInt :: Int -> Int
succInt = succ | 36 | succInt :: Int -> Int
succInt = succ | 36 | succInt = succ | 14 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
imalsogreg/stm-demo | Data/CExtraChan.hs | bsd-3-clause | writeExtraChan :: (Ord a) => ExtraChan a -> a -> IO ()
writeExtraChan c a = do
modifyIORef (chan c) (S.|> a)
modifyIORef (minEver c) $ \oldMin -> min a oldMin
modifyIORef (maxEver c) $ \oldMax -> max a oldMax
modifyIORef (lLength c) $ (+1) | 247 | writeExtraChan :: (Ord a) => ExtraChan a -> a -> IO ()
writeExtraChan c a = do
modifyIORef (chan c) (S.|> a)
modifyIORef (minEver c) $ \oldMin -> min a oldMin
modifyIORef (maxEver c) $ \oldMax -> max a oldMax
modifyIORef (lLength c) $ (+1) | 247 | writeExtraChan c a = do
modifyIORef (chan c) (S.|> a)
modifyIORef (minEver c) $ \oldMin -> min a oldMin
modifyIORef (maxEver c) $ \oldMax -> max a oldMax
modifyIORef (lLength c) $ (+1) | 192 | false | true | 0 | 10 | 52 | 138 | 65 | 73 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.