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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SwiftsNamesake/ElegantChess | Server.hs | mit | addCommand :: Handle -> [String] -> IO ()
addCommand handle cmd = do
hPutStrLn handle $ show $ (read $ cmd !! 1) + (read $ cmd !! 2) | 136 | addCommand :: Handle -> [String] -> IO ()
addCommand handle cmd = do
hPutStrLn handle $ show $ (read $ cmd !! 1) + (read $ cmd !! 2) | 136 | addCommand handle cmd = do
hPutStrLn handle $ show $ (read $ cmd !! 1) + (read $ cmd !! 2) | 94 | false | true | 0 | 11 | 32 | 72 | 36 | 36 | null | null |
stevely/hspirv | src/SpirV/Builder/Raw.hs | bsd-3-clause | -- Id 1: Result type, must be integer type
-- Id 2: First operand
-- Id 3: Second operand
bitwiseOr :: Id -> Id -> Id -> Builder Id
bitwiseOr = fourOp OpBitwiseOr | 162 | bitwiseOr :: Id -> Id -> Id -> Builder Id
bitwiseOr = fourOp OpBitwiseOr | 72 | bitwiseOr = fourOp OpBitwiseOr | 30 | true | true | 0 | 8 | 32 | 32 | 17 | 15 | null | null |
adept/hledger | hledger-lib/Hledger/Data/Journal.hs | gpl-3.0 | journalApplyAliases :: [AccountAlias] -> Journal -> Either RegexError Journal
-- short circuit the common case, just in case there's a performance impact from txnTieKnot etc.
journalApplyAliases [] j = Right j | 209 | journalApplyAliases :: [AccountAlias] -> Journal -> Either RegexError Journal
journalApplyAliases [] j = Right j | 112 | journalApplyAliases [] j = Right j | 34 | true | true | 0 | 7 | 30 | 38 | 19 | 19 | null | null |
rueshyna/gogol | gogol-apps-reseller/gen/Network/Google/AppsReseller/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'SubscriptionPlanCommitmentInterval' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'spciStartTime'
--
-- * 'spciEndTime'
subscriptionPlanCommitmentInterval
:: SubscriptionPlanCommitmentInterval
subscriptionPlanCommitmentInterval =
SubscriptionPlanCommitmentInterval'
{ _spciStartTime = Nothing
, _spciEndTime = Nothing
} | 451 | subscriptionPlanCommitmentInterval
:: SubscriptionPlanCommitmentInterval
subscriptionPlanCommitmentInterval =
SubscriptionPlanCommitmentInterval'
{ _spciStartTime = Nothing
, _spciEndTime = Nothing
} | 219 | subscriptionPlanCommitmentInterval =
SubscriptionPlanCommitmentInterval'
{ _spciStartTime = Nothing
, _spciEndTime = Nothing
} | 142 | true | true | 0 | 6 | 72 | 32 | 22 | 10 | null | null |
Blaisorblade/stack | src/Options/Applicative/Builder/Extra.hs | bsd-3-clause | -- | Like 'maybeBoolFlags', but parsing a 'First'.
firstBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (First Bool)
firstBoolFlags long0 help0 mod0 = First <$> maybeBoolFlags long0 help0 mod0 | 215 | firstBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (First Bool)
firstBoolFlags long0 help0 mod0 = First <$> maybeBoolFlags long0 help0 mod0 | 164 | firstBoolFlags long0 help0 mod0 = First <$> maybeBoolFlags long0 help0 mod0 | 75 | true | true | 2 | 11 | 32 | 67 | 31 | 36 | null | null |
gnn/Hets | Common/Keywords.hs | gpl-2.0 | asS :: String
asS = "as" | 24 | asS :: String
asS = "as" | 24 | asS = "as" | 10 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
mightybyte/reflex-dom-stubs | src/GHCJS/DOM/Node.hs | bsd-3-clause | nodeIsDefaultNamespace = undefined | 34 | nodeIsDefaultNamespace = undefined | 34 | nodeIsDefaultNamespace = undefined | 34 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/book/2014-Alejandro_Serrano_Mena-Beginning_Haskell/old/code/src/C06/Main.hs | unlicense | kMeansMain :: (Vector v, Vectorizable e v) => [e] -> Reader (Settings e v) [v]
kMeansMain points' = do
i' <- asks i
k' <- asks k
t' <- asks th
return $ kMeans i' k' points' t'
-- function to execute monad, given the constnat context : `runReader`
-- mtl includes mechanism for executing code with a local context via `local`, given
-- - function to modify current state
-- - computation to perform
-- in computation, calls to `ask` or `asks` refer to modified context
-- will return to original context after local call done
-- e.g., compare run of K-means with k clusters and k+1 clusters | 606 | kMeansMain :: (Vector v, Vectorizable e v) => [e] -> Reader (Settings e v) [v]
kMeansMain points' = do
i' <- asks i
k' <- asks k
t' <- asks th
return $ kMeans i' k' points' t'
-- function to execute monad, given the constnat context : `runReader`
-- mtl includes mechanism for executing code with a local context via `local`, given
-- - function to modify current state
-- - computation to perform
-- in computation, calls to `ask` or `asks` refer to modified context
-- will return to original context after local call done
-- e.g., compare run of K-means with k clusters and k+1 clusters | 606 | kMeansMain points' = do
i' <- asks i
k' <- asks k
t' <- asks th
return $ kMeans i' k' points' t'
-- function to execute monad, given the constnat context : `runReader`
-- mtl includes mechanism for executing code with a local context via `local`, given
-- - function to modify current state
-- - computation to perform
-- in computation, calls to `ask` or `asks` refer to modified context
-- will return to original context after local call done
-- e.g., compare run of K-means with k clusters and k+1 clusters | 527 | false | true | 0 | 9 | 125 | 107 | 54 | 53 | null | null |
guoguo12/haskell-ptable | ptable.hs | apache-2.0 | anum "Ba" = 56 | 14 | anum "Ba" = 56 | 14 | anum "Ba" = 56 | 14 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
phischu/haskell-declarations | src/haskell-declarations.hs | bsd-3-clause | declGenre (DataDecl _ _ _ _ _ _) = Type | 39 | declGenre (DataDecl _ _ _ _ _ _) = Type | 39 | declGenre (DataDecl _ _ _ _ _ _) = Type | 39 | false | false | 0 | 7 | 9 | 25 | 12 | 13 | null | null |
meiersi/bytestring-builder | bench/BoundsCheckFusion.hs | bsd-3-clause | intData :: [Int]
intData = [1..nRepl] | 37 | intData :: [Int]
intData = [1..nRepl] | 37 | intData = [1..nRepl] | 20 | false | true | 0 | 5 | 5 | 19 | 11 | 8 | null | null |
Saulzar/reflex-animation | src/Reflex/Animation.hs | bsd-3-clause | -- | Keyframer using linear interpolation
-- Specified as pairs of (value, interval)
-- First key is provided separately and always starts at time = 0
keyframes :: (VectorSpace v, RealFrac (Scalar v)) => v -> [(Scalar v, v)] -> Clip (Scalar v) v
keyframes = keyframesWith linear | 279 | keyframes :: (VectorSpace v, RealFrac (Scalar v)) => v -> [(Scalar v, v)] -> Clip (Scalar v) v
keyframes = keyframesWith linear | 128 | keyframes = keyframesWith linear | 32 | true | true | 0 | 11 | 48 | 75 | 38 | 37 | null | null |
BartAdv/Idris-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | dumpprobs ((_,_,_,e):es) = show e ++ "\n" ++ dumpprobs es | 57 | dumpprobs ((_,_,_,e):es) = show e ++ "\n" ++ dumpprobs es | 57 | dumpprobs ((_,_,_,e):es) = show e ++ "\n" ++ dumpprobs es | 57 | false | false | 0 | 7 | 9 | 43 | 22 | 21 | null | null |
bennofs/reflex | src/Reflex/Spider/Internal.hs | bsd-3-clause | propagate :: a -> [WeakSubscriber a] -> EventM [WeakSubscriber a]
propagate a subscribers = do
traverseAndCleanWeakList_ (liftIO . deRefWeakSubscriber) subscribers $ \s -> case s of
SubscriberPush compute subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberPush" <> showNodeId subscribed
occ <- compute a
case occ of
Nothing -> return () -- No need to write a Nothing back into the Ref
Just o -> do
liftIO $ writeIORef (pushSubscribedOccurrence subscribed) occ
scheduleClear $ pushSubscribedOccurrence subscribed
liftIO . writeIORef (pushSubscribedSubscribers subscribed) =<< propagate o =<< liftIO (readIORef (pushSubscribedSubscribers subscribed))
SubscriberMerge k subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberMerge" <> showNodeId subscribed
oldM <- liftIO $ readIORef $ mergeSubscribedAccum subscribed
liftIO $ writeIORef (mergeSubscribedAccum subscribed) $ DMap.insertWith (error "Same key fired multiple times for") k a oldM
when (DMap.null oldM) $ do -- Only schedule the firing once
height <- liftIO $ readIORef $ mergeSubscribedHeight subscribed
--TODO: assertions about height
currentHeight <- getCurrentHeight
when (height <= currentHeight) $ error $ "Height (" ++ show height ++ ") is not greater than current height (" ++ show currentHeight ++ ")"
scheduleMerge height subscribed
SubscriberFan subscribed -> do
subs <- liftIO $ readIORef $ fanSubscribedSubscribers subscribed
when debugPropagate $ liftIO $ putStrLn $ "SubscriberFan" <> showNodeId subscribed <> ": " ++ show (DMap.size subs) ++ " keys subscribed, " ++ show (DMap.size a) ++ " keys firing"
--TODO: We need a better DMap intersection; here, we are assuming that the number of firing keys is small and the number of subscribers is large
forM_ (DMap.toList a) $ \(k :=> v) -> case DMap.lookup (FanSubscriberKey k) subs of
Nothing -> do
when debugPropagate $ liftIO $ putStrLn "No subscriber for key"
return ()
Just subsubs -> do
_ <- propagate v subsubs --TODO: use the value of this
return ()
--TODO: The following is way too slow to do all the time
subs' <- liftIO $ forM (DMap.toList subs) $ ((\(FanSubscriberKey k :=> subsubs) -> do
subsubs' <- traverseAndCleanWeakList_ (liftIO . deRefWeakSubscriber) subsubs (const $ return ())
return $ if null subsubs' then Nothing else Just $ FanSubscriberKey k :=> subsubs') :: DSum (FanSubscriberKey k) -> IO (Maybe (DSum (FanSubscriberKey k))))
liftIO $ writeIORef (fanSubscribedSubscribers subscribed) $ DMap.fromDistinctAscList $ catMaybes subs'
SubscriberHold h -> do
invalidators <- liftIO $ readIORef $ holdInvalidators h
when debugPropagate $ liftIO $ putStrLn $ "SubscriberHold" <> showNodeId h <> ": " ++ show (length invalidators)
toAssignRef <- askToAssignRef
liftIO $ modifyIORef' toAssignRef (SomeAssignment h a :)
SubscriberSwitch subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberSwitch" <> showNodeId subscribed
liftIO $ writeIORef (switchSubscribedOccurrence subscribed) $ Just a
scheduleClear $ switchSubscribedOccurrence subscribed
subs <- liftIO $ readIORef $ switchSubscribedSubscribers subscribed
liftIO . writeIORef (switchSubscribedSubscribers subscribed) =<< propagate a subs
SubscriberCoincidenceOuter subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberCoincidenceOuter" <> showNodeId subscribed
outerHeight <- liftIO $ readIORef $ coincidenceSubscribedHeight subscribed
when debugPropagate $ liftIO $ putStrLn $ " outerHeight = " <> show outerHeight
(occ, innerHeight, innerSubd) <- subscribeCoincidenceInner a outerHeight subscribed
when debugPropagate $ liftIO $ putStrLn $ " isJust occ = " <> show (isJust occ)
when debugPropagate $ liftIO $ putStrLn $ " innerHeight = " <> show innerHeight
liftIO $ writeIORef (coincidenceSubscribedInnerParent subscribed) $ Just innerSubd
scheduleClear $ coincidenceSubscribedInnerParent subscribed
case occ of
Nothing -> do
when (innerHeight > outerHeight) $ liftIO $ do -- If the event fires, it will fire at a later height
writeIORef (coincidenceSubscribedHeight subscribed) innerHeight
mapM_ invalidateSubscriberHeight =<< readIORef (coincidenceSubscribedSubscribers subscribed)
mapM_ recalculateSubscriberHeight =<< readIORef (coincidenceSubscribedSubscribers subscribed)
Just o -> do -- Since it's already firing, no need to adjust height
liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) occ
scheduleClear $ coincidenceSubscribedOccurrence subscribed
liftIO . writeIORef (coincidenceSubscribedSubscribers subscribed) =<< propagate o =<< liftIO (readIORef (coincidenceSubscribedSubscribers subscribed))
SubscriberCoincidenceInner subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberCoincidenceInner" <> showNodeId subscribed
liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) $ Just a
scheduleClear $ coincidenceSubscribedOccurrence subscribed
liftIO . writeIORef (coincidenceSubscribedSubscribers subscribed) =<< propagate a =<< liftIO (readIORef (coincidenceSubscribedSubscribers subscribed)) | 5,513 | propagate :: a -> [WeakSubscriber a] -> EventM [WeakSubscriber a]
propagate a subscribers = do
traverseAndCleanWeakList_ (liftIO . deRefWeakSubscriber) subscribers $ \s -> case s of
SubscriberPush compute subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberPush" <> showNodeId subscribed
occ <- compute a
case occ of
Nothing -> return () -- No need to write a Nothing back into the Ref
Just o -> do
liftIO $ writeIORef (pushSubscribedOccurrence subscribed) occ
scheduleClear $ pushSubscribedOccurrence subscribed
liftIO . writeIORef (pushSubscribedSubscribers subscribed) =<< propagate o =<< liftIO (readIORef (pushSubscribedSubscribers subscribed))
SubscriberMerge k subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberMerge" <> showNodeId subscribed
oldM <- liftIO $ readIORef $ mergeSubscribedAccum subscribed
liftIO $ writeIORef (mergeSubscribedAccum subscribed) $ DMap.insertWith (error "Same key fired multiple times for") k a oldM
when (DMap.null oldM) $ do -- Only schedule the firing once
height <- liftIO $ readIORef $ mergeSubscribedHeight subscribed
--TODO: assertions about height
currentHeight <- getCurrentHeight
when (height <= currentHeight) $ error $ "Height (" ++ show height ++ ") is not greater than current height (" ++ show currentHeight ++ ")"
scheduleMerge height subscribed
SubscriberFan subscribed -> do
subs <- liftIO $ readIORef $ fanSubscribedSubscribers subscribed
when debugPropagate $ liftIO $ putStrLn $ "SubscriberFan" <> showNodeId subscribed <> ": " ++ show (DMap.size subs) ++ " keys subscribed, " ++ show (DMap.size a) ++ " keys firing"
--TODO: We need a better DMap intersection; here, we are assuming that the number of firing keys is small and the number of subscribers is large
forM_ (DMap.toList a) $ \(k :=> v) -> case DMap.lookup (FanSubscriberKey k) subs of
Nothing -> do
when debugPropagate $ liftIO $ putStrLn "No subscriber for key"
return ()
Just subsubs -> do
_ <- propagate v subsubs --TODO: use the value of this
return ()
--TODO: The following is way too slow to do all the time
subs' <- liftIO $ forM (DMap.toList subs) $ ((\(FanSubscriberKey k :=> subsubs) -> do
subsubs' <- traverseAndCleanWeakList_ (liftIO . deRefWeakSubscriber) subsubs (const $ return ())
return $ if null subsubs' then Nothing else Just $ FanSubscriberKey k :=> subsubs') :: DSum (FanSubscriberKey k) -> IO (Maybe (DSum (FanSubscriberKey k))))
liftIO $ writeIORef (fanSubscribedSubscribers subscribed) $ DMap.fromDistinctAscList $ catMaybes subs'
SubscriberHold h -> do
invalidators <- liftIO $ readIORef $ holdInvalidators h
when debugPropagate $ liftIO $ putStrLn $ "SubscriberHold" <> showNodeId h <> ": " ++ show (length invalidators)
toAssignRef <- askToAssignRef
liftIO $ modifyIORef' toAssignRef (SomeAssignment h a :)
SubscriberSwitch subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberSwitch" <> showNodeId subscribed
liftIO $ writeIORef (switchSubscribedOccurrence subscribed) $ Just a
scheduleClear $ switchSubscribedOccurrence subscribed
subs <- liftIO $ readIORef $ switchSubscribedSubscribers subscribed
liftIO . writeIORef (switchSubscribedSubscribers subscribed) =<< propagate a subs
SubscriberCoincidenceOuter subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberCoincidenceOuter" <> showNodeId subscribed
outerHeight <- liftIO $ readIORef $ coincidenceSubscribedHeight subscribed
when debugPropagate $ liftIO $ putStrLn $ " outerHeight = " <> show outerHeight
(occ, innerHeight, innerSubd) <- subscribeCoincidenceInner a outerHeight subscribed
when debugPropagate $ liftIO $ putStrLn $ " isJust occ = " <> show (isJust occ)
when debugPropagate $ liftIO $ putStrLn $ " innerHeight = " <> show innerHeight
liftIO $ writeIORef (coincidenceSubscribedInnerParent subscribed) $ Just innerSubd
scheduleClear $ coincidenceSubscribedInnerParent subscribed
case occ of
Nothing -> do
when (innerHeight > outerHeight) $ liftIO $ do -- If the event fires, it will fire at a later height
writeIORef (coincidenceSubscribedHeight subscribed) innerHeight
mapM_ invalidateSubscriberHeight =<< readIORef (coincidenceSubscribedSubscribers subscribed)
mapM_ recalculateSubscriberHeight =<< readIORef (coincidenceSubscribedSubscribers subscribed)
Just o -> do -- Since it's already firing, no need to adjust height
liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) occ
scheduleClear $ coincidenceSubscribedOccurrence subscribed
liftIO . writeIORef (coincidenceSubscribedSubscribers subscribed) =<< propagate o =<< liftIO (readIORef (coincidenceSubscribedSubscribers subscribed))
SubscriberCoincidenceInner subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberCoincidenceInner" <> showNodeId subscribed
liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) $ Just a
scheduleClear $ coincidenceSubscribedOccurrence subscribed
liftIO . writeIORef (coincidenceSubscribedSubscribers subscribed) =<< propagate a =<< liftIO (readIORef (coincidenceSubscribedSubscribers subscribed)) | 5,513 | propagate a subscribers = do
traverseAndCleanWeakList_ (liftIO . deRefWeakSubscriber) subscribers $ \s -> case s of
SubscriberPush compute subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberPush" <> showNodeId subscribed
occ <- compute a
case occ of
Nothing -> return () -- No need to write a Nothing back into the Ref
Just o -> do
liftIO $ writeIORef (pushSubscribedOccurrence subscribed) occ
scheduleClear $ pushSubscribedOccurrence subscribed
liftIO . writeIORef (pushSubscribedSubscribers subscribed) =<< propagate o =<< liftIO (readIORef (pushSubscribedSubscribers subscribed))
SubscriberMerge k subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberMerge" <> showNodeId subscribed
oldM <- liftIO $ readIORef $ mergeSubscribedAccum subscribed
liftIO $ writeIORef (mergeSubscribedAccum subscribed) $ DMap.insertWith (error "Same key fired multiple times for") k a oldM
when (DMap.null oldM) $ do -- Only schedule the firing once
height <- liftIO $ readIORef $ mergeSubscribedHeight subscribed
--TODO: assertions about height
currentHeight <- getCurrentHeight
when (height <= currentHeight) $ error $ "Height (" ++ show height ++ ") is not greater than current height (" ++ show currentHeight ++ ")"
scheduleMerge height subscribed
SubscriberFan subscribed -> do
subs <- liftIO $ readIORef $ fanSubscribedSubscribers subscribed
when debugPropagate $ liftIO $ putStrLn $ "SubscriberFan" <> showNodeId subscribed <> ": " ++ show (DMap.size subs) ++ " keys subscribed, " ++ show (DMap.size a) ++ " keys firing"
--TODO: We need a better DMap intersection; here, we are assuming that the number of firing keys is small and the number of subscribers is large
forM_ (DMap.toList a) $ \(k :=> v) -> case DMap.lookup (FanSubscriberKey k) subs of
Nothing -> do
when debugPropagate $ liftIO $ putStrLn "No subscriber for key"
return ()
Just subsubs -> do
_ <- propagate v subsubs --TODO: use the value of this
return ()
--TODO: The following is way too slow to do all the time
subs' <- liftIO $ forM (DMap.toList subs) $ ((\(FanSubscriberKey k :=> subsubs) -> do
subsubs' <- traverseAndCleanWeakList_ (liftIO . deRefWeakSubscriber) subsubs (const $ return ())
return $ if null subsubs' then Nothing else Just $ FanSubscriberKey k :=> subsubs') :: DSum (FanSubscriberKey k) -> IO (Maybe (DSum (FanSubscriberKey k))))
liftIO $ writeIORef (fanSubscribedSubscribers subscribed) $ DMap.fromDistinctAscList $ catMaybes subs'
SubscriberHold h -> do
invalidators <- liftIO $ readIORef $ holdInvalidators h
when debugPropagate $ liftIO $ putStrLn $ "SubscriberHold" <> showNodeId h <> ": " ++ show (length invalidators)
toAssignRef <- askToAssignRef
liftIO $ modifyIORef' toAssignRef (SomeAssignment h a :)
SubscriberSwitch subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberSwitch" <> showNodeId subscribed
liftIO $ writeIORef (switchSubscribedOccurrence subscribed) $ Just a
scheduleClear $ switchSubscribedOccurrence subscribed
subs <- liftIO $ readIORef $ switchSubscribedSubscribers subscribed
liftIO . writeIORef (switchSubscribedSubscribers subscribed) =<< propagate a subs
SubscriberCoincidenceOuter subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberCoincidenceOuter" <> showNodeId subscribed
outerHeight <- liftIO $ readIORef $ coincidenceSubscribedHeight subscribed
when debugPropagate $ liftIO $ putStrLn $ " outerHeight = " <> show outerHeight
(occ, innerHeight, innerSubd) <- subscribeCoincidenceInner a outerHeight subscribed
when debugPropagate $ liftIO $ putStrLn $ " isJust occ = " <> show (isJust occ)
when debugPropagate $ liftIO $ putStrLn $ " innerHeight = " <> show innerHeight
liftIO $ writeIORef (coincidenceSubscribedInnerParent subscribed) $ Just innerSubd
scheduleClear $ coincidenceSubscribedInnerParent subscribed
case occ of
Nothing -> do
when (innerHeight > outerHeight) $ liftIO $ do -- If the event fires, it will fire at a later height
writeIORef (coincidenceSubscribedHeight subscribed) innerHeight
mapM_ invalidateSubscriberHeight =<< readIORef (coincidenceSubscribedSubscribers subscribed)
mapM_ recalculateSubscriberHeight =<< readIORef (coincidenceSubscribedSubscribers subscribed)
Just o -> do -- Since it's already firing, no need to adjust height
liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) occ
scheduleClear $ coincidenceSubscribedOccurrence subscribed
liftIO . writeIORef (coincidenceSubscribedSubscribers subscribed) =<< propagate o =<< liftIO (readIORef (coincidenceSubscribedSubscribers subscribed))
SubscriberCoincidenceInner subscribed -> do
when debugPropagate $ liftIO $ putStrLn $ "SubscriberCoincidenceInner" <> showNodeId subscribed
liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) $ Just a
scheduleClear $ coincidenceSubscribedOccurrence subscribed
liftIO . writeIORef (coincidenceSubscribedSubscribers subscribed) =<< propagate a =<< liftIO (readIORef (coincidenceSubscribedSubscribers subscribed)) | 5,447 | false | true | 0 | 26 | 1,162 | 1,449 | 661 | 788 | null | null |
abstools/abs-haskell-formal | benchmarks/5_primes_range/progs/500.hs | bsd-3-clause | check_primes :: Method
check_primes [pn] this wb k =
Assign nprimes (Val (I 0)) $
Assign i (Val (I 2)) $
While (ILTE (Attr i) (I pn)) (\k' ->
Assign obj New $
Assign f (Async obj is_prime [i]) $
Await f $
Assign fv (Get f) $
Assign nprimes (Val (Add (Attr nprimes) (Attr fv))) $
Assign i (Val (Add (Attr i) (I 1))) $
k'
) $
Return nprimes wb k | 382 | check_primes :: Method
check_primes [pn] this wb k =
Assign nprimes (Val (I 0)) $
Assign i (Val (I 2)) $
While (ILTE (Attr i) (I pn)) (\k' ->
Assign obj New $
Assign f (Async obj is_prime [i]) $
Await f $
Assign fv (Get f) $
Assign nprimes (Val (Add (Attr nprimes) (Attr fv))) $
Assign i (Val (Add (Attr i) (I 1))) $
k'
) $
Return nprimes wb k | 382 | check_primes [pn] this wb k =
Assign nprimes (Val (I 0)) $
Assign i (Val (I 2)) $
While (ILTE (Attr i) (I pn)) (\k' ->
Assign obj New $
Assign f (Async obj is_prime [i]) $
Await f $
Assign fv (Get f) $
Assign nprimes (Val (Add (Attr nprimes) (Attr fv))) $
Assign i (Val (Add (Attr i) (I 1))) $
k'
) $
Return nprimes wb k | 359 | false | true | 2 | 18 | 111 | 233 | 113 | 120 | null | null |
a143753/AOJ | 0277.hs | apache-2.0 | main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = map ans i
mapM_ print o | 122 | main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = map ans i
mapM_ print o | 122 | main = do
c <- getContents
let i = map (map read) $ map words $ lines c :: [[Int]]
o = map ans i
mapM_ print o | 122 | false | false | 0 | 14 | 39 | 72 | 34 | 38 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxLED_ALIGN_LEFT :: Int
wxLED_ALIGN_LEFT = 1 | 44 | wxLED_ALIGN_LEFT :: Int
wxLED_ALIGN_LEFT = 1 | 44 | wxLED_ALIGN_LEFT = 1 | 20 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
silkapp/stylish-haskell | lib/Language/Haskell/Stylish/Step/LanguagePragmas.hs | bsd-3-clause | addLanguagePragma :: String -> H.Module H.SrcSpanInfo -> [Change String]
addLanguagePragma prag modu
| prag `elem` present = []
| otherwise = [insert line ["{-# LANGUAGE " ++ prag ++ " #-}"]]
where
pragmas' = pragmas (fmap linesFromSrcSpan modu)
present = concatMap snd pragmas'
line = if null pragmas' then 1 else firstLocation pragmas'
--------------------------------------------------------------------------------
-- | Check if a language pragma is redundant. We can't do this for all pragmas,
-- but we do a best effort. | 565 | addLanguagePragma :: String -> H.Module H.SrcSpanInfo -> [Change String]
addLanguagePragma prag modu
| prag `elem` present = []
| otherwise = [insert line ["{-# LANGUAGE " ++ prag ++ " #-}"]]
where
pragmas' = pragmas (fmap linesFromSrcSpan modu)
present = concatMap snd pragmas'
line = if null pragmas' then 1 else firstLocation pragmas'
--------------------------------------------------------------------------------
-- | Check if a language pragma is redundant. We can't do this for all pragmas,
-- but we do a best effort. | 565 | addLanguagePragma prag modu
| prag `elem` present = []
| otherwise = [insert line ["{-# LANGUAGE " ++ prag ++ " #-}"]]
where
pragmas' = pragmas (fmap linesFromSrcSpan modu)
present = concatMap snd pragmas'
line = if null pragmas' then 1 else firstLocation pragmas'
--------------------------------------------------------------------------------
-- | Check if a language pragma is redundant. We can't do this for all pragmas,
-- but we do a best effort. | 492 | false | true | 2 | 10 | 115 | 131 | 66 | 65 | null | null |
phaazon/inject-function | Control/InjFun.hs | gpl-3.0 | (|->) :: (Monad m) => InjFun c i m o -- ^ First function
-> InjFun c o m o' -- ^ Second function
-> InjFun c i m o' -- ^ Resulting sequencing function
f |-> g = InjFun $ \c i -> cfapply f c i >>= cfapply g c | 246 | (|->) :: (Monad m) => InjFun c i m o -- ^ First function
-> InjFun c o m o' -- ^ Second function
-> InjFun c i m o'
f |-> g = InjFun $ \c i -> cfapply f c i >>= cfapply g c | 211 | f |-> g = InjFun $ \c i -> cfapply f c i >>= cfapply g c | 56 | true | true | 0 | 10 | 90 | 93 | 47 | 46 | null | null |
fmapfmapfmap/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/DeletePipeline.hs | mpl-2.0 | -- | The response status code.
drsResponseStatus :: Lens' DeletePipelineResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) | 165 | drsResponseStatus :: Lens' DeletePipelineResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) | 134 | drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) | 80 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
keithodulaigh/Hets | utils/itcor/GenItCorrections.hs | gpl-2.0 | generate_tex_files :: String -> String -> IO ()
generate_tex_files filename1 filename2 = do
writeFile filename1 (tex_file $ writeTexTable combinations)
writeFile filename2 (tex_file $ writeTexTable [[c] | c <- allCharacters]) | 229 | generate_tex_files :: String -> String -> IO ()
generate_tex_files filename1 filename2 = do
writeFile filename1 (tex_file $ writeTexTable combinations)
writeFile filename2 (tex_file $ writeTexTable [[c] | c <- allCharacters]) | 229 | generate_tex_files filename1 filename2 = do
writeFile filename1 (tex_file $ writeTexTable combinations)
writeFile filename2 (tex_file $ writeTexTable [[c] | c <- allCharacters]) | 181 | false | true | 0 | 13 | 32 | 79 | 38 | 41 | null | null |
matterhorn-chat/matterhorn | src/Matterhorn/Draw/RichText.hs | bsd-3-clause | -- Cursor sentinel for tracking the user's cursor position in previews.
cursorSentinel :: Char
cursorSentinel = '‸' | 115 | cursorSentinel :: Char
cursorSentinel = '‸' | 43 | cursorSentinel = '‸' | 20 | true | true | 0 | 4 | 16 | 12 | 7 | 5 | null | null |
dimara/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pPrimaryNode :: Field
pPrimaryNode =
withDoc "Primary node for an instance" $
optionalNEStringField "pnode" | 111 | pPrimaryNode :: Field
pPrimaryNode =
withDoc "Primary node for an instance" $
optionalNEStringField "pnode" | 111 | pPrimaryNode =
withDoc "Primary node for an instance" $
optionalNEStringField "pnode" | 89 | false | true | 0 | 6 | 17 | 21 | 10 | 11 | null | null |
urbanslug/ghc | ghc/Main.hs | bsd-3-clause | needsInputsMode (StopBefore _) = True | 38 | needsInputsMode (StopBefore _) = True | 38 | needsInputsMode (StopBefore _) = True | 38 | false | false | 0 | 7 | 5 | 15 | 7 | 8 | null | null |
jwiegley/ghc-release | libraries/containers/Data/Sequence.hs | gpl-3.0 | addDigits2 m1 (Three a b c) d e (One f) m2 =
appendTree2 m1 (node3 a b c) (node3 d e f) m2 | 94 | addDigits2 m1 (Three a b c) d e (One f) m2 =
appendTree2 m1 (node3 a b c) (node3 d e f) m2 | 94 | addDigits2 m1 (Three a b c) d e (One f) m2 =
appendTree2 m1 (node3 a b c) (node3 d e f) m2 | 94 | false | false | 0 | 7 | 26 | 64 | 31 | 33 | null | null |
lambdageek/emile | src/Language/Example/MiniCore/Errors.hs | bsd-2-clause | raiseExpectedSigma :: MonadError CoreErr m => Expr -> m a
raiseExpectedSigma = throwError . ExpectedTypeExpr SigmaSp | 116 | raiseExpectedSigma :: MonadError CoreErr m => Expr -> m a
raiseExpectedSigma = throwError . ExpectedTypeExpr SigmaSp | 116 | raiseExpectedSigma = throwError . ExpectedTypeExpr SigmaSp | 58 | false | true | 0 | 7 | 15 | 34 | 16 | 18 | null | null |
markflorisson/hpack | src/HPack/Iface/IfaceExtract.hs | bsd-3-clause | extractStr :: FastString -> String
extractStr = unpackFS | 56 | extractStr :: FastString -> String
extractStr = unpackFS | 56 | extractStr = unpackFS | 21 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
noraesae/monkey-hs | lib/Utils.hs | bsd-3-clause | isLetter :: Char -> Bool
isLetter = flip elem $ '_' : ['a' .. 'z'] ++ ['A' .. 'Z'] | 82 | isLetter :: Char -> Bool
isLetter = flip elem $ '_' : ['a' .. 'z'] ++ ['A' .. 'Z'] | 82 | isLetter = flip elem $ '_' : ['a' .. 'z'] ++ ['A' .. 'Z'] | 57 | false | true | 0 | 7 | 18 | 49 | 24 | 25 | null | null |
adnelson/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reflectSpecialName (ParentN n s) =
reflCall "ParentN" [reflectName n, RConstant (Str (T.unpack s))] | 101 | reflectSpecialName (ParentN n s) =
reflCall "ParentN" [reflectName n, RConstant (Str (T.unpack s))] | 101 | reflectSpecialName (ParentN n s) =
reflCall "ParentN" [reflectName n, RConstant (Str (T.unpack s))] | 101 | false | false | 0 | 12 | 14 | 48 | 23 | 25 | null | null |
alexliew/learn_you_a_haskell | code/caesar.hs | unlicense | encode :: Int -> String -> String
encode offset msg = map (\c -> chr $ ord c + offset) msg | 90 | encode :: Int -> String -> String
encode offset msg = map (\c -> chr $ ord c + offset) msg | 90 | encode offset msg = map (\c -> chr $ ord c + offset) msg | 56 | false | true | 0 | 10 | 20 | 48 | 24 | 24 | null | null |
bitemyapp/ghc | compiler/types/InstEnv.hs | bsd-3-clause | identicalClsInstHead :: ClsInst -> ClsInst -> Bool
-- ^ True when when the instance heads are the same
-- e.g. both are Eq [(a,b)]
-- Used for overriding in GHCi
-- Obviously should be insenstive to alpha-renaming
identicalClsInstHead (ClsInst { is_cls_nm = cls_nm1, is_tcs = rough1, is_tvs = tvs1, is_tys = tys1 })
(ClsInst { is_cls_nm = cls_nm2, is_tcs = rough2, is_tvs = tvs2, is_tys = tys2 })
= cls_nm1 == cls_nm2
&& not (instanceCantMatch rough1 rough2) -- Fast check for no match, uses the "rough match" fields
&& isJust (tcMatchTys (mkVarSet tvs1) tys1 tys2)
&& isJust (tcMatchTys (mkVarSet tvs2) tys2 tys1) | 648 | identicalClsInstHead :: ClsInst -> ClsInst -> Bool
identicalClsInstHead (ClsInst { is_cls_nm = cls_nm1, is_tcs = rough1, is_tvs = tvs1, is_tys = tys1 })
(ClsInst { is_cls_nm = cls_nm2, is_tcs = rough2, is_tvs = tvs2, is_tys = tys2 })
= cls_nm1 == cls_nm2
&& not (instanceCantMatch rough1 rough2) -- Fast check for no match, uses the "rough match" fields
&& isJust (tcMatchTys (mkVarSet tvs1) tys1 tys2)
&& isJust (tcMatchTys (mkVarSet tvs2) tys2 tys1) | 482 | identicalClsInstHead (ClsInst { is_cls_nm = cls_nm1, is_tcs = rough1, is_tvs = tvs1, is_tys = tys1 })
(ClsInst { is_cls_nm = cls_nm2, is_tcs = rough2, is_tvs = tvs2, is_tys = tys2 })
= cls_nm1 == cls_nm2
&& not (instanceCantMatch rough1 rough2) -- Fast check for no match, uses the "rough match" fields
&& isJust (tcMatchTys (mkVarSet tvs1) tys1 tys2)
&& isJust (tcMatchTys (mkVarSet tvs2) tys2 tys1) | 431 | true | true | 7 | 9 | 135 | 146 | 84 | 62 | null | null |
changlinli/nikki | src/Graphics/Qt/CPPWrapper.hs | lgpl-3.0 | sizeQPixmap :: ForeignPtr QPixmap -> IO (Size QtInt)
sizeQPixmap fp =
withForeignPtr fp $ \ ptr ->
(Size <$> widthQPixmap ptr <*> heightQPixmap ptr) | 156 | sizeQPixmap :: ForeignPtr QPixmap -> IO (Size QtInt)
sizeQPixmap fp =
withForeignPtr fp $ \ ptr ->
(Size <$> widthQPixmap ptr <*> heightQPixmap ptr) | 156 | sizeQPixmap fp =
withForeignPtr fp $ \ ptr ->
(Size <$> widthQPixmap ptr <*> heightQPixmap ptr) | 103 | false | true | 0 | 10 | 31 | 59 | 28 | 31 | null | null |
snoyberg/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | recConErrorName = err_nm "recConError" recConErrorIdKey rEC_CON_ERROR_ID | 84 | recConErrorName = err_nm "recConError" recConErrorIdKey rEC_CON_ERROR_ID | 84 | recConErrorName = err_nm "recConError" recConErrorIdKey rEC_CON_ERROR_ID | 84 | false | false | 0 | 5 | 17 | 13 | 6 | 7 | null | null |
olorin/amazonka | gen/src/Gen/AST/Data/Syntax.hs | mpl-2.0 | literal :: Bool -> Timestamp -> Lit -> Type
literal i ts = \case
Int -> tycon "Int"
Long -> tycon "Integer"
Double -> tycon "Double"
Text -> tycon "Text"
Blob | i -> tycon "Base64"
| otherwise -> tycon "ByteString"
Bool -> tycon "Bool"
Time | i -> tycon (tsToText ts)
| otherwise -> tycon "UTCTime"
Json -> TyApp (TyApp (tycon "HashMap") (tycon "Text")) (tycon "Value") | 506 | literal :: Bool -> Timestamp -> Lit -> Type
literal i ts = \case
Int -> tycon "Int"
Long -> tycon "Integer"
Double -> tycon "Double"
Text -> tycon "Text"
Blob | i -> tycon "Base64"
| otherwise -> tycon "ByteString"
Bool -> tycon "Bool"
Time | i -> tycon (tsToText ts)
| otherwise -> tycon "UTCTime"
Json -> TyApp (TyApp (tycon "HashMap") (tycon "Text")) (tycon "Value") | 506 | literal i ts = \case
Int -> tycon "Int"
Long -> tycon "Integer"
Double -> tycon "Double"
Text -> tycon "Text"
Blob | i -> tycon "Base64"
| otherwise -> tycon "ByteString"
Bool -> tycon "Bool"
Time | i -> tycon (tsToText ts)
| otherwise -> tycon "UTCTime"
Json -> TyApp (TyApp (tycon "HashMap") (tycon "Text")) (tycon "Value") | 462 | false | true | 0 | 13 | 203 | 177 | 79 | 98 | null | null |
Feeniks/valkyrie | src/Valkyrie/Math.hs | bsd-3-clause | translate :: NReal -> NReal -> NReal -> Matrix44
translate x y z = identity44 { m14 = x, m24 = y, m34 = z } | 107 | translate :: NReal -> NReal -> NReal -> Matrix44
translate x y z = identity44 { m14 = x, m24 = y, m34 = z } | 107 | translate x y z = identity44 { m14 = x, m24 = y, m34 = z } | 58 | false | true | 0 | 7 | 25 | 50 | 28 | 22 | null | null |
rueshyna/gogol | gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Layers/Permissions/BatchDelete.hs | mpl-2.0 | -- | Creates a value of 'LayersPermissionsBatchDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lpbdPayload'
--
-- * 'lpbdId'
layersPermissionsBatchDelete
:: PermissionsBatchDeleteRequest -- ^ 'lpbdPayload'
-> Text -- ^ 'lpbdId'
-> LayersPermissionsBatchDelete
layersPermissionsBatchDelete pLpbdPayload_ pLpbdId_ =
LayersPermissionsBatchDelete'
{ _lpbdPayload = pLpbdPayload_
, _lpbdId = pLpbdId_
} | 519 | layersPermissionsBatchDelete
:: PermissionsBatchDeleteRequest -- ^ 'lpbdPayload'
-> Text -- ^ 'lpbdId'
-> LayersPermissionsBatchDelete
layersPermissionsBatchDelete pLpbdPayload_ pLpbdId_ =
LayersPermissionsBatchDelete'
{ _lpbdPayload = pLpbdPayload_
, _lpbdId = pLpbdId_
} | 300 | layersPermissionsBatchDelete pLpbdPayload_ pLpbdId_ =
LayersPermissionsBatchDelete'
{ _lpbdPayload = pLpbdPayload_
, _lpbdId = pLpbdId_
} | 153 | true | true | 0 | 8 | 92 | 56 | 32 | 24 | null | null |
ice1000/Kt2Dart | src/Parsers.hs | agpl-3.0 | stringP :: String -> Parser String
stringP [ ] = return [] | 63 | stringP :: String -> Parser String
stringP [ ] = return [] | 63 | stringP [ ] = return [] | 28 | false | true | 0 | 6 | 16 | 28 | 13 | 15 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/Resources/BatchJobDefinition.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html#cfn-batch-jobdefinition-timeout
bjdTimeout :: Lens' BatchJobDefinition (Maybe BatchJobDefinitionTimeout)
bjdTimeout = lens _batchJobDefinitionTimeout (\s a -> s { _batchJobDefinitionTimeout = a }) | 301 | bjdTimeout :: Lens' BatchJobDefinition (Maybe BatchJobDefinitionTimeout)
bjdTimeout = lens _batchJobDefinitionTimeout (\s a -> s { _batchJobDefinitionTimeout = a }) | 164 | bjdTimeout = lens _batchJobDefinitionTimeout (\s a -> s { _batchJobDefinitionTimeout = a }) | 91 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
toonn/haskell-casestt | koopa.hs | bsd-2-clause | natter (Sy n) = S (natter n) | 28 | natter (Sy n) = S (natter n) | 28 | natter (Sy n) = S (natter n) | 28 | false | false | 0 | 7 | 6 | 24 | 11 | 13 | null | null |
romanb/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/UploadMultipartPart.hs | mpl-2.0 | -- | The name of the vault.
umpVaultName :: Lens' UploadMultipartPart Text
umpVaultName = lens _umpVaultName (\s a -> s { _umpVaultName = a }) | 142 | umpVaultName :: Lens' UploadMultipartPart Text
umpVaultName = lens _umpVaultName (\s a -> s { _umpVaultName = a }) | 114 | umpVaultName = lens _umpVaultName (\s a -> s { _umpVaultName = a }) | 67 | true | true | 1 | 9 | 24 | 45 | 22 | 23 | null | null |
gallais/dailyprogrammer | difficult/002/Main.hs | mit | updateTime :: StopWatch -> IO StopWatch
updateTime sw =
if paused sw then return sw
else do
curr <- getCurrentTime
let diff = truncate $ 1000 * (diffUTCTime curr $ latest sw)
return $ sw { passed = passed sw + diff
, latest = curr } | 264 | updateTime :: StopWatch -> IO StopWatch
updateTime sw =
if paused sw then return sw
else do
curr <- getCurrentTime
let diff = truncate $ 1000 * (diffUTCTime curr $ latest sw)
return $ sw { passed = passed sw + diff
, latest = curr } | 264 | updateTime sw =
if paused sw then return sw
else do
curr <- getCurrentTime
let diff = truncate $ 1000 * (diffUTCTime curr $ latest sw)
return $ sw { passed = passed sw + diff
, latest = curr } | 224 | false | true | 0 | 14 | 78 | 100 | 49 | 51 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_MMIXAL_CHAR :: Int
wxSTC_MMIXAL_CHAR = 11 | 47 | wxSTC_MMIXAL_CHAR :: Int
wxSTC_MMIXAL_CHAR = 11 | 47 | wxSTC_MMIXAL_CHAR = 11 | 22 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
shlevy/ghc | compiler/cmm/PprC.hs | bsd-3-clause | pprAlignment :: Width -> SDoc
pprAlignment words =
text "__attribute__((aligned(" <> int (widthInBytes words) <> text ")))" | 128 | pprAlignment :: Width -> SDoc
pprAlignment words =
text "__attribute__((aligned(" <> int (widthInBytes words) <> text ")))" | 128 | pprAlignment words =
text "__attribute__((aligned(" <> int (widthInBytes words) <> text ")))" | 98 | false | true | 0 | 9 | 21 | 46 | 20 | 26 | null | null |
chemist/highlighter | src/Text/Highlighter/Lexers/Gettext.hs | bsd-3-clause | lexer :: Lexer
lexer = Lexer
{ lName = "Gettext Catalog"
, lAliases = ["pot", "po"]
, lExtensions = [".pot", ".po"]
, lMimetypes = ["application/x-gettext", "text/x-gettext", "text/gettext"]
, lStart = root'
, lFlags = [multiline]
} | 260 | lexer :: Lexer
lexer = Lexer
{ lName = "Gettext Catalog"
, lAliases = ["pot", "po"]
, lExtensions = [".pot", ".po"]
, lMimetypes = ["application/x-gettext", "text/x-gettext", "text/gettext"]
, lStart = root'
, lFlags = [multiline]
} | 260 | lexer = Lexer
{ lName = "Gettext Catalog"
, lAliases = ["pot", "po"]
, lExtensions = [".pot", ".po"]
, lMimetypes = ["application/x-gettext", "text/x-gettext", "text/gettext"]
, lStart = root'
, lFlags = [multiline]
} | 245 | false | true | 0 | 8 | 63 | 77 | 48 | 29 | null | null |
hlian/afterdark | src/AD/Server.hs | bsd-3-clause | f = 1 + 1 | 9 | f = 1 + 1 | 9 | f = 1 + 1 | 9 | false | false | 1 | 5 | 4 | 13 | 5 | 8 | null | null |
loadimpact/http2-test | hs-src/Rede/MainLoop/Tls.hs | bsd-3-clause | chooseFirstMatching (p:_) suggested_protocolls | p `elem` suggested_protocolls = return p | 89 | chooseFirstMatching (p:_) suggested_protocolls | p `elem` suggested_protocolls = return p | 89 | chooseFirstMatching (p:_) suggested_protocolls | p `elem` suggested_protocolls = return p | 89 | false | false | 0 | 8 | 9 | 33 | 16 | 17 | null | null |
alphaKAI/mal | haskell/step3_env.hs | mpl-2.0 | -- read
mal_read :: String -> IOThrows MalVal
mal_read str = read_str str | 73 | mal_read :: String -> IOThrows MalVal
mal_read str = read_str str | 65 | mal_read str = read_str str | 27 | true | true | 0 | 6 | 12 | 25 | 12 | 13 | null | null |
feliposz/learning-stuff | haskell/learn_chapter7.hs | mit | -- Data.Map
phoneBook = [ ("fulano", "234-5678"),
("sicrano", "456-7890"),
("beltrano", "567-8901"),
("mengano", "678-9012"),
("zutano", "789-0123") ] | 207 | phoneBook = [ ("fulano", "234-5678"),
("sicrano", "456-7890"),
("beltrano", "567-8901"),
("mengano", "678-9012"),
("zutano", "789-0123") ] | 194 | phoneBook = [ ("fulano", "234-5678"),
("sicrano", "456-7890"),
("beltrano", "567-8901"),
("mengano", "678-9012"),
("zutano", "789-0123") ] | 194 | true | false | 0 | 6 | 72 | 52 | 34 | 18 | null | null |
mcmaniac/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | pprPanic :: String -> SDoc -> a
pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d | 98 | pprPanic :: String -> SDoc -> a
pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d | 98 | pprPanic s d = Outputable.pprPanic ("LlvmCodeGen.CodeGen." ++ s) d | 66 | false | true | 0 | 7 | 15 | 38 | 19 | 19 | null | null |
dmagyar/scurry | src/Scurry/Util.hs | bsd-3-clause | inet_addr :: String -> Maybe ScurryAddress
inet_addr = unsafePerformIO .
catch_to_maybe (\v -> liftM ScurryAddress (INET.inet_addr v)) | 148 | inet_addr :: String -> Maybe ScurryAddress
inet_addr = unsafePerformIO .
catch_to_maybe (\v -> liftM ScurryAddress (INET.inet_addr v)) | 148 | inet_addr = unsafePerformIO .
catch_to_maybe (\v -> liftM ScurryAddress (INET.inet_addr v)) | 105 | false | true | 0 | 12 | 30 | 46 | 23 | 23 | null | null |
ihc/futhark | src/Futhark/TypeCheck.hs | isc | checkFunBody :: Checkable lore =>
[RetType lore]
-> Body (Aliases lore)
-> TypeM lore ()
checkFunBody rt (Body (_,lore) bnds res) = do
checkStms bnds $ do
context "When checking body result" $ checkResult res
context "When matching declared return type to result of body" $
matchReturnType rt res
checkBodyLore lore | 375 | checkFunBody :: Checkable lore =>
[RetType lore]
-> Body (Aliases lore)
-> TypeM lore ()
checkFunBody rt (Body (_,lore) bnds res) = do
checkStms bnds $ do
context "When checking body result" $ checkResult res
context "When matching declared return type to result of body" $
matchReturnType rt res
checkBodyLore lore | 375 | checkFunBody rt (Body (_,lore) bnds res) = do
checkStms bnds $ do
context "When checking body result" $ checkResult res
context "When matching declared return type to result of body" $
matchReturnType rt res
checkBodyLore lore | 244 | false | true | 0 | 11 | 110 | 113 | 51 | 62 | null | null |
rootzlevel/sansa | src/Sansa/Commands/Unpause.hs | bsd-2-clause | unpauseOpts :: Parser (CmdAction ())
unpauseOpts = unpauseAction <$>
( flag' Nothing ( long "all"
<> short 'a'
<> help "Unpause every active/waiting download")
<|> (Just <$> some (argument (GID . T.pack <$> str)
(metavar "GIDs...")))) | 343 | unpauseOpts :: Parser (CmdAction ())
unpauseOpts = unpauseAction <$>
( flag' Nothing ( long "all"
<> short 'a'
<> help "Unpause every active/waiting download")
<|> (Just <$> some (argument (GID . T.pack <$> str)
(metavar "GIDs...")))) | 343 | unpauseOpts = unpauseAction <$>
( flag' Nothing ( long "all"
<> short 'a'
<> help "Unpause every active/waiting download")
<|> (Just <$> some (argument (GID . T.pack <$> str)
(metavar "GIDs...")))) | 306 | false | true | 0 | 16 | 144 | 95 | 47 | 48 | null | null |
patperry/hs-linear-algebra | tests-old/Matrix.hs | bsd-3-clause | prop_matrixFromCol_shape (x :: V) =
shape (matrixFromCol x :: M) == (dim x,1) | 81 | prop_matrixFromCol_shape (x :: V) =
shape (matrixFromCol x :: M) == (dim x,1) | 81 | prop_matrixFromCol_shape (x :: V) =
shape (matrixFromCol x :: M) == (dim x,1) | 81 | false | false | 0 | 7 | 16 | 41 | 21 | 20 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Input/InputConstants.hs | mit | keyR :: Int
keyR = fromIntegral $ [C.pure| int {KEY_R} |] | 57 | keyR :: Int
keyR = fromIntegral $ [C.pure| int {KEY_R} |] | 57 | keyR = fromIntegral $ [C.pure| int {KEY_R} |] | 45 | false | true | 0 | 6 | 10 | 21 | 13 | 8 | null | null |
sdiehl/ghc | compiler/GHC/Cmm/Graph.hs | bsd-3-clause | ---------- Assignment and store
mkAssign :: CmmReg -> CmmExpr -> CmmAGraph
mkAssign l (CmmReg r) | l == r = mkNop | 119 | mkAssign :: CmmReg -> CmmExpr -> CmmAGraph
mkAssign l (CmmReg r) | l == r = mkNop | 87 | mkAssign l (CmmReg r) | l == r = mkNop | 39 | true | true | 0 | 8 | 26 | 41 | 20 | 21 | null | null |
rueshyna/gogol | gogol-autoscaler/gen/Network/Google/Resource/Autoscaler/Autoscalers/Patch.hs | mpl-2.0 | -- | Creates a value of 'AutoscalersPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'apProject'
--
-- * 'apZone'
--
-- * 'apPayload'
--
-- * 'apAutoscaler'
autoscalersPatch
:: Text -- ^ 'apProject'
-> Text -- ^ 'apZone'
-> Autoscaler -- ^ 'apPayload'
-> Text -- ^ 'apAutoscaler'
-> AutoscalersPatch
autoscalersPatch pApProject_ pApZone_ pApPayload_ pApAutoscaler_ =
AutoscalersPatch'
{ _apProject = pApProject_
, _apZone = pApZone_
, _apPayload = pApPayload_
, _apAutoscaler = pApAutoscaler_
} | 629 | autoscalersPatch
:: Text -- ^ 'apProject'
-> Text -- ^ 'apZone'
-> Autoscaler -- ^ 'apPayload'
-> Text -- ^ 'apAutoscaler'
-> AutoscalersPatch
autoscalersPatch pApProject_ pApZone_ pApPayload_ pApAutoscaler_ =
AutoscalersPatch'
{ _apProject = pApProject_
, _apZone = pApZone_
, _apPayload = pApPayload_
, _apAutoscaler = pApAutoscaler_
} | 381 | autoscalersPatch pApProject_ pApZone_ pApPayload_ pApAutoscaler_ =
AutoscalersPatch'
{ _apProject = pApProject_
, _apZone = pApZone_
, _apPayload = pApPayload_
, _apAutoscaler = pApAutoscaler_
} | 218 | true | true | 0 | 10 | 136 | 86 | 52 | 34 | null | null |
pairyo/elm-compiler | src/Validate.hs | bsd-3-clause | extractValues :: D.ValidDecl -> ([A.Located String], [A.Located String])
extractValues (A.A (region, _) decl) =
case decl of
D.Definition (Valid.Definition pattern _ _) ->
( Pattern.boundVars pattern
, []
)
D.Datatype name _ ctors ->
( map (A.A region . fst) ctors
, [A.A region name]
)
D.TypeAlias name _ (A.A _ (Type.RRecord _ _)) ->
( [A.A region name]
, [A.A region name]
)
D.TypeAlias name _ _ ->
( []
, [A.A region name]
)
D.Port port ->
( [A.A region (D.validPortName port)]
, []
)
D.Fixity _ _ _ ->
( []
, []
)
-- UNBOUND TYPE VARIABLES | 721 | extractValues :: D.ValidDecl -> ([A.Located String], [A.Located String])
extractValues (A.A (region, _) decl) =
case decl of
D.Definition (Valid.Definition pattern _ _) ->
( Pattern.boundVars pattern
, []
)
D.Datatype name _ ctors ->
( map (A.A region . fst) ctors
, [A.A region name]
)
D.TypeAlias name _ (A.A _ (Type.RRecord _ _)) ->
( [A.A region name]
, [A.A region name]
)
D.TypeAlias name _ _ ->
( []
, [A.A region name]
)
D.Port port ->
( [A.A region (D.validPortName port)]
, []
)
D.Fixity _ _ _ ->
( []
, []
)
-- UNBOUND TYPE VARIABLES | 721 | extractValues (A.A (region, _) decl) =
case decl of
D.Definition (Valid.Definition pattern _ _) ->
( Pattern.boundVars pattern
, []
)
D.Datatype name _ ctors ->
( map (A.A region . fst) ctors
, [A.A region name]
)
D.TypeAlias name _ (A.A _ (Type.RRecord _ _)) ->
( [A.A region name]
, [A.A region name]
)
D.TypeAlias name _ _ ->
( []
, [A.A region name]
)
D.Port port ->
( [A.A region (D.validPortName port)]
, []
)
D.Fixity _ _ _ ->
( []
, []
)
-- UNBOUND TYPE VARIABLES | 648 | false | true | 0 | 13 | 277 | 303 | 156 | 147 | null | null |
Alexander-Ignatyev/astro | src/Data/Astro/Sun.hs | bsd-3-clause | -- | Reduce the value to the range [0, 360)
reduceTo360 :: Double -> Double
reduceTo360 = U.reduceToZeroRange 360 | 113 | reduceTo360 :: Double -> Double
reduceTo360 = U.reduceToZeroRange 360 | 69 | reduceTo360 = U.reduceToZeroRange 360 | 37 | true | true | 0 | 6 | 18 | 21 | 11 | 10 | null | null |
tanakh/SR2 | Codec/SR2/Enumerator.hs | bsd-3-clause | decode e cxt = do
let hi=1
lo=1
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
cxt <- return $ cxt + 15*(hi-15)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
return $ ((hi-16)`shiftL`4).|.(lo-16) | 467 | decode e cxt = do
let hi=1
lo=1
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
cxt <- return $ cxt + 15*(hi-15)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
return $ ((hi-16)`shiftL`4).|.(lo-16) | 467 | decode e cxt = do
let hi=1
lo=1
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
hi <- (hi+) . (hi+) . b2i <$> e (cxt+hi)
cxt <- return $ cxt + 15*(hi-15)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
lo <- (lo+) . (lo+) . b2i <$> e (cxt+lo)
return $ ((hi-16)`shiftL`4).|.(lo-16) | 467 | false | false | 0 | 12 | 134 | 381 | 204 | 177 | null | null |
sdiehl/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | competesWith (ActiveBefore {}) (ActiveBefore {}) = True | 56 | competesWith (ActiveBefore {}) (ActiveBefore {}) = True | 56 | competesWith (ActiveBefore {}) (ActiveBefore {}) = True | 56 | false | false | 0 | 7 | 7 | 29 | 14 | 15 | null | null |
alexbaluta/courseography | dependencies/HaXml-1.25.3/src/Text/XML/HaXml/Verbatim.hs | gpl-3.0 | verbAttr :: Attribute -> String
verbAttr (n, AttValue v) = " " ++ qname n ++ "=\"" ++ verbatim v ++ "\"" | 104 | verbAttr :: Attribute -> String
verbAttr (n, AttValue v) = " " ++ qname n ++ "=\"" ++ verbatim v ++ "\"" | 104 | verbAttr (n, AttValue v) = " " ++ qname n ++ "=\"" ++ verbatim v ++ "\"" | 72 | false | true | 0 | 9 | 21 | 53 | 25 | 28 | null | null |
23Skidoo/aeson | Data/Aeson/TH.hs | bsd-3-clause | -- | Helper function used by both 'deriveFromJSON' and 'mkParseJSON'. Generates
-- code to parse the JSON encoding of a number of constructors. All constructors
-- must be from the same type.
consFromJSON :: Name
-- ^ Name of the type to which the constructors belong.
-> Options
-- ^ Encoding options
-> [Con]
-- ^ Constructors for which to generate JSON parsing code.
-> Q Exp
consFromJSON _ _ [] = error $ "Data.Aeson.TH.consFromJSON: "
++ "Not a single constructor given!" | 585 | consFromJSON :: Name
-- ^ Name of the type to which the constructors belong.
-> Options
-- ^ Encoding options
-> [Con]
-- ^ Constructors for which to generate JSON parsing code.
-> Q Exp
consFromJSON _ _ [] = error $ "Data.Aeson.TH.consFromJSON: "
++ "Not a single constructor given!" | 392 | consFromJSON _ _ [] = error $ "Data.Aeson.TH.consFromJSON: "
++ "Not a single constructor given!" | 127 | true | true | 4 | 10 | 190 | 59 | 30 | 29 | null | null |
tidalcycles/Tidal | src/Sound/Tidal/UI.hs | gpl-3.0 | -- | Boolean rand - a continuous stream of true/false values, with a 50/50 chance.
brand :: Pattern Bool
brand = _brandBy 0.5 | 126 | brand :: Pattern Bool
brand = _brandBy 0.5 | 42 | brand = _brandBy 0.5 | 20 | true | true | 1 | 5 | 23 | 21 | 9 | 12 | null | null |
jff/TeLLer | src/Term.hs | gpl-3.0 | isPersistentAtom _ = False | 26 | isPersistentAtom _ = False | 26 | isPersistentAtom _ = False | 26 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | nonchalantly = id | 17 | nonchalantly = id | 17 | nonchalantly = id | 17 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
laugh-at-me/kraken-api | src/Kraken/Request/AddOrder.hs | gpl-3.0 | splitR p s =
let
go :: Char -> String -> [String]
go m s' = case break p s' of
(b', []) -> [ m:b' ]
(b', x:xs) -> ( m:b' ) : go x xs
in case break p s of
(b, []) -> [ b ]
([], h:t) -> go h t
(b, h:t) -> b : go h t | 258 | splitR p s =
let
go :: Char -> String -> [String]
go m s' = case break p s' of
(b', []) -> [ m:b' ]
(b', x:xs) -> ( m:b' ) : go x xs
in case break p s of
(b, []) -> [ b ]
([], h:t) -> go h t
(b, h:t) -> b : go h t | 258 | splitR p s =
let
go :: Char -> String -> [String]
go m s' = case break p s' of
(b', []) -> [ m:b' ]
(b', x:xs) -> ( m:b' ) : go x xs
in case break p s of
(b, []) -> [ b ]
([], h:t) -> go h t
(b, h:t) -> b : go h t | 258 | false | false | 0 | 14 | 107 | 179 | 93 | 86 | null | null |
crooney/cinder | src/Cinder/HTML.hs | bsd-3-clause | scopedB :: Primitive
scopedB = Attribute "scoped" "" | 52 | scopedB :: Primitive
scopedB = Attribute "scoped" "" | 52 | scopedB = Attribute "scoped" "" | 31 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
itsbruce/hackerrank | alg/regex/validIP.hs | unlicense | main = do
n <- readLn
c <- getContents
putStr $ unlines $ map isip $ take n $ lines c | 97 | main = do
n <- readLn
c <- getContents
putStr $ unlines $ map isip $ take n $ lines c | 97 | main = do
n <- readLn
c <- getContents
putStr $ unlines $ map isip $ take n $ lines c | 97 | false | false | 0 | 10 | 32 | 48 | 21 | 27 | null | null |
monsanto/hie | Hie/Language/Haskell/Exts/ParseMonad.hs | gpl-3.0 | pushExtContextL :: ExtContext -> Lex a ()
pushExtContextL ec = Lex $ \cont -> P $ \r x y loc (s, e, p, c) ->
runP (cont ()) r x y loc (s, ec:e, p, c) | 157 | pushExtContextL :: ExtContext -> Lex a ()
pushExtContextL ec = Lex $ \cont -> P $ \r x y loc (s, e, p, c) ->
runP (cont ()) r x y loc (s, ec:e, p, c) | 157 | pushExtContextL ec = Lex $ \cont -> P $ \r x y loc (s, e, p, c) ->
runP (cont ()) r x y loc (s, ec:e, p, c) | 115 | false | true | 0 | 12 | 43 | 100 | 54 | 46 | null | null |
facebookincubator/duckling | Duckling/AmountOfMoney/HR/Rules.hs | bsd-3-clause | ruleSar :: Rule
ruleSar = Rule
{ name = "SAR"
, pattern =
[ regex "saudijskirijal|saudi rijal?"
]
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly SAR
} | 176 | ruleSar :: Rule
ruleSar = Rule
{ name = "SAR"
, pattern =
[ regex "saudijskirijal|saudi rijal?"
]
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly SAR
} | 176 | ruleSar = Rule
{ name = "SAR"
, pattern =
[ regex "saudijskirijal|saudi rijal?"
]
, prod = \_ -> Just . Token AmountOfMoney $ currencyOnly SAR
} | 160 | false | true | 0 | 11 | 46 | 60 | 32 | 28 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/lcm_1.hs | mit | primRemInt (Neg x) (Pos (Succ y)) = Neg (primModNatS x (Succ y)) | 64 | primRemInt (Neg x) (Pos (Succ y)) = Neg (primModNatS x (Succ y)) | 64 | primRemInt (Neg x) (Pos (Succ y)) = Neg (primModNatS x (Succ y)) | 64 | false | false | 0 | 9 | 11 | 46 | 22 | 24 | null | null |
bos/text | tests/Tests/Properties/Basics.hs | bsd-2-clause | sf_length p = (length . L.filter p) `eqP` (S.length . S.filter p) | 71 | sf_length p = (length . L.filter p) `eqP` (S.length . S.filter p) | 71 | sf_length p = (length . L.filter p) `eqP` (S.length . S.filter p) | 71 | false | false | 0 | 9 | 17 | 41 | 21 | 20 | null | null |
brendanhay/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Environments/List.hs | mpl-2.0 | -- | OAuth access token.
acelAccessToken :: Lens' AccountsContainersEnvironmentsList (Maybe Text)
acelAccessToken
= lens _acelAccessToken
(\ s a -> s{_acelAccessToken = a}) | 180 | acelAccessToken :: Lens' AccountsContainersEnvironmentsList (Maybe Text)
acelAccessToken
= lens _acelAccessToken
(\ s a -> s{_acelAccessToken = a}) | 155 | acelAccessToken
= lens _acelAccessToken
(\ s a -> s{_acelAccessToken = a}) | 82 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
tjakway/ghcjvm | compiler/nativeGen/AsmCodeGen.hs | bsd-3-clause | cmmBlockConFold :: CmmBlock -> CmmOptM CmmBlock
cmmBlockConFold block = do
let (entry, middle, last) = blockSplit block
stmts = blockToList middle
stmts' <- mapM cmmStmtConFold stmts
last' <- cmmStmtConFold last
return $ blockJoin entry (blockFromList stmts') last'
-- This does three optimizations, but they're very quick to check, so we don't
-- bother turning them off even when the Hoopl code is active. Since
-- this is on the old Cmm representation, we can't reuse the code either:
-- * reg = reg --> nop
-- * if 0 then jump --> nop
-- * if 1 then jump --> jump
-- We might be tempted to skip this step entirely of not Opt_PIC, but
-- there is some PowerPC code for the non-PIC case, which would also
-- have to be separated. | 755 | cmmBlockConFold :: CmmBlock -> CmmOptM CmmBlock
cmmBlockConFold block = do
let (entry, middle, last) = blockSplit block
stmts = blockToList middle
stmts' <- mapM cmmStmtConFold stmts
last' <- cmmStmtConFold last
return $ blockJoin entry (blockFromList stmts') last'
-- This does three optimizations, but they're very quick to check, so we don't
-- bother turning them off even when the Hoopl code is active. Since
-- this is on the old Cmm representation, we can't reuse the code either:
-- * reg = reg --> nop
-- * if 0 then jump --> nop
-- * if 1 then jump --> jump
-- We might be tempted to skip this step entirely of not Opt_PIC, but
-- there is some PowerPC code for the non-PIC case, which would also
-- have to be separated. | 755 | cmmBlockConFold block = do
let (entry, middle, last) = blockSplit block
stmts = blockToList middle
stmts' <- mapM cmmStmtConFold stmts
last' <- cmmStmtConFold last
return $ blockJoin entry (blockFromList stmts') last'
-- This does three optimizations, but they're very quick to check, so we don't
-- bother turning them off even when the Hoopl code is active. Since
-- this is on the old Cmm representation, we can't reuse the code either:
-- * reg = reg --> nop
-- * if 0 then jump --> nop
-- * if 1 then jump --> jump
-- We might be tempted to skip this step entirely of not Opt_PIC, but
-- there is some PowerPC code for the non-PIC case, which would also
-- have to be separated. | 707 | false | true | 0 | 10 | 156 | 102 | 52 | 50 | null | null |
melted/llvm-pretty | src/Text/LLVM/AST.hs | bsd-3-clause | extendMetadata :: (String,ValMd' lab) -> Stmt' lab -> Stmt' lab
extendMetadata md stmt = case stmt of
Result r i mds -> Result r i (md:mds)
Effect i mds -> Effect i (md:mds) | 179 | extendMetadata :: (String,ValMd' lab) -> Stmt' lab -> Stmt' lab
extendMetadata md stmt = case stmt of
Result r i mds -> Result r i (md:mds)
Effect i mds -> Effect i (md:mds) | 179 | extendMetadata md stmt = case stmt of
Result r i mds -> Result r i (md:mds)
Effect i mds -> Effect i (md:mds) | 115 | false | true | 2 | 10 | 38 | 90 | 44 | 46 | null | null |
Chobbes/Juicy.Pixels | src/Codec/Picture/BitWriter.hs | bsd-3-clause | initBoolStateJpg :: B.ByteString -> BoolState
initBoolStateJpg str =
case B.uncons str of
Nothing -> BoolState 0 0 B.empty
Just (0xFF, rest) -> case B.uncons rest of
Nothing -> BoolState maxBound 0 B.empty
Just (0x00, afterMarker) -> BoolState 7 0xFF afterMarker
Just (_ , afterMarker) -> initBoolStateJpg afterMarker
Just (v, rest) -> BoolState 7 v rest
-- | Bitify a list of things to decode. | 469 | initBoolStateJpg :: B.ByteString -> BoolState
initBoolStateJpg str =
case B.uncons str of
Nothing -> BoolState 0 0 B.empty
Just (0xFF, rest) -> case B.uncons rest of
Nothing -> BoolState maxBound 0 B.empty
Just (0x00, afterMarker) -> BoolState 7 0xFF afterMarker
Just (_ , afterMarker) -> initBoolStateJpg afterMarker
Just (v, rest) -> BoolState 7 v rest
-- | Bitify a list of things to decode. | 469 | initBoolStateJpg str =
case B.uncons str of
Nothing -> BoolState 0 0 B.empty
Just (0xFF, rest) -> case B.uncons rest of
Nothing -> BoolState maxBound 0 B.empty
Just (0x00, afterMarker) -> BoolState 7 0xFF afterMarker
Just (_ , afterMarker) -> initBoolStateJpg afterMarker
Just (v, rest) -> BoolState 7 v rest
-- | Bitify a list of things to decode. | 423 | false | true | 0 | 12 | 138 | 146 | 72 | 74 | null | null |
stepcut/plugins | src/System/Plugins/Utils.hs | lgpl-2.1 | -- For symmetry with (
encode_ch '[' = "ZM" | 44 | encode_ch '[' = "ZM" | 21 | encode_ch '[' = "ZM" | 21 | true | false | 0 | 4 | 9 | 11 | 5 | 6 | null | null |
nushio3/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtO RecordUpdOrigin = text "a record update" | 53 | pprCtO RecordUpdOrigin = text "a record update" | 53 | pprCtO RecordUpdOrigin = text "a record update" | 53 | false | false | 1 | 5 | 12 | 15 | 5 | 10 | null | null |
bredelings/BAli-Phy | haskell/Probability/Distribution/Tree.hs | gpl-2.0 | force_tree tree@(Tree nodes branches n_nodes) = force_nodes `seq` force_branches where
n_branches = numBranches tree
force_nodes = force_struct $ listArray' [ force_list $ edgesOutOfNode tree node | node <- xrange 0 n_nodes ]
force_branches = force_struct $ listArray' [ force_struct $ nodesForEdge tree b | b <- xrange 0 (n_branches * 2)]
-- leaves nodes branches
-- 1 1 0
-- 2 2 1
-- 3 4 3
-- 4 6 5 | 467 | force_tree tree@(Tree nodes branches n_nodes) = force_nodes `seq` force_branches where
n_branches = numBranches tree
force_nodes = force_struct $ listArray' [ force_list $ edgesOutOfNode tree node | node <- xrange 0 n_nodes ]
force_branches = force_struct $ listArray' [ force_struct $ nodesForEdge tree b | b <- xrange 0 (n_branches * 2)]
-- leaves nodes branches
-- 1 1 0
-- 2 2 1
-- 3 4 3
-- 4 6 5 | 467 | force_tree tree@(Tree nodes branches n_nodes) = force_nodes `seq` force_branches where
n_branches = numBranches tree
force_nodes = force_struct $ listArray' [ force_list $ edgesOutOfNode tree node | node <- xrange 0 n_nodes ]
force_branches = force_struct $ listArray' [ force_struct $ nodesForEdge tree b | b <- xrange 0 (n_branches * 2)]
-- leaves nodes branches
-- 1 1 0
-- 2 2 1
-- 3 4 3
-- 4 6 5 | 467 | false | false | 0 | 14 | 137 | 124 | 65 | 59 | null | null |
adarqui/Abstract-Interfaces | src/Abstract/Interfaces/Stack/Push.hs | bsd-3-clause | pushBatch :: (Monad m) => forall t. StackPush m t -> [t] -> m ()
pushBatch (StackPush s') ts = S.pushBatch s' ts | 112 | pushBatch :: (Monad m) => forall t. StackPush m t -> [t] -> m ()
pushBatch (StackPush s') ts = S.pushBatch s' ts | 112 | pushBatch (StackPush s') ts = S.pushBatch s' ts | 47 | false | true | 0 | 10 | 22 | 64 | 32 | 32 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F28.hs | bsd-3-clause | ptr_glUniform4fv :: FunPtr (GLint -> GLsizei -> Ptr GLfloat -> IO ())
ptr_glUniform4fv = unsafePerformIO $ getCommand "glUniform4fv" | 132 | ptr_glUniform4fv :: FunPtr (GLint -> GLsizei -> Ptr GLfloat -> IO ())
ptr_glUniform4fv = unsafePerformIO $ getCommand "glUniform4fv" | 132 | ptr_glUniform4fv = unsafePerformIO $ getCommand "glUniform4fv" | 62 | false | true | 0 | 11 | 17 | 44 | 21 | 23 | null | null |
vkomenda/CoALP | interpreter/CoALPi.hs | lgpl-3.0 | -- | The initial state.
iState0 :: IState
iState0 = IState Nothing [] 0 Nothing Nothing "" | 90 | iState0 :: IState
iState0 = IState Nothing [] 0 Nothing Nothing "" | 66 | iState0 = IState Nothing [] 0 Nothing Nothing "" | 48 | true | true | 0 | 6 | 16 | 27 | 14 | 13 | null | null |
ngzax/urbit | pkg/hs/urbit-king/test/AmesTests.hs | mit | tests :: TestTree
tests =
testGroup "Ames"
[ localOption (QuickCheckTests 10) $
testProperty "Zod can send a message to itself" $
zodSelfMsg
-- TODO Why doesn't this work in CI?
-- , localOption (QuickCheckTests 10) $
-- testProperty "Two galaxies can talk" $
-- twoTalk
] | 339 | tests :: TestTree
tests =
testGroup "Ames"
[ localOption (QuickCheckTests 10) $
testProperty "Zod can send a message to itself" $
zodSelfMsg
-- TODO Why doesn't this work in CI?
-- , localOption (QuickCheckTests 10) $
-- testProperty "Two galaxies can talk" $
-- twoTalk
] | 339 | tests =
testGroup "Ames"
[ localOption (QuickCheckTests 10) $
testProperty "Zod can send a message to itself" $
zodSelfMsg
-- TODO Why doesn't this work in CI?
-- , localOption (QuickCheckTests 10) $
-- testProperty "Two galaxies can talk" $
-- twoTalk
] | 321 | false | true | 0 | 11 | 112 | 43 | 23 | 20 | null | null |
thomasjm/ot.hs | test/Control/OperationalTransformation/CompositionTests.hs | mit | o1 = [l|[{"p":[2],"li":"aa"},{"p":[2,0],"si":"bbb"}]|] | 54 | o1 = [l|[{"p":[2],"li":"aa"},{"p":[2,0],"si":"bbb"}]|] | 54 | o1 = [l|[{"p":[2],"li":"aa"},{"p":[2,0],"si":"bbb"}]|] | 54 | false | false | 1 | 5 | 2 | 14 | 7 | 7 | null | null |
chreekat/vim-haskell-syntax | test/runner/Main.hs | mit | writeX :: FilePath -> IOSArrow XmlTree XmlTree
writeX = writeDocument [withOutputHTML] | 86 | writeX :: FilePath -> IOSArrow XmlTree XmlTree
writeX = writeDocument [withOutputHTML] | 86 | writeX = writeDocument [withOutputHTML] | 39 | false | true | 0 | 7 | 10 | 31 | 14 | 17 | null | null |
KommuSoft/vty-ui | src/Graphics/Vty/Widgets/Core.hs | bsd-3-clause | withFocusAttribute :: (HasFocusAttr w) => Attr -> w -> IO w
withFocusAttribute att w = do
setFocusAttribute w att
return w
-- |Render errors. | 146 | withFocusAttribute :: (HasFocusAttr w) => Attr -> w -> IO w
withFocusAttribute att w = do
setFocusAttribute w att
return w
-- |Render errors. | 146 | withFocusAttribute att w = do
setFocusAttribute w att
return w
-- |Render errors. | 86 | false | true | 0 | 8 | 28 | 51 | 24 | 27 | null | null |
simonmichael/shelltestrunner | src/shelltest.hs | gpl-3.0 | matches s (NegativeRegex r) = not $ s `containsRegex` r | 57 | matches s (NegativeRegex r) = not $ s `containsRegex` r | 57 | matches s (NegativeRegex r) = not $ s `containsRegex` r | 57 | false | false | 0 | 6 | 11 | 29 | 14 | 15 | null | null |
rueshyna/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/ReadGroupSets/Get.hs | mpl-2.0 | -- | Pretty-print response.
rgsgPp :: Lens' ReadGroupSetsGet Bool
rgsgPp = lens _rgsgPp (\ s a -> s{_rgsgPp = a}) | 113 | rgsgPp :: Lens' ReadGroupSetsGet Bool
rgsgPp = lens _rgsgPp (\ s a -> s{_rgsgPp = a}) | 85 | rgsgPp = lens _rgsgPp (\ s a -> s{_rgsgPp = a}) | 47 | true | true | 0 | 9 | 19 | 40 | 22 | 18 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Core.hs | gpl-3.0 | sine2 :: Fractional a => Pattern a
sine2 = sig $ \t -> sin_rat ((pi :: Double) * 2 * fromRational t)
where sin_rat = fromRational . toRational . sin
-- | @cosine@ - unipolar cosine wave. A pattern of continuous values
-- following a cosine with frequency of one cycle, and amplitude from
-- 0 to 1. Equivalent to `0.25 ~> sine`. | 331 | sine2 :: Fractional a => Pattern a
sine2 = sig $ \t -> sin_rat ((pi :: Double) * 2 * fromRational t)
where sin_rat = fromRational . toRational . sin
-- | @cosine@ - unipolar cosine wave. A pattern of continuous values
-- following a cosine with frequency of one cycle, and amplitude from
-- 0 to 1. Equivalent to `0.25 ~> sine`. | 331 | sine2 = sig $ \t -> sin_rat ((pi :: Double) * 2 * fromRational t)
where sin_rat = fromRational . toRational . sin
-- | @cosine@ - unipolar cosine wave. A pattern of continuous values
-- following a cosine with frequency of one cycle, and amplitude from
-- 0 to 1. Equivalent to `0.25 ~> sine`. | 296 | false | true | 3 | 10 | 65 | 82 | 39 | 43 | null | null |
noteed/rsync-streams | bin/rsync-mitm.hs | bsd-3-clause | xMIT_GROUP_NAME_FOLLOWS = bit 11 | 32 | xMIT_GROUP_NAME_FOLLOWS = bit 11 | 32 | xMIT_GROUP_NAME_FOLLOWS = bit 11 | 32 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
juanbono/my-scheme | src/Eval.hs | bsd-3-clause | eqv [Atom arg1, Atom arg2] = return $ Bool $ arg1 == arg2 | 69 | eqv [Atom arg1, Atom arg2] = return $ Bool $ arg1 == arg2 | 69 | eqv [Atom arg1, Atom arg2] = return $ Bool $ arg1 == arg2 | 69 | false | false | 0 | 7 | 24 | 34 | 16 | 18 | null | null |
esengie/algebraic-checker | test/Category.hs | bsd-3-clause | ref3_1 = H.Axiom (CodExcl "x") | 30 | ref3_1 = H.Axiom (CodExcl "x") | 30 | ref3_1 = H.Axiom (CodExcl "x") | 30 | false | false | 0 | 7 | 4 | 17 | 8 | 9 | null | null |
beni55/pwsafe | src/Options.hs | mit | options :: [OptDescr (Options -> Options)]
options = [
Option [] ["help"] (NoArg (\ opts -> opts { mode = Help })) "display this help and exit"
, Option ['a'] ["add"] (ReqArg (\s opts -> opts { mode = Add s }) "URL") "add a new entry to the database; the password is\nalways automatically generated; the username is\ngenerated unless --user is specified"
, Option ['q'] ["query"] (ReqArg (\s opts -> opts { mode = Query s }) "TERM") "lookup a password, the term must match exactly one\nentry"
, Option ['l'] ["list"] (OptArg (\s opts -> opts { mode = List s}) "TERM") "list all entries matching the given term"
, Option ['e'] ["edit"] (NoArg (\ opts -> opts { mode = Edit})) "invoke vim to edit the database using sensible\ndefaults (no backup, no swapfile etc)"
, Option [] ["dump"] (NoArg (\ opts -> opts { mode = Dump})) "dump database to stdout"
, Option [] ["lock"] (NoArg (\ opts -> opts { mode = AcquireLock})) "acquire write lock for database"
, Option [] ["unlock"] (NoArg (\ opts -> opts { mode = ReleaseLock})) "release write lock for database"
, Option [] ["dbfile"] (ReqArg (\s opts -> opts { databaseFile = s }) "FILE") "file where passwords are stored;\ndefaults to ~/.pwsafe/db"
, Option [] ["user"] (ReqArg (\s opts -> opts { userName = Just s }) "USER") "specify a username to be used for a new entry;\nthis option is to be used with --add"
, Option ['n'] [] (ReqArg (\s opts -> opts { repeatCount = (Just . read) s }) "NUMBER") "copy password n times to clipboard;\ndefaults to 1"
, Option [] ["password-only"]
(NoArg (\ opts -> opts { passwordOnly = True})) "only copy password to clipboard"
] | 1,811 | options :: [OptDescr (Options -> Options)]
options = [
Option [] ["help"] (NoArg (\ opts -> opts { mode = Help })) "display this help and exit"
, Option ['a'] ["add"] (ReqArg (\s opts -> opts { mode = Add s }) "URL") "add a new entry to the database; the password is\nalways automatically generated; the username is\ngenerated unless --user is specified"
, Option ['q'] ["query"] (ReqArg (\s opts -> opts { mode = Query s }) "TERM") "lookup a password, the term must match exactly one\nentry"
, Option ['l'] ["list"] (OptArg (\s opts -> opts { mode = List s}) "TERM") "list all entries matching the given term"
, Option ['e'] ["edit"] (NoArg (\ opts -> opts { mode = Edit})) "invoke vim to edit the database using sensible\ndefaults (no backup, no swapfile etc)"
, Option [] ["dump"] (NoArg (\ opts -> opts { mode = Dump})) "dump database to stdout"
, Option [] ["lock"] (NoArg (\ opts -> opts { mode = AcquireLock})) "acquire write lock for database"
, Option [] ["unlock"] (NoArg (\ opts -> opts { mode = ReleaseLock})) "release write lock for database"
, Option [] ["dbfile"] (ReqArg (\s opts -> opts { databaseFile = s }) "FILE") "file where passwords are stored;\ndefaults to ~/.pwsafe/db"
, Option [] ["user"] (ReqArg (\s opts -> opts { userName = Just s }) "USER") "specify a username to be used for a new entry;\nthis option is to be used with --add"
, Option ['n'] [] (ReqArg (\s opts -> opts { repeatCount = (Just . read) s }) "NUMBER") "copy password n times to clipboard;\ndefaults to 1"
, Option [] ["password-only"]
(NoArg (\ opts -> opts { passwordOnly = True})) "only copy password to clipboard"
] | 1,811 | options = [
Option [] ["help"] (NoArg (\ opts -> opts { mode = Help })) "display this help and exit"
, Option ['a'] ["add"] (ReqArg (\s opts -> opts { mode = Add s }) "URL") "add a new entry to the database; the password is\nalways automatically generated; the username is\ngenerated unless --user is specified"
, Option ['q'] ["query"] (ReqArg (\s opts -> opts { mode = Query s }) "TERM") "lookup a password, the term must match exactly one\nentry"
, Option ['l'] ["list"] (OptArg (\s opts -> opts { mode = List s}) "TERM") "list all entries matching the given term"
, Option ['e'] ["edit"] (NoArg (\ opts -> opts { mode = Edit})) "invoke vim to edit the database using sensible\ndefaults (no backup, no swapfile etc)"
, Option [] ["dump"] (NoArg (\ opts -> opts { mode = Dump})) "dump database to stdout"
, Option [] ["lock"] (NoArg (\ opts -> opts { mode = AcquireLock})) "acquire write lock for database"
, Option [] ["unlock"] (NoArg (\ opts -> opts { mode = ReleaseLock})) "release write lock for database"
, Option [] ["dbfile"] (ReqArg (\s opts -> opts { databaseFile = s }) "FILE") "file where passwords are stored;\ndefaults to ~/.pwsafe/db"
, Option [] ["user"] (ReqArg (\s opts -> opts { userName = Just s }) "USER") "specify a username to be used for a new entry;\nthis option is to be used with --add"
, Option ['n'] [] (ReqArg (\s opts -> opts { repeatCount = (Just . read) s }) "NUMBER") "copy password n times to clipboard;\ndefaults to 1"
, Option [] ["password-only"]
(NoArg (\ opts -> opts { passwordOnly = True})) "only copy password to clipboard"
] | 1,768 | false | true | 0 | 15 | 485 | 542 | 302 | 240 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/CodeGen/Flatten.hs | bsd-3-clause | flattenMeasureOp Gamma =
\(a :* b :* End) ->
\loc ->
do aE <- flattenWithName a
bE <- flattenWithName b
gammaCG (expE aE) bE loc | 158 | flattenMeasureOp Gamma =
\(a :* b :* End) ->
\loc ->
do aE <- flattenWithName a
bE <- flattenWithName b
gammaCG (expE aE) bE loc | 158 | flattenMeasureOp Gamma =
\(a :* b :* End) ->
\loc ->
do aE <- flattenWithName a
bE <- flattenWithName b
gammaCG (expE aE) bE loc | 158 | false | false | 0 | 11 | 54 | 66 | 31 | 35 | null | null |
jspahrsummers/RxHaskell | Tests.hs | mit | testCombine :: SchedulerIO MainScheduler ()
testCombine = do
(sub, sig) <- liftIO newChannel
(sub', sig') <- liftIO newChannel
sig `combine` sig' >>: liftIO . print
send sub $ NextEvent "foo"
send sub' $ NextEvent "bar"
send sub' $ NextEvent "fuzz"
send sub' CompletedEvent
send sub $ NextEvent "buzz"
send sub CompletedEvent | 363 | testCombine :: SchedulerIO MainScheduler ()
testCombine = do
(sub, sig) <- liftIO newChannel
(sub', sig') <- liftIO newChannel
sig `combine` sig' >>: liftIO . print
send sub $ NextEvent "foo"
send sub' $ NextEvent "bar"
send sub' $ NextEvent "fuzz"
send sub' CompletedEvent
send sub $ NextEvent "buzz"
send sub CompletedEvent | 363 | testCombine = do
(sub, sig) <- liftIO newChannel
(sub', sig') <- liftIO newChannel
sig `combine` sig' >>: liftIO . print
send sub $ NextEvent "foo"
send sub' $ NextEvent "bar"
send sub' $ NextEvent "fuzz"
send sub' CompletedEvent
send sub $ NextEvent "buzz"
send sub CompletedEvent | 319 | false | true | 0 | 9 | 88 | 135 | 60 | 75 | null | null |
abakst/Zoepis | Zoepis/ZGraphics.hs | gpl-3.0 | applyWindowMsg (PositionWindow (x, y)) = windowPosition $= Position x y | 71 | applyWindowMsg (PositionWindow (x, y)) = windowPosition $= Position x y | 71 | applyWindowMsg (PositionWindow (x, y)) = windowPosition $= Position x y | 71 | false | false | 0 | 8 | 9 | 30 | 15 | 15 | null | null |
sharkspeed/dororis | languages/haskell/LYHGG/7-modules/Makemyownmodules/Geometry.hs | bsd-2-clause | -- 矩形
rectangleArea :: Float -> Float -> Float
rectangleArea a b = a * b | 72 | rectangleArea :: Float -> Float -> Float
rectangleArea a b = a * b | 66 | rectangleArea a b = a * b | 25 | true | true | 1 | 8 | 15 | 36 | 16 | 20 | null | null |
k0001/haskell-money | safe-money-serialise/test/Main.hs | bsd-3-clause | testDense
:: forall currency
. KnownSymbol currency
=> Proxy currency
-> Tasty.TestTree
testDense pc =
Tasty.testGroup ("Dense " ++ show (symbolVal pc))
[ QC.testProperty "Serialise encoding roundtrip" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just x === hush (Ser.deserialiseOrFail (Ser.serialise x))
, QC.testProperty "Serialise encoding roundtrip (SomeDense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
let x' = Money.toSomeDense x
in Just x' === hush (Ser.deserialiseOrFail (Ser.serialise x'))
, QC.testProperty "Serialise encoding roundtrip (Dense through SomeDense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just x === hush (Ser.deserialiseOrFail (Ser.serialise (Money.toSomeDense x)))
, QC.testProperty "Serialise encoding roundtrip (SomeDense through Dense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just (Money.toSomeDense x) === hush (Ser.deserialiseOrFail (Ser.serialise x))
] | 1,046 | testDense
:: forall currency
. KnownSymbol currency
=> Proxy currency
-> Tasty.TestTree
testDense pc =
Tasty.testGroup ("Dense " ++ show (symbolVal pc))
[ QC.testProperty "Serialise encoding roundtrip" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just x === hush (Ser.deserialiseOrFail (Ser.serialise x))
, QC.testProperty "Serialise encoding roundtrip (SomeDense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
let x' = Money.toSomeDense x
in Just x' === hush (Ser.deserialiseOrFail (Ser.serialise x'))
, QC.testProperty "Serialise encoding roundtrip (Dense through SomeDense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just x === hush (Ser.deserialiseOrFail (Ser.serialise (Money.toSomeDense x)))
, QC.testProperty "Serialise encoding roundtrip (SomeDense through Dense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just (Money.toSomeDense x) === hush (Ser.deserialiseOrFail (Ser.serialise x))
] | 1,046 | testDense pc =
Tasty.testGroup ("Dense " ++ show (symbolVal pc))
[ QC.testProperty "Serialise encoding roundtrip" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just x === hush (Ser.deserialiseOrFail (Ser.serialise x))
, QC.testProperty "Serialise encoding roundtrip (SomeDense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
let x' = Money.toSomeDense x
in Just x' === hush (Ser.deserialiseOrFail (Ser.serialise x'))
, QC.testProperty "Serialise encoding roundtrip (Dense through SomeDense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just x === hush (Ser.deserialiseOrFail (Ser.serialise (Money.toSomeDense x)))
, QC.testProperty "Serialise encoding roundtrip (SomeDense through Dense)" $
QC.forAll QC.arbitrary $ \(x :: Money.Dense currency) ->
Just (Money.toSomeDense x) === hush (Ser.deserialiseOrFail (Ser.serialise x))
] | 949 | false | true | 0 | 17 | 211 | 361 | 172 | 189 | null | null |
matterhorn-chat/matterhorn | test/Message_QCA.hs | bsd-3-clause | genUUID :: Gen UUID
genUUID = (fromMaybe (error "BUG: invalid genUUID result") . fromByteString . BSL.pack) <$>
replicateM 16 arbitrary | 145 | genUUID :: Gen UUID
genUUID = (fromMaybe (error "BUG: invalid genUUID result") . fromByteString . BSL.pack) <$>
replicateM 16 arbitrary | 145 | genUUID = (fromMaybe (error "BUG: invalid genUUID result") . fromByteString . BSL.pack) <$>
replicateM 16 arbitrary | 125 | false | true | 0 | 11 | 29 | 50 | 23 | 27 | null | null |
CloudI/CloudI | src/api/haskell/external/binary-0.8.7.0/src/Data/Binary/Put.hs | mit | -- | /O(1)./ Write an Int64 in native host order
-- On a 32 bit machine we write two host order Int32s, in big endian form.
-- For portability issues see @putInthost@.
putInt64host :: Int64 -> Put
putInt64host = tell . B.putInt64host | 245 | putInt64host :: Int64 -> Put
putInt64host = tell . B.putInt64host | 77 | putInt64host = tell . B.putInt64host | 42 | true | true | 0 | 6 | 53 | 24 | 14 | 10 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.