code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses, DeriveFunctor, ImpredicativeTypes, LambdaCase, DeriveDataTypeable #-} module Control.Monad.Jail ( Jail () , JailT () , runJail , runJailT , jail , jailMaybe , freedom ...
isovector/eden
src/Control/Monad/Jail.hs
bsd-3-clause
4,294
0
13
1,523
1,960
1,038
922
145
2
module Main where import Prelude.Extended import System.Directory import System.FilePath ((</>)) import System.Process import qualified Data.Text as T import qualified Fay.Builder as Builder import qualified Paths_pickler as Paths main :: IO () main = do pkgDb <- getPackageDb print pkgDb packageDesc <...
silkapp/pickler.js
exe/Main.hs
bsd-3-clause
739
0
14
145
224
123
101
19
1
{-# LANGUAGE CPP,TemplateHaskell,DeriveDataTypeable #-} module Data.Encoding.ISO88598 (ISO88598(..)) where import Data.Array ((!),Array) import Data.Word (Word8) import Data.Map (Map,lookup,member) import Data.Encoding.Base import Prelude hiding (lookup) import Control.OldException (throwDyn) import Data.Typeable da...
abuiles/turbinado-blog
tmp/dependencies/encoding-0.4.1/Data/Encoding/ISO88598.hs
bsd-3-clause
804
2
14
108
250
140
110
21
1
module Main where import Lib main :: IO () main = someFunc {-99 Haskell Problems-} {-| Get the last element of a list-} myLast :: [a] -> a myLast [x] = x myLast (_:xs) = myLast xs {-| Get the second to last element of a list-} myButtLast :: [a] -> a myButtLast [x, _] = x myButtLast (_:xs) = myButtLast xs {-| Get...
MauriceIsAG/HaskellScratch
.stack-work/intero/intero29456rhS.hs
bsd-3-clause
3,854
0
14
1,196
2,229
1,176
1,053
107
3
--Mirror is a program for responding to input (well, aren't all programs?) --Syntax of a mirror file is: --inp1|inp2_output1 --Soon, mirror will handle multiple outputs per inputs. import System.IO import System.Environment import System.Process import Cookbook.Ingredients.Tupples.Look import Cookbook.Ingredients.List...
natepisarski/Mirror
Mirror.hs
bsd-3-clause
1,551
0
13
275
603
312
291
37
2
import Command import RCommand data Device = Device { async :: String -> IO () } send :: Device -> Command -> IO () send d m = async d (show m) device :: Device device = Device (execRCommand . read) main = send device (Say "Hello")
ku-fpg/remote-monad-examples
classic-examples/Command/Main.hs
bsd-3-clause
236
0
11
51
106
55
51
8
1
module EnvTest (testEnv) where import qualified Data.Map as M import Test.Hspec import Types import Env emptyEnv :: Env emptyEnv = Env [M.empty] testEnv :: IO () testEnv = hspec $ do describe "addFrame" $ it "addFrame" $ addFrame emptyEnv `shouldBe` Env [M.empty, M.empty] describe "dropFrame" $ i...
martintrojer/scheme-haskell
test/EnvTest.hs
bsd-3-clause
1,134
0
17
314
429
229
200
27
1
{-# LANGUAGE OverloadedStrings, LambdaCase #-} module Main where import Criterion import Criterion.Main import Data.RDF import qualified Data.Text as T -- The `countries.ttl` Turtle file is needed to run this benchmark suite -- -- $ wget http://telegraphis.net/data/countries/countries.ttl parseTurtle :: RDF rdf => ...
LeifW/rdf4h
bench/MainCriterion.hs
bsd-3-clause
4,351
0
21
1,106
1,462
770
692
74
10
import Test.Framework (defaultMain, testGroup) import Test.Framework.Providers.HUnit import Test.HUnit import qualified Data.ByteString as BS import Network.SPDY import Network.SPDY.Frame as SP import Data.List import Data.Maybe import qualified Data.ByteString.UTF8 as SU8 import qualified Data.Map as Map import quali...
robinbrandt/haskell-spdy-playground
tests/TestSuite.hs
bsd-3-clause
6,193
85
14
1,586
2,240
1,299
941
-1
-1
{-# LANGUAGE TemplateHaskell #-} module Ex3FunParser where import Data.Parser.Grempa.Static import Data.Parser.Grempa.Dynamic -- Import the grammar. import Ex3Fun -- We also need the token datatype in scope or Template Haskell will complain. import Ex3FunLex -- | Make a static parser parseFunStatic :: Parser Tok [De...
ollef/Grempa
examples/Ex3FunParser.hs
bsd-3-clause
942
0
7
221
145
88
57
17
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module ERC.Array where import Debug.Trace (trace) import Prelude import Control.Monad.ST.Trans import Control.Monad.Except import GHC.TypeLits import Text.Printf import ERC.Monad import ERC.Variables import ERC.Integer import ERC.Real newtype REALn s (n :: Nat) = REALn { ...
michalkonecny/aern2
aern2-erc/src/ERC/Array.hs
bsd-3-clause
6,179
0
16
1,452
2,786
1,388
1,398
-1
-1
import System.Environment import Text.Template main :: IO () main = do fp : _ <- getArgs t <- readFile fp mr <- template convert get t maybe (return ()) putStr mr convert :: String -> [String] convert "name" = ["Yoshikuni", "Kazuhiro"] convert "i" = map show [1 :: Int ..] convert _ = [] get :: String -> IO [Str...
YoshikuniJujo/template
tests/test.hs
bsd-3-clause
391
0
10
81
188
100
88
14
1
{-# LANGUAGE PatternGuards, TypeSynonymInstances #-} module IRTS.Compiler where import IRTS.Lang import IRTS.Defunctionalise import IRTS.Simplified import IRTS.CodegenCommon import IRTS.CodegenC import IRTS.CodegenJava import IRTS.DumpBC import IRTS.CodegenJavaScript import IRTS.Inliner import Idris.AbsSyntax import...
byorgey/Idris-dev
src/IRTS/Compiler.hs
bsd-3-clause
14,937
37
24
6,496
4,602
2,344
2,258
310
10
module Chp95 where import qualified Data.ByteString.Lazy as B import qualified Data.ByteString as S import System.Directory import System.Environment import System.IO import System.IO.Error import Control.Exception {-- Bytestring However, processing files as strings has one drawback: it tends to be slow. As you know...
jamesyang124/haskell-playground
src/Chp95.hs
bsd-3-clause
10,555
0
16
2,096
560
293
267
39
2
{-# LANGUAGE Arrows #-} module Main where import Criterion.Main import qualified Automaton import qualified Baseline import qualified CoroutineLazy import qualified CoroutineStrict import qualified SignalLazy import qualified SignalStrict import qualified SignalExistential import qualified StreamLazy import qualified...
svenkeidel/stream-bench
bench/Main.hs
bsd-3-clause
1,108
0
13
199
219
119
100
29
1
{-# LANGUAGE TupleSections, OverloadedStrings #-} -- | home page module Handler.Home where import Import import Instagram -- | displays the login action getHomeR :: Handler RepHtml getHomeR = do -- get the redirect url render <- getUrlRender let igredirect = render RedirectR url<-runInstagramInYes...
prowdsponsor/ig-testapp
Handler/Home.hs
bsd-3-clause
524
0
12
139
98
49
49
14
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-directconnect/gen/Network/AWS/DirectConnect/CreatePublicVirtualInterface.hs
mpl-2.0
10,424
0
38
2,126
1,530
891
639
166
1
{-# LANGUAGE DeriveFunctor #-} -- | Strict, non-empty lists -- -- Intended for qualified import module Cardano.Wallet.Kernel.Util.StrictNonEmpty ( StrictNonEmpty(..) , singleton , head , (<|) , take , last , init , splitLast , prependList , toList ) where import Universum hiding ((:|...
input-output-hk/cardano-sl
wallet/src/Cardano/Wallet/Kernel/Util/StrictNonEmpty.hs
apache-2.0
2,731
1
11
654
954
516
438
-1
-1
-- Module : Foundation.Conduit.Internal -- License : BSD-style -- Maintainer : Foundation -- Stability : experimental -- Portability : portable -- -- Taken from the conduit package almost verbatim, and -- Copyright (c) 2012 Michael Snoyman -- {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LAN...
vincenthz/hs-foundation
foundation/Foundation/Conduit/Internal.hs
bsd-3-clause
14,865
0
27
4,540
4,974
2,527
2,447
-1
-1
-- |Runs the WebKit-Mozilla test suite with Rhino. This does not test WebBits. module MozSuite where import qualified Data.List as L import System.FilePath import System.Directory import Control.Monad import BrownPLT.Test import BrownPLT.JavaScript import qualified Data.ByteString.Char8 as B isTestCall :: Statement...
brownplt/webbits
tests/MozSuite.hs
bsd-3-clause
3,914
1
15
923
902
455
447
80
3
-- Copyright (c) 2015 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditi...
emc2/saltlang
src/salt/Language/Salt/Core/TypeCheck.hs
bsd-3-clause
9,663
8
14
2,521
1,527
811
716
118
4
{-# LANGUAGE CPP #-} -- | Functions for converting Core things to interface file things. module ToIface ( -- * Binders toIfaceTvBndr , toIfaceTvBndrs , toIfaceIdBndr , toIfaceBndr , toIfaceForAllBndr , toIfaceTyVarBinders , toIfaceTyVar -- * Types , toIfaceType , toIface...
olsner/ghc
compiler/iface/ToIface.hs
bsd-3-clause
22,307
0
15
6,460
4,887
2,465
2,422
345
6
module Turbinado.Server.StaticContent ( tryStaticContent ) where import Control.Concurrent import Control.Monad import Data.Maybe import System.FilePath import System.IO import System.Directory import Prelude hiding (catch) import Network.URI import Network.HTTP import Turbinado.Controller.Monad import Turbin...
alsonkemp/turbinado-website
Turbinado/Server/StaticContent.hs
bsd-3-clause
1,633
0
18
476
417
221
196
37
2
{- Copyright (C) 2006-7 John MacFarlane <jgm@berkeley.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is dis...
yxm4109/pandoc
src/Text/Pandoc/Writers/Docbook.hs
gpl-2.0
12,544
0
20
3,413
3,128
1,610
1,518
217
13
module Reflex.Spider ( Spider , SpiderHost (..) --Temporary, until Widget no longer uses unsafePerformIO ) where import Reflex.Spider.Internal
mightybyte/reflex
src/Reflex/Spider.hs
bsd-3-clause
186
0
5
61
25
17
8
3
0
{-# LANGUAGE Unsafe #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE UnboxedTuples #-} ----------------------------------------------------------------------------- -- | -- Module : Debug.Trace -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the...
ghc-android/ghc
libraries/base/Debug/Trace.hs
bsd-3-clause
9,300
0
17
1,870
918
537
381
80
1
import qualified Data.Vector as U import Data.Bits main = print . U.sum . U.repeat 10 $ U.replicate (10000000 :: Int) (5::Int)
dolio/vector
old-testsuite/microsuite/repeat.hs
bsd-3-clause
129
0
8
23
57
32
25
3
1
{-# LANGUAGE DuplicateRecordFields #-} module OverloadedRecFldsFail04_A (U(..), V(MkV, x), Unused(..), u) where data U = MkU { x :: Bool, y :: Bool } data V = MkV { x :: Int } data Unused = MkUnused { unused :: Bool } u = MkU False True
ezyang/ghc
testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail04_A.hs
bsd-3-clause
240
0
8
50
94
60
34
9
1
{-# LANGUAGE MagicHash, BangPatterns, UnboxedTuples #-} module ShouldCompile where import Data.Word import GHC.Ptr import GHC.Exts f# :: Int# -> (# Char#, Int# #) f# a# = (# '\0'#, a# #) g :: Int -> (Char, Int) g (I# a#) = ( C# c#, I# b# ) where !(# c#, b# #) = f# a#
urbanslug/ghc
testsuite/tests/deSugar/should_compile/ds057.hs
bsd-3-clause
274
0
8
60
105
58
47
10
1
-- This test exercises the "large block" allocation code in the -- scheduler, where the mutator requests more than a block's worth of -- memory. longlistof x = [ x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x, x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x, x,x,x,x,x...
urbanslug/ghc
testsuite/tests/codeGen/should_run/cgrun074.hs
bsd-3-clause
1,389
0
12
90
1,725
1,144
581
18
1
module Octobunce where import Octobunce.Types import Octobunce.Parser import Octobunce.Render
jshholland/octobunce
src/Octobunce.hs
mit
95
0
4
10
19
12
7
4
0
{-# htermination showSigned :: (Int -> (String -> String)) -> Int -> Int -> String -> String #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_showSigned_2.hs
mit
97
0
2
18
3
2
1
1
0
-- my solution myButLast :: [a] -> a myButLast a = last $ init a -- some answers from the website itself -- using simple function composition I guess myButLast' = last . init -- using recursion myButLast'' [x,_] = x myButLast'' (_:xs) = myButLast'' xs
queirozfcom/haskell-99-problems
problem2.hs
mit
258
0
7
52
73
40
33
5
1
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI, GHCForeignImportPrim, UnboxedTuples, MagicHash, UnliftedFFITypes, LambdaCase #-} module GHCJS.DOM.JSFFI.Navigator ( module Generated , js_getUserMedia , getUserMedia ) where import GHC.Base (IO(..)) import GHC.Prim (RealWorld, State#, ByteArray...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Navigator.hs
mit
1,741
9
15
267
397
225
172
-1
-1
module ParserUtils ( RList, rNil, rCons, rOne, list , ParseM, ParseError, happyError , mkTData , mkCaseAlt , mkLam, mkApp , mkGuard, mkBoolGuard , mkTTuple , mkLocalBind, mkTopBind ) where import AST import Lexer newtype RList a = RList [a] rCons :: RList a -> a -> RList a rCons (RList xs) x = RLi...
yav/lang
src/ParserUtils.hs
mit
3,870
0
15
1,213
1,521
763
758
98
13
{-# LANGUAGE RecordWildCards #-} module Bound where import qualified Data.Vector as V import Codec.Soten as Soten data BoundingBox = BoundingBox { sceneMin :: !(V3 Float) , sceneMax :: !(V3 Float) , sceneCenter :: !(V3 Float) } deriving Show boundingBox :: Scene -> BoundingBox boundingBox ...
triplepointfive/soten
viewer/src/Bound.hs
mit
1,447
0
12
387
549
294
255
37
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- Copyright (C) 2012 John Millikin <jmillikin@gmail.com> -- -- See license.txt for details module OptionsTests.Tokenize ( suite_Tokenize ) where import Test.Chell import Options.Types import Opti...
jmillikin/haskell-options
tests/OptionsTests/Tokenize.hs
mit
11,096
117
15
1,860
4,396
2,124
2,272
259
2
module Drawhub.Github ( GithubImage ( .. ), fitImage, imageToNbActivities ) where import Codec.Picture import Codec.Picture.Types import Control.Monad import Data.Foldable import Data.List import Data.Maybe import qualified Data.Set as Set import qualified Data.Vector as V import Drawhub.Image import D...
TurpIF/Drawhub
src/main/Drawhub/Github.hs
mit
3,162
0
12
650
1,084
559
525
80
6
{-# LANGUAGE OverloadedStrings #-} module SimpleApp (server) where import Data.Maybe import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Lazy.Char8 as L8 import Control.Monad import LIO import Hails.HttpServer import Hails.Database import ...
scslab/hails
examples/SimpleFullExample/SimpleApp.hs
mit
1,375
0
23
385
454
237
217
33
4
{-# LANGUAGE CPP #-} #ifndef MIN_VERSION_base #include "../dist/build/autogen/cabal_macros.h" #endif module Calico.Base ( -- * Basic types -- ** Maybe Data.Maybe.Maybe(..) , Data.Maybe.maybe , Data.Maybe.isJust , Data.Maybe.isNothing , Data.Maybe.fromMaybe , Data.Maybe.listToMaybe , Data.Maybe...
Rufflewind/calico-hs
Calico/Base.hs
mit
8,368
0
11
1,551
2,114
1,389
725
262
2
import System.IO import qualified Data.ByteString as B import Data.ByteString.Char8 (pack) import Data.Serialize import Text.Printf (printf) import Data.List as L import Control.Concurrent import Network.Socket hiding (recv, Stream) import qualified Network.Socket as NS import Network.Socket.ByteString (recv, sendAll) ...
blanu/Dust-tools
Dust/Services/Replay/ReplayClient.hs
gpl-2.0
2,653
0
18
677
806
399
407
67
5
-- Problem 37 -- (18.57 secs, 9,445,859,232 bytes) import Data.List (tails) primes = 2 : filter (null . tail . primeFactors) [3,5..] primeFactors n = factor n primes where factor n (p:ps) | p*p > n = [n] | n `mod` p == 0 = p : factor (n `div` p) (p:ps) | otherwise = fac...
synndicate/euler
solutions/e037.hs
gpl-3.0
770
0
12
200
314
161
153
15
1
{- This file is part of the Haskell Term Rewriting Library. The Haskell Term Rewriting Library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later...
mzini/termlib
Termlib/TermGraph.hs
gpl-3.0
12,744
0
21
4,690
3,652
1,876
1,776
209
5
module PropT43 where import Prelude(Bool(..)) import Zeno -- Definitions True && x = x _ && _ = False False || x = x _ || _ = True not True = False not False = True -- Nats data Nat = S Nat | Z (+) :: Nat -> Nat -> Nat Z + y = y (S x) + y = S (x + y) (*) :: Nat -> Nat -> Nat Z * _ = Z (S x) * y = y + (x...
danr/hipspec
testsuite/prod/zeno_version/PropT43.hs
gpl-3.0
3,013
0
11
923
2,023
1,057
966
114
2
module Utilities where import Prelude import Text.Read mightRead :: (Read r) => Maybe String -> Maybe r mightRead = (readMaybe =<<) -- vim:set expandtab:
tmcl/katalogo
backend/sqlite/Utilities.hs
gpl-3.0
157
0
7
27
46
27
19
5
1
{- - Copyright (C) 2014 Alexander Berntsen <alexander@plaimi.net> - - This file is part of coreutilhs. - - coreutilhs is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at y...
alexander-b/coreutilhs
echo.hs
gpl-3.0
875
0
6
155
39
23
16
4
1
{- ============================================================================ | Copyright 2011 Matthew D. Steele <mdsteele@alum.mit.edu> | | | | This file is part of Fallback. | ...
mdsteele/fallback
src/Fallback/Scenario/Triggers/Globals.hs
gpl-3.0
11,011
0
21
2,752
2,527
1,301
1,226
176
6
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} -- | This module defines a simple scoring scheme based on pairs of unigrams. module Linguistics.Scoring.SimpleParser where import Control.Applicative import Data.ByteString.Char8 (ByteString) import Data.Strict.Tuple impo...
choener/WordAlignment
_old/Scoring/SimpleParser.hs
gpl-3.0
3,634
0
34
1,027
1,065
582
483
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception import Control.Monad import Control.Monad.Except import qualified Data.Text as T import qualified Database.SQLite.Simple as SQLite import System.Environment (getArgs) import EstuaryServer(runServerWithDatabase) import Estuary.Types.Databas...
d0kt0r0/estuary
server/app/Main.hs
gpl-3.0
1,521
0
16
254
444
229
215
34
2
-- | Encapsulate RSCoin.Bank.Storage.* module RSCoin.Bank.Storage ( module Storage ) where import RSCoin.Bank.Storage.Queries as Storage import RSCoin.Bank.Storage.Storage as Storage (Storage, mkStorage) import RSCoin.Bank.Storage.Updates as Storage
input-output-hk/rscoin-haskell
src/RSCoin/Bank/Storage.hs
gpl-3.0
298
0
5
73
49
36
13
5
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-cloudkms/gen/Network/Google/Resource/CloudKMS/Projects/Locations/KeyRings/ImportJobs/TestIAMPermissions.hs
mpl-2.0
7,482
0
16
1,476
794
469
325
127
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-s3/gen/Network/AWS/S3/GetBucketLocation.hs
mpl-2.0
3,820
0
13
750
529
317
212
67
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Logs/List.hs
mpl-2.0
6,668
0
19
1,528
997
582
415
135
1
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright 2016, Julia Longtin (julial@turinglace.com) -- Released under the GNU AGPLV3+, see LICENSE -- FIXME: why are these needed? {-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses, FlexibleContexts #-} module Graphics.Implicit.Export....
krakrjak/ImplicitCAD
Graphics/Implicit/Export/RayTrace.hs
agpl-3.0
6,175
3
25
1,844
2,426
1,353
1,073
131
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Lib where import Data.IORef import Protolude ...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/monads/2020-06-daniel-brice-monad-state-io/src/Lib.hs
unlicense
2,339
0
13
510
551
282
269
-1
-1
--{-# LANGUAGE GeneralizedNewtypeDeriving #-} import Data.IORef (IORef, newIORef, readIORef, writeIORef) import System.IO.Unsafe (unsafePerformIO) newtype State s a = State { runState :: s -> (a,s) }; instance Functor (State s) where fmap f (State s) = State (\s' -> let (x,s'') = s s' ...
egaburov/funstuff
Haskell/monads/drand48.hs
apache-2.0
6,410
0
14
2,018
1,962
1,011
951
127
4
module Graaf ( Graph, Normal ) where class (Ord v) => Vertex v where (-~-) :: Graph -> v -> Graph (-*-) :: Graph -> v -> Graph vic :: v -> [v] deg :: v -> Int edges :: v -> [Edge] class (Vertex v, Graph g) => SEdge e (v,v) first :: e -> v second :: e -> v vert...
rafaelbfs/graaf
src/Graphs.hs
apache-2.0
535
15
8
218
246
134
112
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module Mdb.Serve.Video ( videoApp ) where import Blaze.ByteString.Builder (Builder, fromByteString) import Control.Monad (void) import Control.Monad.Catch (MonadMask) import Con...
waldheinz/mdb
src/lib/Mdb/Serve/Video.hs
apache-2.0
9,744
0
40
3,201
2,959
1,526
1,433
173
5
{- | Module : Bio.Motions.Types Description : Contains the definitions of common types used in the Motions project. License : Apache Stability : experimental Portability : unportable -} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveFunctor #-...
Motions/motions
src/Bio/Motions/Types.hs
apache-2.0
4,415
0
11
816
919
517
402
97
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} ------------------------------------------------------------------------------ module AttendeeDocument ( -- * Types AttendeeDocument (..) , columnOffsetsAttendeeDocument , ...
dmjio/openarms
src/OpenArms/Types/AttendeeDocument.hs
bsd-2-clause
871
0
7
180
74
49
25
21
0
module Card where import GameState import Mana -- Create a simple spell that works like an instant or a sorcery -- with a name, mana cost, and effect from playing. spell :: CardType -> String -> String -> Effect -> Card spell t name costStr effect = let cost = readMana costStr in Card name (Mana.colors cost) [] [...
mmachenry/final-fortune
src/Card.hs
bsd-2-clause
857
0
10
165
287
153
134
19
1
{-# LANGUAGE BangPatterns, CPP, MagicHash, Rank2Types, UnboxedTuples #-} {-# OPTIONS_GHC -fno-warn-orphans #-} #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif -- | -- Module : Data.Text -- Copyright : (c) 2009, 2010, 2011, 2012 Bryan O'Sullivan, -- (c) 2009 Duncan Coutts, -- ...
ekmett/text
Data/Text.hs
bsd-2-clause
56,643
2
18
13,441
10,089
5,561
4,528
751
3
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception import Control.Lens hiding (argument) import Control.Monad import Data.Aeson import qualified Data.ByteString.Lazy.Char8 as BL import qualified Data.Map as Map import Data.Maybe (fromMaybe) import qualified Data.Text as T import qualified Da...
relrod/rhelsearch
src/Main.hs
bsd-2-clause
7,191
0
18
2,040
1,861
940
921
180
4
{-# LANGUAGE TypeFamilies #-} module Control.Monad.Invert ( -- * Typeclass MonadInvertIO (..) -- * Exceptions , finally , catch , block , unblock , bracket , bracket_ , onException -- * Memory allocation , alloca , allocaBytes , withForeignPtr ) where i...
snoyberg/neither
Control/Monad/Invert.hs
bsd-2-clause
4,872
0
16
1,108
1,863
971
892
103
1
{-# LANGUAGE NoImplicitPrelude #-} module Control.Applicative.LApplicative ( LApplicative(..), (<**>), liftA, liftA2, liftA3, forever ) where import Data.Functor.LFunctor (LFunctor(), (<$>), (<$)) import Data.Linear (($), id, liftUnit, flip) import Data.Functor.Identity class LFunctor f => LApplicative f...
m0ar/safe-streaming
src/Control/Applicative/LApplicative.hs
bsd-3-clause
1,195
0
10
296
581
307
274
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Protocol.ROC.PointTypes.PointType13 where import Data.Binary.Get (getWord8,Get) import Data.Word (Word8) import Prelude (($), return, Bool, Eq, R...
plow-technologies/roc-translator
src/Protocol/ROC/PointTypes/PointType13.hs
bsd-3-clause
6,796
0
9
2,071
818
453
365
179
1
module Parser where import Ast import Control.Applicative hiding ((<|>), many) import Text.Parsec hiding (token) import Text.Parsec.String import Text.Parsec.Combinator import Text.Parsec.Char parse :: String -> Either ParseError Prog parse program = Text.Parsec.parse prog "" program tokenList :: Parser String toke...
wass80/CoCaml
src/Parser.hs
bsd-3-clause
1,818
0
11
428
802
387
415
74
1
import Control.Monad import Control.Monad.Random import Control.Monad.State import Control.Monad.Writer import Data.Array import UI.HSCurses.Curses import HaskellRoguelike.Action import HaskellRoguelike.Entity import HaskellRoguelike.Level import HaskellRoguelike.State import HaskellRoguelike.Symbol main :: IO () ma...
jameseb7/haskell-roguelike
HaskellRL.hs
bsd-3-clause
5,678
0
17
2,427
1,652
796
856
-1
-1
{-# LANGUAGE ImplicitParams, RecordWildCards #-} module Abstract.AbsRelation (RelInst, instantiateRelation) where import Debug.Trace import Ops import Internal.IRelation import Abstract.Predicate import Internal.IExpr import Internal.ISpec import Abstract.MkPredicate type RelInst = (Predicate, [...
termite2/tsl
Abstract/AbsRelation.hs
bsd-3-clause
1,953
0
14
703
622
323
299
34
13
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving#-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Undeci...
harendra-kumar/asyncly
src/Streamly/Streams/Ahead.hs
bsd-3-clause
28,405
0
25
8,458
4,542
2,366
2,176
-1
-1
-- {-# LANGUAGE FlexibleInstances #-} -- {-# LANGUAGE RankNTypes #-} module EFA2.Topology.Topology2 where import qualified Data.Map as M import qualified Data.List as L import EFA2.Signal.Index as Idx import EFA2.Topology.EfaGraph as Gr import EFA2.Topology.TopologyData (SequFlowGraph) import EFA2.Solver.Equation i...
energyflowanalysis/efa-2.1
attic/src/EFA2/Topology/Topology2.hs
bsd-3-clause
6,467
0
15
1,572
2,694
1,395
1,299
155
4
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeSynonymInstances #-} module Language.Haskell.Liquid.Bare.Resolve ( Resolvable(..) ) where import Prelude hiding (error) import Control.Monad.State import Data.Char (isUpper) import Text...
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Bare/Resolve.hs
bsd-3-clause
4,519
0
18
1,487
1,815
910
905
95
1
module Game( Game, newGame ) where import Character import GameMap data Game = Game { player :: Character, gameMap :: [Tile] } deriving (Show) newGame :: Character -> [Tile] -> Game newGame c ts = Game c ts
WilliamJohnathonLea/my-haskell-game
src/Game.hs
bsd-3-clause
218
0
9
49
80
47
33
11
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.APPLE.YCbCr422 -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/APPLE/YCbCr422.hs
bsd-3-clause
705
0
4
84
43
35
8
5
0
import System.Environment import Data.List -- | Flatten out the args into a string flatten :: [[a]] -> [a] flatten [] = [] flatten (x:xs) = x ++ flatten xs main = do (file:rest) <- getArgs appendFile file $ flatten (intersperse " " rest) appendFile file "\n"
natepisarski/kast
modules/logger.hs
bsd-3-clause
267
0
10
54
112
57
55
9
1
module HsExpStruct where import SrcLoc1 import HsIdent import HsLiteral import HsGuardsStruct(HsAlt) import HsFieldsStruct import Data.Generics -------- Expressions -------------------------------------------------------- data EI i e p ds t c = HsId (HsIdentI i) -- collapsing HsVar and HsCon | HsLit SrcLoc ...
forste/haReFork
tools/base/AST/HsExpStruct.hs
bsd-3-clause
3,404
0
10
1,333
1,277
631
646
69
0
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE StandaloneDeriving #-} -- This module should be rewritten to use PP combinators! module FunVM.Core.Pretty (pretty) where import FunVM.Core.Syntax import Data.List class Pretty a where pr :: ShowS -> a -> ShowS pretty :: (Pretty a) => a -> String pretty x = p...
tomlokhorst/FunVM
src/FunVM/Core/Pretty.hs
bsd-3-clause
4,690
0
20
1,666
2,218
1,090
1,128
107
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} import Text.Language.Closure import Data.Text.Encoding as E import qualified Data.Map as M import qualified Data.Text as T import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import Data.Aeson( ToJSON(..), encode...
Twinside/ClosureExternalProducer
clos_test.hs
bsd-3-clause
3,584
0
13
1,097
961
555
406
96
1
{-# LANGUAGE TupleSections #-} module Reactive.Bacon.EventStream.Timed where import Reactive.Bacon.Core import Reactive.Bacon.EventStream.IO import Reactive.Bacon.EventStream.Monadic import System.Time import Control.Concurrent(threadDelay, forkIO) import Control.Monad(void, unless) import Data.IORef laterE :: TimeDi...
raimohanska/reactive-bacon
src/Reactive/Bacon/EventStream/Timed.hs
bsd-3-clause
1,902
0
14
400
711
370
341
39
2
{-# LANGUAGE RankNTypes, TypeFamilies, PackageImports #-} module Text.Papillon.Papillon ( ParseError, mkParseError, peCode, peMessage, peComment, peDerivs, peReading, pePosition, pePositionS, Pos(..), Source(..), SourceList(..), ListPos(..), runError) where import Control.Monad.Trans.Error (Error(..)) imp...
YoshikuniJujo/papillon
src/Text/Papillon/Papillon.hs
bsd-3-clause
2,560
28
14
760
889
500
389
69
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module VForth.ItemSpec where import qualified Data.Text as T import Data.Text.Arbitrary import TextShow import Data.Char (isSpace) import Test.Hspec import Data.Monoid ((<>)) import Test.QuickCheck import VForth import VForth.GameTextSpec newtype T...
budgefeeney/ventureforth
chap6/test/VForth/ItemSpec.hs
bsd-3-clause
1,846
0
19
377
478
255
223
43
1
{------------------------------------------------------------------------------ Control.Monad.Operational Example: An implementation of the game TicTacToe. Each player (human, AI, ...) is implemented in a separate monad which are then intermingled to run the game. This resembles the Po...
HeinrichApfelmus/operational
doc/examples/TicTacToe.hs
bsd-3-clause
5,781
0
16
1,547
1,432
737
695
89
4
{-# OPTIONS_GHC -fno-warn-dodgy-exports #-} module OpenCV ( module OpenCV.Calib3d , module OpenCV.Core.ArrayOps , module OpenCV.Core.Types , module OpenCV.Core.Types.Mat , module OpenCV.Core.Types.Mat.HMat , module OpenCV.Core.Types.Mat.Repa , module OpenCV.Core.Types.Matx , module OpenCV.Core.Types.Po...
lukexi/haskell-opencv
src/OpenCV.hs
bsd-3-clause
1,902
0
5
216
361
250
111
56
0
{-# OPTIONS -Wall #-} {- @author: Wojciech Jedynak (wjedynak@gmail.com) -} module Data.SGF.Parsing.Tests where -------------------------- -- Testing frameworks -- -------------------------- import Data.Char import Data.Maybe import Test.Framework (testGroup, Test) import Test.Framework.Providers.HUnit (testCase)...
wjzz/GoStat
test/Data/SGF/Parsing/Tests.hs
bsd-3-clause
3,620
0
12
878
785
439
346
58
1
module System.Build.Access.Sourcetab where class Sourcetab r where sourcetab :: Maybe Int -> r -> r getSourcetab :: r -> Maybe Int
tonymorris/lastik
System/Build/Access/Sourcetab.hs
bsd-3-clause
162
0
8
52
45
24
21
9
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE Trustworthy #-} module Sigym4.Units.Accelerate.Prelude ( recip , (/) , (*) , negate , (+) , (-) , abs , signum , sqrt , (**) , exp, log, s...
meteogrid/sigym4-units-accelerate
src/Sigym4/Units/Accelerate/Prelude.hs
bsd-3-clause
7,232
4
14
1,542
2,657
1,434
1,223
-1
-1
{-# LANGUAGE PackageImports #-} import "dot-race" Application (develMain) import Prelude (IO) main :: IO () main = develMain
lubomir/dot-race
app/devel.hs
bsd-3-clause
126
0
6
19
34
20
14
5
1
module Game.Pal (module Exports) where import Game.Pal.Hands as Exports import Game.Pal.Movement as Exports import Game.Pal.Types as Exports import Game.Pal.View as Exports import Game.Pal.Window as Exports
cabbibo/loom-haskell
src/Game/Pal.hs
bsd-3-clause
220
0
4
38
52
38
14
6
0
-- | A simple example of using the fundamental DOM operations. {-# LANGUAGE EmptyDataDecls #-} module Demo.DOM where import Language.Fay.FFI import Language.Fay.Prelude import Language.Fay.DOM main :: Fay () main = addEventListener "load" printBody False printBody :: Fay () printBody = do result <- documentGe...
faylang/fay-server
modules/project/Demo/DOM.hs
bsd-3-clause
647
0
9
100
169
88
81
17
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module GitLab.Types ( -- * @GitLabT@ monad transformer module GitLab.Monad -- * Projects , Project(..) , ProjectId , Names...
maoe/gitlab
src/GitLab/Types.hs
bsd-3-clause
15,543
72
13
2,703
3,484
2,041
1,443
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Bamboo.Theme.Blueprint.Widget.SearchBar where import Bamboo.Helper.StateHelper (html_only_for) import Bamboo.Theme.Blueprint.Env hiding (header) search_bar :: Widget search_bar s = html_only_for Search $ div_id "search" << form ! [action (s.env.slashed_script_nam...
nfjinjing/bamboo-theme-blueprint
src/Bamboo/Theme/Blueprint/Widget/SearchBar.hs
bsd-3-clause
382
0
13
60
99
56
43
10
1
{-# LANGUAGE OverloadedStrings #-} module SonaattiMenu ( findMenu , findMenus ) where import Control.Lens import Data.List import Data.Maybe import Data.Text (Text) import Network.Wreq import Text.XML.Light import qualified Data.Text as T import qualified Data.String.Conversions as C type Menu = (Text,Text) --...
Lepovirta/SonaattiMenu
src/SonaattiMenu.hs
bsd-3-clause
2,056
0
15
487
733
382
351
54
2
{-# Language OverloadedStrings #-} {-| Module : Client.View.RtsStats Description : View current GHC RTS statistics Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com Lines for the @/rtsstats@ command. -} module Client.View.RtsStats ( rtsStatsLines ) where import ...
glguy/irc-core
src/Client/View/RtsStats.hs
isc
1,140
1
13
266
279
146
133
18
1
-- -- -- ------------------ -- Exercise 11.17. ------------------ -- -- -- module E'11'17 where curry3 :: ( (a , b , c) -> d ) -> a -> b -> c -> d curry3 f a b c = f (a , b , c) uncurry3 :: (a -> b -> c -> d) -> ( (a , b , c) -> d ) uncurry3 f (a , b , c) = f a b c {- GHCi> -- Note: Chapter 3> cabal inst...
pascal-knodel/haskell-craft
_/links/E'11'17.hs
mit
1,945
0
11
512
507
302
205
19
1
data Apply f a = Apply (f a) type Compose f g a = f (g a) type Flip f x y = f y x data HFix f a = HIn (f (HFix f) a) data Fix a = In (a (Fix a)) data Tree a = Node (Tree a) (Tree a) | Leaf a type Parser symbol result = [symbol] -> [(result,[symbol])] data RoseTree a = RoseTree a [RoseTree a] data GRoseTree f ...
roberth/uu-helium
test/kinderrors/KindCorrect2.hs
gpl-3.0
384
0
10
99
207
120
87
10
0
{-# LANGUAGE OverloadedStrings #-} module Watch ( WatchPred(..) , Watch(..) , emptyWatch , watchOnce , watchForever ) where import Prelude hiding (FilePath) import Control.Concurrent.Chan hiding (isEmptyChan) import Control.Exception.Lifted import Control.Monad.Reader import Control.Monad.Trans.Control i...
ktvoelker/robin
src/Watch.hs
gpl-3.0
2,538
4
16
524
1,003
515
488
-1
-1
{-# LANGUAGE QuasiQuotes, OverloadedStrings, TemplateHaskell #-} {-# LANGUAGE CPP #-} module Handler.Profile ( getProfileR , postProfileR , postDeleteAccountR , postSkillsR , postDeleteIdentR , postRequestRealR , postRequestRealPicR , postRequestUnblockR , postRequestSkillR , pos...
danse/haskellers
tests/Handler/Profile.hs
bsd-2-clause
11,489
0
26
3,501
2,979
1,457
1,522
-1
-1
{-# language CPP #-} {-# language QuasiQuotes #-} {-# language InstanceSigs #-} {-# language ConstraintKinds #-} {-# language TemplateHaskell #-} {-# language UndecidableInstances #-} {-# language MultiParamTypeClasses #-} {-# language ExistentialQuantification #-} #if __GLASGOW_HASKELL__ >= 800 {-# options_ghc -Wno-r...
lukexi/haskell-opencv
src/OpenCV/Core/Types/Mat/Repa.hs
bsd-3-clause
6,409
51
23
1,533
1,544
859
685
-1
-1
module Data.Attoparsec.Final.Parser.ByteString where import qualified Data.Attoparsec.ByteString as ABS import qualified Data.Attoparsec.ByteString.Char8 as BC import Data.Attoparsec.Final.IsChar import Data.Attoparsec.Final.Parser.Internal import Data.ByteString (ByteSt...
haskell-works/data-json-tokenize
src/Data/Attoparsec/Final/Parser/ByteString.hs
bsd-3-clause
554
0
7
115
124
80
44
15
0
-- Module : Network.AWS.ElastiCache -- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you...
romanb/amazonka
amazonka-elasticache/gen/Network/AWS/ElastiCache.hs
mpl-2.0
5,833
0
5
610
615
456
159
79
0