lang stringclasses 10
values | seed stringlengths 5 2.12k |
|---|---|
haskell | | Comment Text
| Exit
deriving(Show, Eq)
tokenizeCode :: Text -> [Text]
tokenizeCode = split $ \c -> c == '。' || c == '、' || c == '「' || c == '」'
parseCode :: Text -> Inst
parseCode str |
haskell | fromJSValUnchecked)
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement.lengthAdjust Mozilla SVGTextContentElement.lengthAdjust documentation>
getLengthAdjust ::
(MonadDOM m, IsSVGTextContentElement self) =>
self -> m SVGAnimatedEnumeration
getLength... |
haskell | -- -> (k -> j -> (i, i)) -> ((k -> j -> i -> e) -> k -> j -> i -> e)
-- -> k -> j -> i -> e
-- flexible3 bounds1 bounds2 bounds3 f = (!) flex where
-- flex = A.listArray bounds1
-- [ down2 (bounds2 i) (bounds3 i) (f (flex !) i) |
haskell | toBaseStmtForm (SExp a e) = do
s <- toBaseExpr e
addStmt $ SExp a s
toBaseStmtForm (Cond a cond b) = do
sCond <- toBaseExpr cond
(_, inner) <- catch $ toBaseStmtForm b |
haskell | forall t effs.
( Member (Embed IO) effs,
Members [Error UserError, Warn UserError] effs,
FromJSON t,
ToJSON t,
TransitionValid t
) =>
FilePath ->
Sem (WriteGraph t ': effs) ~> Sem effs
runWriteGraphIO dir = runInputConst (IsDual False) . runWriteGraphIODualizeable dir
runWriteGraphIO' :: |
haskell | numIncreases :: Ord a => [a] -> Int
numIncreases = length . filter (LT ==) . ap (zipWith compare) tail
windows :: (Num a) => [a] -> [a]
windows = map (sum . take 3) . tails
part1 :: [Integer] -> String
part1 = show . numIncreases |
haskell | translateT :: Program -> Runner ()
translateT p = tellHead >>
translateProgram p >>
tellTail
tellHead :: Runner ()
tellHead =
tell "declare i32 @printf(i8*, ...)\n" >>
tell "@formatString = private constant [4 x i8] c\"%d\\0A\\00\"\n" >> |
haskell | repoId =
let prefixLen = length section - suffixLen
suffixLen = length repoSectionSuffix
in take prefixLen section
repoSectionSuffix :: String
repoSectionSuffix = "-repo"
repoRemotePathK :: String
repoRemotePathK = "remote_path"
repoRemoteSshKeyK :: String
repoRemoteSshKeyK = "ssh_pr... |
haskell | module Lib
( someFunc
) where
--------------------------------------------------------------------------------
import Test.TWebDriver.Commands
--------------------------------------------------------------------------------
myS :: WD ()
myS = click =<< findElem $(mkXPath "//a/button/descendant::a[co... |
haskell | ) where
import Universum
import Pos.Core (Address)
-- | A class which have the method to generate a new address
class Monad m => MonadAddresses m where
type AddrData m :: *
-- | Generate new address using given 'AddrData' (e.g. password +
-- account id).
getNewAddress :: ... |
haskell | fibs' :: [Integer]
fibs' = take 20 fibs
-- Question 2
fibs'' :: [Integer]
fibs'' = takeWhile (<100) fibs |
haskell | AppRoles (..)
)
where
import Data.Aeson
import qualified Data.HashMap.Strict as HM
import Data.Text
|
haskell |
import GHC.Generics
data IssueIDTO =
IssueIDTO
{ _issueIDTONumber :: Int
, _issueIDTOTitle :: String
, _issueIDTOBody :: String
}
deriving (Show, Eq, Generic)
|
haskell | -- https://www.codewars.com/kata/57fae964d80daa229d000126
module Kata where
remove :: String -> String
remove "" = ""
remove "!" = ""
remove (x:xs) = x:(remove xs) |
haskell |
bfsEval :: [Int]
bfsEval =
reverse r
where
(r, _, _) = bfs ([1], visit, graph !! 1)
bfs :: BreadcrumbB -> BreadcrumbB
bfs b@(_, _, []) = b |
haskell |
tupElemTyName :: Int -> Q Name
tupElemTyName i = newName $ printf "t%d" i
-- | Generate a single constructor for the 'TabTuple' type.
mkTupleCons :: Name -> (Int -> Name) -> (Type -> Type) -> Int -> Q Con
mkTupleCons tupTyName conName elemTyCons width = do
tupElemTyNames <- mapM tupElemTyName [1..width]
let... |
haskell | import Data.ByteString.Lazy as S
import Data.Bits as B
import Data.List as L
import Data.Binary.Get as G
import Data.Char
import Data.Int
import Data.Word
import Methods
import ImpossibleImports
import Memory
g'bool :: Get Bool |
haskell | -- Unit
unit :: Float -> (Float, [Char])
unit v = (v, "")
-- Bind |
haskell | import Clash.Prelude
import GHC.TypeLits.Extra
import Data.Kind (Type)
import Data.Proxy
import Data.Singletons hiding (type (+))
data IIndex (f :: TyFun Nat Type) :: Type
type instance Apply IIndex l = Index ((2^l)+1)
popCountT = tdfold (Proxy :: Proxy IIndex) fromIntegral (const add)
|
haskell | module Formal where
import Data.List
newtype FPS v c =
FPS
{ eval :: [v] -> c
}
fpsSum :: (Num c) => FPS v c -> FPS v c -> FPS v c |
haskell | data Key = Key {
next :: (Key, Integer)
|
haskell | data Expr = Expr { exprField :: Text
, exprSelector :: SelectorExp } deriving (Show, Eq)
data PageExp = PageExp { pageUrlFilter :: Text
, pageExprs :: [Expr] }
deriving (Show, Eq)
type PageName = Text
|
haskell | -> Bool
-> Fay CodeMirror -- ^ A new code mirror.
newCodeMirror = ffi "CodeMirror(%1,{mode:%2,value:%3,autofocus:%4,indentWithTabs:false,tabSize:4})"
-- | Get the current editor content.
getMirrorValue :: CodeMirror -> Fay String
getMirrorValue = ffi "%1['getValue']()"
-- | Set the current... |
haskell | where
numTypes = ["~int2", "~int4", "~int8", "~numeric", "~float4", "~float8"]
isDbValue = T.isPrefixOf "~"
isComparableType = isDbValue
symInClass T.Num sym = sym `elem` numTypes |
haskell | ------------------------------------------------------------
import MonadIO.NamedHandle ( HEncoding( NoEncoding ), ℍ, handle )
import MonadIO.OpenFile ( FileOpenMode( FileR ), openFile )
--------------------------------------------------------------------------------
type 𝔹𝕊 = ByteString
class MkInputStream ... |
haskell | module Language.Tiger.Expr where
|
haskell | import Control.Concurrent
expensive = f (500 :: Int)
where f 0 = stop
f n = do
r <- atom $ getStdRandom (randomR (0,99::Int))
r `seq` f $! n-1
main = do
m <- newEmptyMVar
forkIO (do
runTIO $ map (\x->expensive) [1..500]
putMVar m ()) |
haskell | let result = input --> gate
putStrLn $ show input ++ " -> " ++ show result
data Neuron = Neuron {
weight :: Vector R,
bias :: R |
haskell | import Test.QuickCheck
import Test.Tasty
import Test.Tasty.Hspec as HS
import Data.List
import Data.Ord
import qualified Test.Fluidity.EVM.Data.BytecodeSpec as BytecodeSpec
import qualified Test.Fluidity.EVM.Core.SystemSpec as SystemSpec |
haskell | eAccessToken <- liftIO $ runEncryptM appEncryptionSettings $ decryptText twitchCredentialsAccessToken
case eAccessToken of
Left _ -> sendStatusJSON status401 ("Unable to retrieve access token" :: Text)
Right accessToken -> do
eResponse <-
twitchRequest |
haskell | describe "Part1" $ do
it ("returns 67384529 for " ++ input) $ do
part1 input `shouldBe` "67384529"
-- describe "Part2" $ do
-- it ("returns 149245887792 for " ++ input) $ do |
haskell | infixr 5 :-:
data List a = Empty | Cons { listHead :: a, listTail :: List a}
deriving (Show, Read, Eq, Ord)
data List1 a = Empty1 | a :-: (List1 a)
deriving (Show, Read, Eq, Ord)
infixr 5 ^++
(^++) :: List1 a -> List1 a -> List1 a
Empty1 ^++ ys = ys
(x :-: xs) ^++ ys = x :-: (xs ^++ ys) |
haskell | -- | Full data type definition for
-- CodeDeployDeploymentGroupOnPremisesTagSetListObject. See
-- 'codeDeployDeploymentGroupOnPremisesTagSetListObject' for a more
-- convenient constructor.
data CodeDeployDeploymentGroupOnPremisesTagSetListObject =
CodeDeployDeploymentGroupOnPremisesTagSetListObject
{ _codeDeployDe... |
haskell | l <- generateArray 0.0 1.0
m <- generateArray 0.0 1.0
let ls = map (\x -> (x - 0.5)*0.1) $ take 100 $ l
let ms = map (\x -> (x - 0.5)*0.1) $ take 100 $ m
let point = predict_point_from_sources ls ms (3.4,5.6)
print point
let uvgrid = sample_uv_grid 5 5.0 ls ms
print uvgrid
|
haskell | module Data.String.Strip (strip) where
import Data.Char
-- | This is haddock documentation. Explain here that this function trims spaces.
-- If you run stack haddock from the terminal, the docs are in .stack-work/dist/somenumber/doc/html/projectname/doc-index.html
strip :: String -> String
strip = dropWhile isSpace ... |
haskell | import Data.ByteString (ByteString)
import Data.ByteString.Builder (lazyByteString)
import qualified Data.ByteString.Lazy as L
import Data.Enumerator (Iteratee, consume)
import Network.Wai
import Network.Wai.Handler.Webkit |
haskell |
module ListsPalindrome where
isPalindrome :: (Eq a) => [a] -> Bool
isPalindrome xs = xs == (reverse xs)
|
haskell | module Main where
import CLI
main :: IO ()
main = do
path <- getArgs
runFs path
|
haskell | -- | Convenience function for @first@ with a @Kleisli@ arrow.
firstM ∷ Monad m ⇒ (a → m c) → (a, b) → m (c, b)
firstM = unkleislify first
-- | Convenience function for @second@ with a @Kleisli@ arrow.
secondM ∷ Monad m ⇒ (b → m c) → (a, b) → m (a, c)
secondM = unkleislify second
-- | Convenience function for @(***)@ ... |
haskell | module B (idd) where
idd :: Int
idd = 100000242418429
|
haskell | => ThmTactic HOLThm cls thry -> thm -> Tactic cls thry
_CONJUNCTS_THEN' ttac cth g =
do th1 <- ruleCONJUNCT1 cth
th2 <- ruleCONJUNCT2 cth
(ttac th1 `_THEN` ttac th2) g
ruleIMPLICATE :: BoolCtxt thry => HOLTerm -> HOL cls thry HOLThm
ruleIMPLICATE (Neg t') =
ruleCONV (convRAND convBETA... |
haskell | import Icicle.Common.Fresh
import Icicle.Core.Program.Program
import Icicle.Core.Stream.Stream
import qualified Icicle.Core.Exp.Simp as S
import qualified Icicle.Core.Exp.Exp as C
|
haskell | requestLine =
(,,) <$>
(method <* B.skipSpace) <*>
(B.takeTill B.isSpace <* B.skipSpace) <*>
httpVersion
where method = "GET" <|> "POST"
httpVersion = "HTTP/" *> ((,) <$> (int <* B.char '.') <*> int)
responseLine = (,,) <$>
(httpVersion <* B.skipSpace) <*>
(int <* B.ski... |
haskell |
-- fmap a -> fa -> fb -> f f b
addOne :: Num a => a -> [a]
addOne x = [x, 1]
func1 :: Num a => (a -> [a]) -> [a] -> [[a]]
func1 f l = f <$> l
result = func1 addOne [1,2,3]
bind' :: Monad m => ( a -> m b ) -> m a -> m b
bind' f = join . fmap f
-- liftA :: Applicative f => (a -> b) -> f a -> f b |
haskell | print $ part1 (read timestamp) buses
print $ part2 buses
splitBy :: Char -> String -> [String]
splitBy _ "" = []
splitBy c (',' : s) = splitBy c s
splitBy c s = let (a, b) = span (/= c) s in a : splitBy c b
part1 :: Int -> [String] -> Int
part1 timestamp buses' = uncurry (*) $ minimum $ zip (map (\b -> b - mod ti... |
haskell | data Action = AttackTo Target | Iso Command deriving (Show)
data Target = ToPlayer | ToEnemy deriving (Show)
data CommandList = CommandList {
_index :: Int,
_listSize :: Int,
_commandMap :: IM.IntMap Command
} deriving (Show)
index :: Lens' CommandList Int
index = lens _index (\f x -> f { _index = x })
listSize... |
haskell | import Data.Vinyl
import GHC.Exts
import GHC.Generics
import GHC.TypeNats
import Generics.OneLiner
import Numeric.Backprop as B
import Numeric.LinearAlgebra.Static.Backprop ()
import Numeric.Opto.Update hiding ... |
haskell |
(startYear, endYear) = (1901,2000)
startOffset = 1 -- Jan 1 1901 was a Tuesday
targetDay = 6 -- searching for Sundays
monthLengths = [31,28,31,30,31,30,31,31,30,31,30,31]
monthLengthsLeap = 31:29:(drop 2 monthLengths)
(yearlyOffset, yearlyOffsetLeap) = (1,2)
--map ((`mod` 7) . sum) [monthLengths, monthLengthsLeap]
... |
haskell | primHashMap :: M.Map Identifier (T.Text,Hash)
primHashMap = M.fromList (zip allPrimNames vs)
where
ns = map unIdentifier allPrimNames
hs = map mkHash ns
vs = zip ns hs
primSizeMap :: M.Map Identifier Size
primSizeMap = M.fromList $ zip ns sz
where
ns = map primToText allPrims |
haskell | {-
liftIO (modifyIORef' ref (\(w',s) -> ( trace ("\nwtell " ++ show w' ++ " " ++ show w)
w'<>w
, s)))
-}
(w', s) <- readIORef ref
writeIORef ref (w' <> w, s)
return ((), x)
{-# INLINE tell #-}
|
haskell | module Ch2 where
triple x = x * 3
waxOn = x * 5
where
x = y ^ 2
y = z + 8
z = 7
|
haskell | module Main where
import Control.Monad
import HGet.Internal.CLI (cliConfig)
import HGet.Internal.UI (runUI)
main :: IO ()
main = do
config <- cliConfig
void runUI
|
haskell | -- "Crypto.Saltine.Core.Auth"
--
-- The 'auth' function authenticates a message 'ByteString' using a
-- secret key. The function returns an authenticator. The 'verify'
-- function checks if it's passed a correct authenticator of a message
-- under the given secret key. |
haskell | describe "Testing whether an example of an LCirc has coherent semantics" $ do
it "compatible lgraph node composition" $ do
let n1 = mkNodes [1, 2, 3 :: NodeId]
n2 = mkNodes [4, 5, 6 :: NodeId]
m12 = Map.fromList $ [(5, \c-> if (c == 5) then 1 else c), (4, \c-> if c == 4 then 2 else c)]
... |
haskell | import Data.Text.Lazy (Text)
layoutCss :: Text
layoutCss = render $ do
body ? minHeight (px 2000)
element ".jumbotron" ? (textAlign $ alignSide sideCenter)
element "#gmail" ? (marginLeft $ px 10)
|
haskell | module RebindHR where
import Prelude hiding ( (>>=) )
import Data.Typeable
data Exp = Int Int | Plus Exp Exp | Bool Bool
data TExp a where
TInt :: Int -> TExp Int
TPlus :: TExp Int -> TExp Int -> TExp Int
TBool :: Bool -> TExp Bool
(>>=) :: ((forall t. Typeable t => TExp t -> Maybe r) -> Maybe r)
-> (for... |
haskell |
import Control.Effect
import Control.Effect.Monad
import Prelude hiding (Monad(..))
putStrLn' = Wrap . putStrLn
printer = do putStrLn' "Hello"
putStrLn' "I am really regular IO monad" |
haskell | )
where
import Prelude ()
import SDP.SafePrelude
import SDP.Zip
default ()
--------------------------------------------------------------------------------
|
haskell | do base_nm <- symName (str ++ "_base")
off_nm <- symName (str ++ "_offset")
base <- freshConstant sym base_nm BaseNatRepr
offs <- freshConstant sym off_nm (BaseBVRepr knownNat)
return (Value (LLVMPointer base offs))
isPtr ptr True
... |
haskell | firstLit (ALit l _ : _) = l
firstLit (_ : as) = firstLit as
k2cStringAlts b e (ALit l c : as)
= (if b then text "else " else empty) <> text "if (strEq (" <> k2cExp e <>
text "," <> k2cExp (ELit l) <> text ")) {" $$
... |
haskell | Portability : GHC
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Language.Fortran.Inline.Utils
where
import qualified Language.C.Inline as C |
haskell | import Protolude
import Test.Tasty (defaultMain, testGroup)
import qualified Spec.Day_3 as Day_3
main :: IO ()
main = |
haskell | html $ mconcat ["<html><body>"
,"<h1> Heading </h1>"
,"</body></html>"
]
|
haskell |
factFromJSON :: (?q::SMTQuery) => DFSession -> J.Value -> IO Fact
factFromJSON df f@(J.Object vs) = case H.toList vs of
[(rname, v)] -> rowFromJSON df (unpack rname) v
_ -> err $ "Invalid JSON fact: " ++ show f
factFromJSON _ f =... |
haskell |
data Split
PlutusTx.makeLift ''SplitDatum
PlutusTx.unstableMakeIsData ''SplitDatum
instance Scripts.ValidatorTypes Split where
type RedeemerType Split = ()
type DatumType Split = SplitDatum
splitValidator :: Scripts.TypedValidator Split
splitValidator = |
haskell | it "calculates the square of an arbitrary integer" $
property $ \(n :: Integer) -> square n == n * n
it "calculates the square of an arbitrary double" $
property $ \(n :: Double) -> square n == n * n
describe "ggT" $ do
it "calculates the gcd of 15 and 10" $
ggT 15 10 `shouldBe` 5
it... |
haskell | let x = xp `mod` a in
let y = yp `mod` b in
Divides.chineseRemainder a b x y < a * b
proposition10 ::
Primitive.Natural.Natural -> Primitive.Natural.Natural ->
Primitive.Natural.Natural -> Primitive.Natural.Natural -> Bool |
haskell |
major7Chord :: Chord
major7Chord = buildChord [0, 4, 7, 11]
type Duration = Int
data Progression =
Progression
{ chords :: [((Chord, Int), Duration)]
, key :: Double
, tempo :: Double
}
applyProgression :: Progression -> WaveFn -> WaveFn
applyProgression prog wave t
| t == 0 = (applyChord ... |
haskell | import Test.Tasty
import qualified Test.Tasty.SmallCheck as SC
import qualified Codec.Packstream.Coding as PSC
import Test.SCInstances
unitTests :: TestTree |
haskell | import Data.IntMap
import Yesod
import Dispatch ()
import Foundation
main :: IO ()
main = do
tstore <- atomically $ newTVar empty
tident <- atomically $ newTVar 0
warpEnv $ App tident tstore |
haskell | elementFromPoint self x y
= liftDOM
(((toDocumentOrShadowRoot self) ^. jsf "elementFromPoint"
[toJSVal x, toJSVal y])
>>= fromJSVal)
-- | <https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot.elementFromPoint Mozilla DocumentOrShadowRoot.elementFromPoint documentation>
elem... |
haskell | }
instance Default XvfbConfig where
def = XvfbConfig Nothing
defaultWdOptions :: FilePath -> FilePath -> WdOptions
defaultWdOptions toolsRoot runRoot = WdOptions toolsRoot runRoot (const False) def OnException Normal
data WdSession = WdSession { wdLabels :: [String]
, wdWebDriver :: (H... |
haskell | { stCheckpoints = initCheckpoints
, stSystemState = Sys.initState
, stLast = Sys.initState
}
getCheckpoints = stCheckpoints <$> getState
getSystemState = stSystemState <$> getState
getLast = stLast <$> getState
setCheckpoints x = updateState (\st -> st { stCh... |
haskell | multM m1 m2 | l1 /= l2 = error "matrizes incompatíveis"
| otherwise = [[prodInterno l c | c<-transpose m2] | l<-m1]
where l1 = snd $ lengthM m1
l2 = fst $ lengthM m2
|
haskell | mkSubscriptionScheduleAddInvoiceItem subscriptionScheduleAddInvoiceItemPrice =
SubscriptionScheduleAddInvoiceItem
{ subscriptionScheduleAddInvoiceItemPrice = subscriptionScheduleAddInvoiceItemPrice,
subscriptionScheduleAddInvoiceItemQuantity = GHC.Maybe.Nothing,
subscriptionScheduleAddInvoiceItemTaxRa... |
haskell |
dt2Str :: DataType -> String
dt2Str StdLogic = "SL"
dt2Str StdLogicVector = "SL Vec"
dt2Str StdULogic = "SUL"
dt2Str StdULogicVector = "SUL Vec" |
haskell |
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "SystemF" SF.spec
describe "Transformations" Tr.spec
describe "FromPlutusIR" FP.spec |
haskell | ---------------------------------- StateT ------------------------------------
newtype StateT s m a = StateT{runStateT :: s -> m (a,s)}
instance Monad m => Functor (StateT s m) where
fmap f (StateT fa) = StateT $ \s -> do
(xa, sx) <- fa s
return (f xa, sx)
instance Monad m => Applicative (StateT ... |
haskell | -- test that a failed acquire doesn't fail the other requests
ref <- newIORef False
env <- testEnv impl $ \st ->
st { failAcquire = throwIO (DataSourceError "acquire")
, failRelease = writeIORef ref True }
x <- runHaxl env $
(dataFetch (FailAfter 0) + wombatsMany)
`Haxl.catch` \Dat... |
haskell | (mrow :: Maybe (Double,I.Int64))
<- H.single $ [H.q|SELECT *
FROM data
WHERE field1=?|] num
case mrow of
Just (field1,field2) ->
let newfi... |
haskell | cachedIdem f i a = do
s <- get
case Set.member a s of
True -> return i
False -> do
b <- f a
s' <- get
put (Set.insert a s')
return b
|
haskell | , velocity = Vel (0, 0)
, mass = 1
}
earth :: Body |
haskell | prism'
SpendsPK
( \case
SpendsPK o -> Just o
_ -> Nothing
)
-- * Picking apart 'OutConstraint's
data PaysScriptConstraint where
PaysScriptConstraint ::
PaysScriptConstrs a =>
L.TypedValidator a -> |
haskell | module Atom.Language.Atom
( -- * Code
-- | Module: "Language.Atom.Code"
Config (..), defaults, Clock (..), defaultClock, writeC, cType, RuleCoverage,
-- * Compilation
-- | Module: "Language.Atom.Compile"
compile, reportSchedule, Schedule,
-- * Common
-- | Module: "Language.Atom.Common"
... |
haskell | module Lib
( someFunc,
)
where
someFunc :: IO ()
someFunc = putStrLn "HELLO LUKE WORLD!!!!!!!!!!"
|
haskell | getCategories,
search,
download
) where
import Network.Curl
import qualified Types.Category as Category
import qualified Types.Torrent as Torrent
import qualified Data.Map.Strict as Map
import qualified Data.Aeson as Json
import qualified Data.ByteString.Lazy.Char8 as C
|
haskell | import Servant (NoContent (NoContent))
import Cardano.BM.Data.Trace (Trace)
import Cardano.Node.Follower (NodeFollowerEffect)
import Cardano.Node.RandomTx
import Cardano.Node.Types
import Cardano.Protocol.Chai... |
haskell | shrinkCompiled :: CompiledCode a -> CompiledCode a
shrinkCompiled = shrinkCompiledSp defaultShrinkParams
shrinkCompiledSp :: ShrinkParams -> CompiledCode a -> CompiledCode a
shrinkCompiledSp sp comped =
let asScript = fromCompiledCode comped
script@(Script prog') = shrinkScriptSp sp asScript
prog = progr... |
haskell | import Test.Hspec
import Test.QuickCheck
main :: IO ()
main = hspec $ do
describe "fun1'" $ do
it "should behave just like fun1" $ property $
\xs -> (fun1' xs) == (fun1 xs)
describe "fun2'" $ do
it "should behave just like fun2" $ property $
forAll (arbitrary :: Gen (Positive Integer)) |
haskell | dissembler, hypocrite, sophist, Pharisee, Jesuit, Mawworm, Pecksniff, <NAME>, Tartuffe, Janus, serpent, snake in the grass, cockatrice, Judas, wolf in sheep's clothing, jilt, shuffler, stool pigeon
*liar
story-teller, perjurer, false witness, menteur a triple etage, Scapin, bunko steerer , carpetbagger , capper , fa... |
haskell | import Safe (headMay, lastMay)
import Network.Wreq (redirects)
import Control.Lens
import Natas.Natas
import Natas.Parse
solution :: Solution
solution = do
let req = getLevel' 22 (parentUri 22 ++ "/?revelio") (redirects .~ 0) |
haskell | module Graphics.GL.SGIS.TextureLOD,
module Graphics.GL.SGIS.TextureSelect
) where
import Graphics.GL.SGIS.DetailTexture
import Graphics.GL.SGIS.FogFunction
import Graphics.GL.SGIS.GenerateMipmap |
haskell | toDigits :: Integer -> [Integer]
toDigits = map (toInteger . digitToInt) . show
factorial :: Integer -> Integer
factorial n = product [1..n] |
haskell | import Lucid (Html, ToHtml (toHtml), br_, pre_)
import Prettyprinter.Render.Util.SimpleDocTree (SimpleDocTree (..))
renderHtml :: SimpleDocTree (Html () -> Html ()) -> Html ()
renderHtml =
let go = \case
STEmpty -> pure () |
haskell | tests :: TestTree
tests = testGroup "Tests" [unitTests]
unitTests :: TestTree
unitTests = testGroup "D22P1 Unit tests"
[
testCase "gives correct answer to the original problem" $ do
[0,3,6,9,2,5,8,1,4,7] @=? shuffled 10 1 [
DealWithIncrement 7, DealIntoNewStack, DealInto... |
haskell | with :: Verified p a -> (forall s. Reifies s (Verified p a) => Lift p a s) -> a
with d v = reify d (lower . asProxyOf v)
where
asProxyOf :: f s -> Proxy s -> f s
asProxyOf x _ = x
using :: forall p a b. VerifiableConstraint p => Verified p a -> (p a => b) -> b
using d m = reify d $ \(_ :: Proxy s) -> |
haskell |
numbs = mkRegex "^:[0-9]{4}$"
hgtIn = mkRegex "^[0-9]+in$"
hgtCm = mkRegex "^[0-9]+cm$"
hairC = mkRegex "#[0-9,[a-f]{6}"
|
haskell |
import qualified SuperWeatherProvider
import qualified SuperWeatherReporter
-- | This is an actual application where we use
-- our concrete implementation of `WeatherProvider`.
main :: IO ()
main = do |
haskell | -- DFT function is expressed as a multiplication of a transformation matrix with
-- the input vector. The matrix is never manifested, and the resulting code is
-- a doubly-nested loop where the matrix elements appear in the innermost
-- calculation.
dftRun = connectStdIO $ return . (dft :: DPull (Complex Double) -> _)... |
haskell | | otherwise = isAbba (b:c:d:rest) (found || matches && not inBraces) inBraces
where
matches = a == d && b == c && a /= b
isAba :: String -> Bool |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.