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
module Main where import System.Environment import Text.ParserCombinators.Parsec hiding (spaces) import Control.Monad import Control.Monad.Error data LispVal = Atom String | List [LispVal] | DottedList [LispVal] LispVal | Number Integer | String String |...
lifengsun/haskell-exercise
scheme/05/conditionalparser.hs
gpl-3.0
6,880
0
12
2,111
2,227
1,146
1,081
174
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-proximitybeacon/gen/Network/Google/Resource/ProximityBeacon/Beacons/Update.hs
mpl-2.0
6,826
0
17
1,470
879
521
358
120
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Disks/AggregatedList.hs
mpl-2.0
8,021
0
20
1,744
842
503
339
121
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-plus/gen/Network/Google/Resource/Plus/People/List.hs
mpl-2.0
4,452
0
17
1,057
639
376
263
92
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/TargetPools/SetBackup.hs
mpl-2.0
5,765
0
20
1,368
735
432
303
113
1
-- -- Copyright 2017-2018 Azad Bolour -- Licensed under GNU Affero General Public License v3.0 - -- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md -- module Bolour.Util.HttpUtil ( mkHttpHeader , defaultOptionsHeaders ) where import qualified Data.CaseInsensitive as CI import qualified Data.B...
azadbolour/boardgame
haskell-server/src/Bolour/Util/HttpUtil.hs
agpl-3.0
1,274
0
8
176
203
129
74
18
1
-- Copyright 2011 The Text.XHtml Authors. -- -- Licensed under the Apache License, Version 2.0 (the "License"); you may not -- use this file except in compliance with the License. You may obtain a copy -- of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law ...
robinbb/hs-text-xhtml
Text/XHtml/Table.hs
apache-2.0
4,193
0
16
1,077
898
507
391
60
1
pot x y = if y > 0 then x * ( pot x (y-1) ) else 1
WillianLauber/haskell
pot.hs
apache-2.0
54
4
10
21
46
24
22
2
2
module Lab4 where import SetOrd import Data.List import System.Random import Test.Hspec import Test.QuickCheck -- run all using runAll = do runallTestEx4 runallTestEx5 main runallTestEx7 {- Ex.3 - Random set generation (0.5 hour) -} getRandomSet :: IO () getRandomSet =...
bartolkaruza/software-testing-2014-group-W1
week4/week4-exercises.hs
apache-2.0
8,226
24
19
2,073
3,099
1,616
1,483
131
3
module Valuable where import Prelude data Value = Min | Value Integer | Max deriving (Show, Ord, Eq) class Valuable a where value :: a -> Value
MichaelBaker/haskell-tictactoe
src/Valuable.hs
bsd-2-clause
149
0
7
32
55
31
24
5
0
-- | Program to replace HTML tags by whitespace -- -- This program was originally contributed by Petr Prokhorenkov. -- -- Tested in this benchmark: -- -- * Reading the file -- -- * Replacing text between HTML tags (<>) with whitespace -- -- * Writing back to a handle -- {-# OPTIONS_GHC -fspec-constr-count=5 #-} module ...
bgamari/text
benchmarks/haskell/Benchmarks/Programs/StripTags.hs
bsd-2-clause
1,493
0
13
328
461
255
206
32
3
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Applicative hiding (Alternative(..), many) import Control.Monad.State.Strict import Control.Exception hiding (try) import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe import Data.List import Data.Int import Data.Word import Data...
remiturk/libffi
examples/CCall.hs
bsd-2-clause
6,166
0
25
2,584
2,082
1,013
1,069
158
19
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 \section[PatSyn]{@PatSyn@: Pattern synonyms} -} {-# LANGUAGE CPP #-} module PatSyn ( -- * Main data types PatSyn, mkPatSyn, -- ** Type deconstruction patSynName, patSynArity, patSynIsInfix, ...
sdiehl/ghc
compiler/basicTypes/PatSyn.hs
bsd-3-clause
17,020
0
14
5,156
1,533
917
616
142
2
module Control.Concurrent.Latch where import Control.Concurrent.MVar import Control.Monad newtype Latch = Latch (MVar ()) newLatch :: IO Latch newLatch = do mvar <- newEmptyMVar return $ Latch mvar tripLatch :: Latch -> IO () tripLatch (Latch mvar) = void $ tryPutMVar mvar () awaitLatch :: Latch -> IO () a...
derekjw/haskell-future
test/Control/Concurrent/Latch.hs
bsd-3-clause
359
0
8
67
134
69
65
12
1
-- | This module contains the abstract syntax tree for the MiniJava language -- used in the compiler module Espresso.AST where newtype MJIdentifier = MJIdentifier String deriving (Show, Eq) data MJStatement = MJStatement deriving (Show, Eq) -- | The datatype for an expressi...
helino/espresso
src/Espresso/AST.hs
bsd-3-clause
447
0
7
121
73
43
30
7
0
module Main where import Foreign import Foreign.C.Types import Foreign.C.String foreign import ccall "SSLeay_version" ssleay_version :: Int -> CString main = do str <- peekCString(ssleay_version(0)) putStrLn str
Chilledheart/ch_utils
utils/ssleay/haskell/ssleay_test.hs
bsd-3-clause
227
0
11
41
65
36
29
8
1
module Main where import Tutorial.Chapter10.Martian (run) import ALife.Creatur.Daemon (CreaturDaemon(..), Job(..), simpleDaemon, launch) import ALife.Creatur.Universe (mkSimpleUniverse) import ALife.Creatur.Task (simpleJob, runInteractingAgents, doNothing) import System.Directory (canonicalizePath) main :: IO () ...
mhwombat/creatur-examples
src/Tutorial/Chapter10/Daemon.hs
bsd-3-clause
586
0
12
95
171
97
74
16
1
-- This is a cut-down version of GHC's Exception module -- -- The main difference is that Hugs does not throw asynchronous -- exceptions, in particular heap and stack overflow and ctrl-C. -- Indeed, it is not entirely clear what to do in response to ctrl-C. module Hugs.Exception( SomeException(..), IOExceptio...
FranklinChen/Hugs
libraries/hugsbase/Hugs/Exception.hs
bsd-3-clause
983
14
9
161
157
97
60
14
1
{-# LANGUAGE OverloadedStrings #-} module SHA ( tests -- :: Int -> Tests ) where import Data.ByteString (ByteString) import qualified Data.ByteString as S import Data.ByteString.Base16 import Crypto.Hash.SHA import Test.QuickCheck import U...
thoughtpolice/hs-nacl
tests/SHA.hs
bsd-3-clause
1,781
0
10
404
378
209
169
40
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} module Afftrack.API.Brand.Offers ( Offer(..) , addBrowserLanguageBlocked , addOfferBlacklist , addOfferBrowserLanguageAllowed , addOfferCategory...
kelecorix/api-afftrack
src/Afftrack/API/Brand/Offers.hs
bsd-3-clause
22,798
0
9
6,870
5,290
2,764
2,526
569
1
module Network.API.TLDR.Types ( Domain(..), Creator(..), Language(..), Editor(..), TLDR(..), Category(..), ...
joshrotenberg/tldrio-hs
Network/API/TLDR/Types.hs
bsd-3-clause
677
0
5
378
119
86
33
16
0
{-| Module: SmartConstructor Copyright: (c) 2015 Frerich Raabe License: BSD3 Maintainer: [email protected] Stability: experimental This module exposes a 'makeSmartCtor' function which automatically creates smart constructors for custom newtype'd Haskell types. See <http://wiki.haskel...
frerich/smartconstructor
src/SmartConstructor.hs
bsd-3-clause
5,152
0
18
1,189
812
424
388
54
5
{-#LANGUAGE BangPatterns, RankNTypes #-} module Control.FoldM ( -- * Fold Types Fold(..) , FoldM(..) -- * Folding , fold , foldM , scan -- * Stock Pure Folds , Control.FoldM.mconcat , Control.FoldM.foldMap , head , last , lastDef , lastN , null , leng...
michaelt/foldm
src/Control/FoldM.hs
bsd-3-clause
8,542
0
9
1,983
2,254
1,247
1,007
182
1
module Data.OrdPSQ.Tests ( tests ) where import Prelude hiding (lookup) import Data.List (isInfixOf) import Test.Framework (Test) import Test.Framework.Providers.HUnit (testCase) import Test.Framework.Prov...
ariep/psqueues
tests/Data/OrdPSQ/Tests.hs
bsd-3-clause
4,787
0
11
1,108
1,345
704
641
77
3
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Flat import Flat.Repr import Flat.Decoder import Data.List (foldl') import qualified Data.ByteString as B import qualified ListT as L -- Big is a type that has a small encoded representation but a very large in-memory footprint. -- It is a very large byte...
tittoassini/flat
test/FlatRepr.hs
bsd-3-clause
1,986
0
14
441
489
244
245
41
1
{-# LANGUAGE DeriveGeneric #-} module Message where ------------------------------------------------------------------------------ import qualified Data.Aeson as A import GHC.Generics ------------------------------------------------------------------------------ import Model import Brows...
CBMM/CBaaS
cbaas-lib/src/Message.hs
bsd-3-clause
2,911
0
8
1,063
245
149
96
27
0
module Msum1 ( msum1 ) where import Control.Monad msum1 :: MonadPlus m => [m a] -> m a msum1 = foldl1 mplus
YoshikuniJujo/papillon
test/monadPlus/Msum1.hs
bsd-3-clause
111
2
8
25
49
26
23
5
1
module Language.JavaScript.Parser ( PA.parse , PA.readJs , PA.parseFile , PA.showStripped , PA.showStrippedMaybe , JSNode(..) , SrcSpan(..) , AlexSpan(..) , Node(..) , ParseError(..) -- Source locations , AlexPosn(..) --...
thdtjsdn/language-javascript
src/Language/JavaScript/Parser.hs
bsd-3-clause
628
0
5
177
127
89
38
20
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiWayIf #-} module QCommon.MSG where import Control.Lens (ASetter', Traversal', Lens', (.=), use, (^.), (+=), (%=)) import Control.Monad (when, liftM, unless) import Data.Bits ((.&.), shiftR, shiftL, (.|...
ksaveljev/hake-2
src/QCommon/MSG.hs
bsd-3-clause
20,775
0
27
5,235
6,831
3,500
3,331
-1
-1
module AERN2.Linear.Vector.Type where import Control.Monad.ST import Data.STRef import MixedTypesNumPrelude hiding (length) import qualified Data.Vector as V import qualified Data.Vector.Generic.Mutable as M import AERN2.MP.Precision import AERN2.MP.Ball import qualified Prelude as P type (Vector a) = V.Vector a (++...
michalkonecny/aern2
aern2-mfun/src/AERN2/Linear/Vector/Type.hs
bsd-3-clause
4,102
0
17
1,427
1,727
887
840
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} module Api.Invoice.Comment (resource) where import Control.Concurrent.STM (atomically, modifyTVar', readTVar) import Control.Monad.Reader import Control.Monad.Trans.Error import Data.List import Data.Monoid import Data.Ord import Data.Time import qualified Data.HashMap.Strict as H ...
tinkerthaler/basic-invoice-rest
example-api/Api/Invoice/Comment.hs
bsd-3-clause
2,196
0
17
389
669
361
308
54
1
import Foreign main = do print $ map f [0..255] test :: String test = unlines $ "case x of" : do i <- [0x00..0xff :: Word8] return $ show i ++ " -> " ++ show (show i) f :: Word8 -> String f x = case x of 0 -> "0" 1 -> "1" 2 -> "2" 3 -> "3" 4 -> "4" 5 -> "5" 6 -> "6" 7 -> "7" 8 -> "...
meiersi/blaze-binary
src/Codec/MsgPack/CaseDist.hs
bsd-3-clause
3,868
0
11
1,359
1,649
825
824
267
257
{-# LANGUAGE CPP #-} #if !defined(TESTING) && __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Data.IntMap -- Copyright : (c) Daan Leijen 2002 -- (c) Andriy Palamarchuk 2008 -- License ...
ekmett/containers
Data/IntMap.hs
bsd-3-clause
4,742
0
12
914
564
330
234
30
3
-- negative number should be enclosed by parentheses (-3) for example elementAt :: (Num a, Ord a) => [t] -> a -> t elementAt (x:xs) 1 = x elementAt [] _ = error "Index out of range" elementAt (x:xs) k | k < 1 = error "Index out of range" | otherwise = elementAt xs (k - 1)
m00nlight/99-problems
haskell/p-03.hs
bsd-3-clause
281
0
8
66
116
58
58
6
1
{-# LANGUAGE OverloadedStrings #-} module Handler.GithubEvent where import Import import Data.Text (pack, append) import Data.Text.Encoding (decodeLatin1) import Data.Time (UTCTime) import Github.Data.Definitions ( Error(..) , PullRequestEvent(..) , PingEvent(..) , DetailedPullRequest(..) , PullR...
cpennington/reviewhub
Handler/GithubEvent.hs
bsd-3-clause
3,286
0
12
834
587
316
271
59
4
{-# LANGUAGE OverloadedStrings #-} module Editor (editor,ide,emptyIDE) where import Data.Monoid (mempty) import Text.Blaze.Html import Text.Blaze.Html5 ((!)) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Network.HTTP.Base (urlEncode) import qualified System.FilePath as...
thSoft/elm-lang.org
server/Editor.hs
bsd-3-clause
5,886
0
21
1,850
1,495
744
751
123
1
{-# LANGUAGE OverloadedStrings #-} module Lazyfoo.Lesson08 (main) where import Control.Applicative import Control.Monad import Data.Foldable (for_) import Foreign.C.Types import Linear import Linear.Affine import SDL (($=)) import qualified SDL screenWidth, screenHeight :: CInt (screenWidth, screenHeight) = (640, 480...
svenkeidel/sdl2
examples/lazyfoo/Lesson08.hs
bsd-3-clause
2,609
0
21
717
816
416
400
61
2
{-# LANGUAGE CPP #-} module Bead.Persistence.SQL.Comment where import Data.Maybe import Database.Persist.Sql import qualified Bead.Domain.Entities as Domain import qualified Bead.Domain.Relationships as Domain import qualified Bead.Domain.Shared.Evaluation as Domain import Bead.Persiste...
pgj/bead
src/Bead/Persistence/SQL/Comment.hs
bsd-3-clause
2,928
0
17
797
672
342
330
28
1
{-# LANGUAGE FlexibleContexts #-} -- | -- Module: Data.JSON.Schema.Generator -- Copyright: (c) 2015 Shohei Murayama -- License: BSD3 -- Maintainer: Shohei Murayama <[email protected]> -- Stability: experimental -- -- A generator for JSON Schemas from ADT. -- module Data.JSON.Schema.Generator ( ...
yuga/jsonschema-gen
src/Data/JSON/Schema/Generator.hs
bsd-3-clause
2,988
0
9
686
346
243
103
35
1
-- | This module provides an interface to \complexity pair combinators\. -- A complexity pair is a special subset of processors that return a complexity pair proof. -- A complexity pair combinator is a processor that takes a complexity pair as argument. module Tct.Trs.Data.ComplexityPair ( ComplexityPair (..) ,...
ComputationWithBoundedResources/tct-trs
src/Tct/Trs/Data/ComplexityPair.hs
bsd-3-clause
1,973
0
12
365
396
229
167
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Deviser.Evaluator ( eval , expand , primEnv ) where import Data.Monoid ((<>)) import Control.Monad.Except import Control.Monad.Reader import qualified Data.Map as Map import qualified Data.Text as T import Deviser.Types -- List Primi...
henrytill/deviser
src/Deviser/Evaluator.hs
bsd-3-clause
13,427
0
17
3,767
5,378
2,695
2,683
295
4
{-# LANGUAGE GeneralizedNewtypeDeriving , DeriveFunctor , DeriveFoldable , DeriveTraversable , DeriveGeneric , DeriveDataTypeable , MultiParamTypeClasses , FlexibleInstances , FlexibleContexts , UndecidableInstances , TypeFamilies , TupleSections #-} module Data.Trie.HashMap where import D...
athanclark/tries
src/Data/Trie/HashMap.hs
bsd-3-clause
7,405
0
19
2,275
2,642
1,368
1,274
180
4
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances #-} module Homework7.Sized where import Data.Monoid newtype Size = Size Int deriving (Eq, Ord, Show, Num) getSize :: Size -> Int getSize (Size i) = i class Sized a where size :: a -> Size instance Sized Size where size = id -- This instance means th...
gabluc/CIS194-Solutions
src/Homework7/Sized.hs
bsd-3-clause
537
0
7
117
151
85
66
16
1
{-| Module : Client.Image.Layout Description : Layout code for the multi-window splits Copyright : (c) Eric Mertens, 2016 License : ISC Maintainer : [email protected] -} module Client.Image.Layout (scrollAmount, drawLayout) where import Control.Lens import Client.State import Client.State.Focus import Cl...
glguy/irc-core
src/Client/Image/Layout.hs
isc
6,743
0
15
1,997
1,650
906
744
133
3
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE QuasiQuotes #-} module Tests.KFoldApproximation ( kApproximationTests ) where import qualified Data.Map as M import Data.Monoid import Data.Word import qualified Distribution.TestSuite as TS import Test.Quick...
diku-kmc/repg
test/Tests/KFoldApproximation.hs
mit
2,140
0
17
601
584
321
263
41
1
module WeiXin.PublicPlatform.QRCode where -- {{{1 imports import ClassyPrelude import Network.Wreq import qualified Network.Wreq.Session as WS import Control.Lens hiding ((.=)) #if !MIN_VERSION_base(4, 13, 0) import Control.Monad.Reader (asks) #endif import Data.Aeson import Data.Aeson.Types ...
yoo-e/weixin-mp-sdk
WeiXin/PublicPlatform/QRCode.hs
mit
2,683
0
16
797
527
293
234
54
2
-- -- -- ------------------ -- Exercise 11.26. ------------------ -- -- -- module E'11'26 where -- Note: Use/See templates for proofs by extensionality. -- --------------- -- 1. Proposition: -- --------------- -- -- id . f = f -- -- -- Proof By Extensionality: -- ------------------------ -- -- (id . f) x...
pascal-knodel/haskell-craft
_/links/E'11'26.hs
mit
378
0
2
90
30
29
1
1
0
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP, OverloadedStrings, GeneralizedNewtypeDeriving #-} {- Copyright (C) 2009-2014 John MacFarlane <[email protected]> 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 Fr...
peter-fogg/pardoc
src/Text/Pandoc/Templates.hs
gpl-2.0
11,546
0
19
3,030
2,664
1,359
1,305
196
10
module Hilbert.Derivation ( Derivation , derive , example ) where import Hilbert.Env import Hilbert.Actions import Autolib.ToDoc import Autolib.Reader import Autolib.Reporter import Autolib.FiniteMap import Autolib.TES.Identifier import Autolib.TES import Autolib.Size import Data.Typeable data Derivation = D...
florianpilz/autotool
src/Hilbert/Derivation.hs
gpl-2.0
1,226
26
12
360
271
170
101
43
1
{- | Module : ./Temporal/ModalCaslToNuSmvLtl.hs Copyright : (c) Klaus Hartke, Uni Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : experimental Portability : portable -} module ModalCaslToNuSmvLtl where import Control.Monad as Monad import ...
spechub/Hets
Temporal/ModalCaslToNuSmvLtl.hs
gpl-2.0
3,647
0
13
937
1,267
648
619
52
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 #-} -- ...
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/DeleteSigningCertificate.hs
mpl-2.0
4,056
0
11
780
450
274
176
64
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeKeyPairs.hs
mpl-2.0
4,315
0
10
903
582
356
226
64
1
{-| This module contains utilities related to the @Either@ type. -} module Language.K3.Utils.Either ( gatherParallelErrors ) where import Data.Either import Data.Monoid -- |Using @Either@ as a mechanism for error handling, perform numerous -- computations concurrently. Error terms must be monoidal and thus are --...
DaMSL/K3
src/Language/K3/Utils/Either.hs
apache-2.0
553
0
9
92
111
61
50
8
2
{-# OPTIONS_HADDOCK hide #-} module Main where import System.Exit import System.IO import System.Console.GetOpt import System.Environment import Network.SoundCloud (scResolve, scShowInfo) import qualified Network.SoundCloud.Track as Track data Options = Options { optTrackURL :: Maybe String ...
sebasmagri/HScD
src/hscd.hs
bsd-3-clause
2,897
0
14
1,041
802
426
376
79
5
{- (c) The University of Glasgow 2006 Functions for working with the typechecker environment (setters, getters...). -} {-# LANGUAGE CPP, ExplicitForAll, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Eta.TypeCheck.TcRnMonad( module Eta.TypeCheck.TcRnMonad, module Eta.TypeCheck.Tc...
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcRnMonad.hs
bsd-3-clause
61,023
62
25
18,997
13,487
7,038
6,449
-1
-1
-- The intention is that this will be the new unit test framework. -- Please add any working tests here. This file should do nothing -- but import tests from other modules. -- -- Stephen Blackheath, 2009 module Main where import PackageTests.BenchmarkExeV10.Check import PackageTests.BenchmarkOptions.Check import Pac...
rimmington/cabal
Cabal/tests/PackageTests.hs
bsd-3-clause
8,337
0
16
1,465
1,455
836
619
140
4
-- FIXME See how much of this module can be deleted. {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS -fno-warn-unused-do-bind #-} -- | Functions for the GHC...
kairuku/stack
src/Stack/GhcPkg.hs
bsd-3-clause
11,739
0
19
3,443
2,978
1,514
1,464
249
3
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-} -- | -- Module : Data.Text.Lazy.Search -- Copyright : (c) 2009, 2010 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer : [email protected], [email protected], -- [email protected] -- Stability : experimental -- Portability ...
mightymoose/liquidhaskell
benchmarks/text-0.11.2.3/Data/Text/Lazy/Search.hs
bsd-3-clause
13,404
0
17
4,747
2,264
1,245
1,019
101
7
-- !!! ds029: pattern binding with guards (dubious but valid) -- module ShouldCompile where f x = y where (y,z) | y < z = (0,1) | y > z = (1,2) | True = (2,3)
snoyberg/ghc
testsuite/tests/deSugar/should_compile/ds029.hs
bsd-3-clause
210
0
10
87
78
43
35
5
1
module F8 where f8f b x y = let g = \z -> x+y+z in if b then y else g (x*x) f8 = f8f True 1 2
urbanslug/ghc
testsuite/tests/arityanal/f8.hs
bsd-3-clause
103
0
11
37
70
37
33
4
2
{-# LANGUAGE TypeFamilies #-} module ColInference where type family Elem c type instance Elem [e] = e class Col c where isEmpty :: c -> Bool add :: c -> Elem c -> c headTail :: c -> (Elem c,c) sawpOne c1 c2 = let (x,c1') = headTail c1 (y,c2') = headTail c2 in (add c1' y,add c1' x)
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/ColInference4.hs
bsd-3-clause
320
3
10
97
139
75
64
12
1
{-# LANGUAGE BangPatterns #-} module PrimeFactors (primeFactors) where -- When in doubt, trial division primeFactors :: Integer -> [Integer] primeFactors n | n < 2 = [] | even n = 2 : primeFactors (n `div` 2) | otherwise = reverse $ go 3 n [] where go !k !m !fs | k > m ...
genos/online_problems
exercism/haskell/prime-factors/src/PrimeFactors.hs
mit
476
0
11
197
202
101
101
10
1
number :: Integer number = 2 ^ 1000 sumDigits :: Integer -> Integer sumDigits n | n < 10 = n | otherwise = n `mod` 10 + sumDigits (n `div` 10) solution :: Integer solution = sumDigits number
DylanSp/Project-Euler-in-Haskell
prob16/solution.hs
mit
203
0
9
51
86
45
41
8
1
{-# LANGUAGE NoImplicitPrelude #-} module Advent.Day2Spec (main, spec) where import Advent.Day2 import BasePrelude import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "day2Part1" $ do it "calculates the correct total wrapping paper" $ do day2par...
jhenahan/adventofcode
test/Advent/Day2Spec.hs
mit
539
0
14
139
144
73
71
17
1
{-# LANGUAGE OverloadedStrings #-} module Libfuzzer ( storeTestCase ) where import Control.Monad (unless) import Crypto.Hash.SHA1 (hash) import Data.Byteable (toBytes) import System.Directory (createDirectoryIfMissing, doesFileExist) import System.IO (withFile, IOMode(..)) import qualified Data.ByteString as...
ouspg/libfuzzerfication
base/libfuzzer-base-haskell/hs-libfuzzer/src/Libfuzzer.hs
mit
1,212
0
16
236
328
179
149
29
1
-- | Rules for making lenses. module Rules ( noSigs , jsonOptions , slackOptions ) where import Control.Lens (LensRules, lensRules, generateSignatures, set) import Data.Aeson.TH (Options(..), SumEncoding(..), defaultOptions, defaultTaggedObject) import Data.Aeson.Types (camelTo2) import Data.Char (toLower) --...
fusionapp/catcher-in-the-rye
src/Rules.hs
mit
1,088
0
8
179
220
133
87
23
1
module PPOL.Permutation ( toPermutationIndex , fromPermutationIndex -- , fromList , toList -- , PPOL.Permutation.length ) where import qualified Data.List as List import qualified Data.Array as Array import qualified Data.Maybe as Maybe type Permutation = Array.Array Int Int type PermutationSize = Int type Pe...
vialette/PPOL
src/PPOL/Permutation.hs
mit
813
2
8
144
237
138
99
27
2
{-# htermination maybe :: b -> (a -> b) -> Maybe a -> b #-} import Maybe
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Maybe_maybe_1.hs
mit
73
0
3
17
5
3
2
1
0
-------------------------------------------------------------------- -- | -- Module : Lexer -- Copyright : (c) Stephen Diehl 2013 -- License : MIT -- Maintainer: [email protected] -- Stability : experimental -- Portability: non-portable -- --------------------------------------------------------------...
thekafkaf/brolang
src/Lexer.hs
mit
1,357
0
10
281
334
194
140
28
1
{-# LANGUAGE OverloadedStrings #-} module PlaceTask ( placeTaskIntoCGroup ) where import Types import qualified Data.ByteString.Lazy as LB import qualified Codec.Binary.UTF8.String as U import Data.Aeson import Data.Aeson.Encode.Pretty ...
denisshevchenko/control-groups
src/PlaceTask.hs
mit
3,152
0
13
995
575
307
268
55
3
{-# LANGUAGE Haskell2010 #-} {-# OPTIONS -Wall #-} -- | -- Module : Foreign.Java.JNI.%NAME% -- Copyright : (c) Julian Fleischer 2013 -- License : MIT (See LICENSE file in cabal package) -- -- Maintainer : [email protected] -- Stability : stable -- Portability : portable (Haskell2010) --...
fehu/haskell-java-bridge-fork
src/Foreign/Java/JNI/core.hs
mit
22,694
111
13
4,157
5,376
2,762
2,614
-1
-1
{-| Compiling regular expressions, the new way. -} module CompileRegExp where import RegExpOps import Data.Maybe(fromJust) import qualified Data.Map as Map --import Trace compile r = number (build Map.empty [r]) where build _ [] = [] build dfa (r:rs) = if Map.member r dfa then build dfa rs ...
yav/haskell-lexer
generator/src/CompileRegExp.hs
mit
686
0
14
191
294
161
133
17
3
module Main where import Graphics.Svg ( loadSvgFile ) import Graphics.Rasterific.Svg ( loadCreateFontCache, renderSvgDocument ) import Codec.Picture import Codec.Picture.Types import Data.Vector.Storable.Mutable -- ( IOVector(..)...
cirquit/Personal-Repository
Haskell/svg-loading/app/Main.hs
mit
2,542
0
15
826
580
303
277
52
2
module Text.Greek.Phonology.Phoneme where import Text.Greek.Phonology.Consonants import Text.Greek.Phonology.Vowels data Phoneme = MkConsonant ConsonantPhoneme | MkVowel VowelPhoneme deriving (Eq, Ord, Show)
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Text/Greek/Phonology/Phoneme.hs
mit
218
0
6
29
51
32
19
7
0
{-# language DeriveDataTypeable #-} {-# language TemplateHaskell #-} module Up.Iso where import Up.Store import Autolib.Reporter import Autolib.ToDoc import Autolib.Reader import Data.Typeable import qualified Data.Map as M import Control.Monad data Links = Links [ (Int, Int) ] deriving (Eq, Ord, Typeable) de...
marcellussiegburg/autotool
collection/src/Up/Iso.hs
gpl-2.0
1,201
0
18
364
452
233
219
32
2
{-# LANGUAGE RankNTypes #-} module DarkPlaces.Text ( -- types DPTextToken(..), DecodeType(..), -- type synonyms DPTextOutput, DPTextFilter, -- newtypes BinDPText(..), DPText(..), -- functions parseDPText, stripColors, toUTF, toASCII, toText, -- convert fun...
bacher09/darkplaces-text
src/DarkPlaces/Text.hs
gpl-2.0
7,570
0
16
1,685
2,498
1,307
1,191
181
4
module Network.Gitit2.Handler.Edit ( getEditR, getRevertR, postUpdateR, postCreateR ) where import Control.Monad (when) import Data.ByteString.Lazy.UTF8 (toString) import Data.FileStore as FS import Data.Maybe (fromMaybe) import qualified Data.Text as T import ...
thkoch2001/gitit2
Network/Gitit2/Handler/Edit.hs
gpl-2.0
5,569
0
25
1,936
1,387
675
712
-1
-1
module Control.Monad.Select ( Select , chance ) where import Control.Monad.Select.Internal
davidspies/regret-solver
select-game/src/Control/Monad/Select.hs
gpl-3.0
104
0
4
23
22
15
7
4
0
module Sound.Tidal.VolcaBeats where import Sound.Tidal.Stream (makeI, makeF) import Sound.Tidal.MIDI.Control import Control.Applicative beats :: ControllerShape beats = ControllerShape { params = [ mCC "lKick" 40, mCC "lSnare" 41, mC...
lennart/tidal-midi
Sound/Tidal/VolcaBeats.hs
gpl-3.0
2,219
0
8
956
567
298
269
63
1
module Console( consoleString ) where -- | This function is used to print erroneous strings provided by users of the server. -- For one, it is supposed to escape unprintable characters. -- Furthermore it trims the string if necessary so the console can't easily be flooded by single large malicious requests. consol...
epicvrvs/Veles
Source/Veles/Console.hs
gpl-3.0
498
0
10
100
67
36
31
-1
-1
-- NOTE: if this is NOT strict, then memory builds up like HELL {-# LANGUAGE Strict #-} module SugarScape.Core.Init ( createSugarScape ) where import Control.Monad.Random import Control.Monad.STM import Data.Char import Data.List import SugarScape.Agent.Agent import SugarScape.Agent.Common import SugarScape.Age...
thalerjonathan/phd
public/towards/SugarScape/experimental/concurrent/src/SugarScape/Core/Init.hs
gpl-3.0
6,713
0
18
1,959
1,950
1,051
899
135
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/Resource/SQL/BackupRuns/Insert.hs
mpl-2.0
5,384
0
20
1,345
864
502
362
127
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CopySnapshot.hs
mpl-2.0
7,485
0
9
1,538
805
495
310
86
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-accessapproval/gen/Network/Google/Resource/AccessApproval/Projects/ApprovalRequests/Approve.hs
mpl-2.0
5,815
0
16
1,259
781
457
324
116
1
{-# LANGUAGE DeriveGeneric, LambdaCase #-} import GHC.Exts (Down(..)) import GHC.Generics (Generic) import Numeric (showFFloat) import qualified Data.Text as T import Data.Text.Encoding (decodeUtf8) import Data.ByteString as B (readFile) import Da...
mgmeier/LanguageClassifier
LangClass.hs
unlicense
8,524
0
19
2,504
2,054
1,102
952
-1
-1
{-# LANGUAGE FlexibleInstances #-} module FOLSpec where import qualified Data.Text as T import Test.QuickCheck import Control.Monad import Akarui.FOL.Formula import Akarui.FOL.FOL import Akarui.FOL.Symbols import Akarui.FOL.BinT import Akarui.Parser.FOL import PredicateSpec genAtom :: Gen FOL genAtom = do p <- gen...
PhDP/Manticore
tests/FOLSpec.hs
apache-2.0
1,447
0
12
368
440
238
202
41
2
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -- | Very simple scheduler and node monitor module Main where import System.Environment (getArgs) import Control....
SKA-ScienceDataProcessor/RC
MS1/distributed-dot-product/managed.hs
apache-2.0
2,486
0
13
363
490
287
203
48
1
{-# LANGUAGE TupleSections #-} module DuckTest.Internal.State.Init where import DuckTest.Builtins import DuckTest.Internal.State import DuckTest.Types initState :: InternalState e initState = addVariableType "hasattr" (Functional [("", Any), ("", strType)] Any) $ addVariableType "print" (Functional [("", Any)...
jrahm/DuckTest
src/DuckTest/Internal/State/Init.hs
bsd-2-clause
710
0
17
114
256
139
117
15
1
module Conf.ParseSpec (spec) where import Data.Version (makeVersion) import Distribution.Compiler (CompilerId(..), CompilerFlavor(..)) import Distribution.PackageDescription (FlagName(..)) import Distribution.System (OS(..), Arch(..)) import Test.Hspec import ...
supki/outdated
test/spec/Conf/ParseSpec.hs
bsd-2-clause
1,840
0
18
449
571
310
261
43
1
{-# LANGUAGE TypeOperators #-} {- API.hs , building blocks that needs to know about the program datastructure (a :-> b) Joel Svensson -} module Obsidian.ArrowObsidian.API ( (->-), pure, sync, two, ilv ) wher...
svenssonjoel/ArrowObsidian
Obsidian/ArrowObsidian/API.hs
bsd-3-clause
2,370
0
20
755
911
476
435
52
1
module UtilSpec (main, spec) where import Model import Util import Data.AEq import Test.Hspec import Test.QuickCheck import Debug.Trace -- `main` is here so that this module can be run from GHCi on its own. It is -- not needed for automatic spec discovery. main :: IO () main = hspec spec spec :: Spec spec = do ...
lobachevzky/deepnet
test/UtilSpec.hs
bsd-3-clause
581
0
14
137
148
77
71
19
1
{-# LANGUAGE CPP #-} {- | Module  : Control.Graph.Base Description : Base type class for graph indexed types. Copyright  : (c) Aaron Friel License  : BSD-3 Maintainer  : Aaron Friel <[email protected]> Stability  : unstable Portability : portable -} {-# LANGUAGE ConstraintKinds #-}...
AaronFriel/graphted
src/Control/Graphted/Class.hs
bsd-3-clause
1,143
0
9
274
137
95
42
11
0
module Ivory.Tower.Config.Parser ( ConfigParser() , runConfigParser , string , integer , double , bool , array , subsection , withDefault , (<|>) , (<?>) ) where import Prelude () import Prelude.Compat import qualified Data.Map as M import Text.TOML.Value import Data.Eithe...
GaloisInc/tower
tower-config/src/Ivory/Tower/Config/Parser.hs
bsd-3-clause
3,138
0
19
809
1,132
576
556
90
3
module Problem71 where main :: IO () main = print . fst . foldl1 (\(n, d) (n', d') -> if n' * d < n * d' -- n / d > n' / d' then (n, d) else (n', d') ) $ [ (floor (fromIntegral (3 * k) / 7.0) - 1, k) | k <- [1 .. 1000000] ]
adityagupta1089/Project-Euler-Haskell
src/problems/Problem71.hs
bsd-3-clause
309
0
14
146
136
78
58
10
2
-- | This module provides Hoca specific commands for the interactive mode. module Tct.Hoca.Interactive ( module M , loadML , listML , parseML ) where import Tct.Core.Interactive as M import Tct.Hoca.Processors as M import Tct.Hoca.Strategies as M import qualified Tct.Core ...
ComputationWithBoundedResources/tct-hoca
src/Tct/Hoca/Interactive.hs
bsd-3-clause
812
0
9
204
201
118
83
-1
-1
{-# OPTIONS_GHC -fno-warn-type-defaults #-} module Util.AverageFileSize ( getAverageFileSize , calculateAverageFileSize ) where import Data.List (foldl') import qualified Data.Map.Strict as M import Request (FileID, FileRequest, FileSize, RequestType...
wochinge/CacheSimulator
src/Util/AverageFileSize.hs
bsd-3-clause
1,125
0
10
222
259
145
114
23
1
-------------------------------------------------------------------------------- module Copilot.Kind.CoreUtils.Expr where import Copilot.Core import Data.Monoid import Data.List (concatMap) -------------------------------------------------------------------------------- foldCExpr :: forall m a . (Monoid m) => ...
jonathan-laurent/copilot-kind
src/Copilot/Kind/CoreUtils/Expr.hs
bsd-3-clause
2,412
0
18
667
743
378
365
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE...
haskell-distributed/distributed-process-client-server
src/Control/Distributed/Process/ManagedProcess/Internal/Types.hs
bsd-3-clause
25,548
0
17
6,127
5,156
2,896
2,260
412
2
module Signal.Wavelet.List1 where import Signal.Wavelet.List.Common dwt :: [Double] -> [Double] -> [Double] dwt angles signal = dwtWorker latticeSeq csl angles signal idwt :: [Double] -> [Double] -> [Double] idwt angles signal = dwtWorker latticeSeq csr angles signal
jstolarek/lattice-structure-hs
src/Signal/Wavelet/List1.hs
bsd-3-clause
274
0
7
43
96
54
42
6
1
{-# LANGUAGE CPP #-} module Main where import TestsCommon import GalFld.Core import GalFld.Sandbox.FFSandbox (e2f2,e2e2f2,e4f2) import GalFld.Sandbox.PolySandbox -------------------------------------------------------------------------------- --------------------------------------------------------------------------...
maximilianhuber/softwareProjekt
test/PolyTests.hs
bsd-3-clause
3,019
0
15
555
868
445
423
50
1