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 DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} module Zendesk.Internal.MockServer where import Zendesk.API import Data.Monoid ((<>)) import qualified Network.Wai.Handler.Warp as Warp import Servant emptyUser :: User emptyUser = User ...
steshaw/zendesk
src/Zendesk/Internal/MockServer.hs
bsd-2-clause
2,916
0
13
572
614
346
268
76
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Graphics.GL.Low.Internal.Types where import Data.Data (Data, Typeable) import Foreign.Storable (Storable) import Graphics.GL (GLuint) import Graphics.GL.Low.Classes newtype TextureUnit = TextureUnit { fromTextureUnit :: GLuint }...
sgraf812/lowgl
Graphics/GL/Low/Internal/Types.hs
bsd-2-clause
3,164
0
8
593
868
483
385
51
0
-- | The standard \(n\)-simplex module Math.Topology.SSet.NSimplex where import Math.Topology.SSet import Math.Topology.SSet.Effective newtype NSimplex = NSimplex { simplexDimension :: Int } instance Show NSimplex where show (NSimplex n) = "Δ^" ++ show n newtype NSimplexSimplex = NSimplexSimplex [Int] deriving...
mvr/at
src/Math/Topology/SSet/NSimplex.hs
bsd-3-clause
1,268
0
10
231
558
296
262
-1
-1
module Package08e where import GHC.Hs.MyTypes import GHC.Hs.Types import GHC.Hs.Utils import UniqFM
sdiehl/ghc
testsuite/tests/package/package08e.hs
bsd-3-clause
100
0
4
11
25
17
8
5
0
{-# OPTIONS -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Web.ChatWork ( me , Me(..) , myStatus , MyStatus(..) , myTasks , createRoomMessage , CreateMessage(..) , RateLimit(..) , getChatWorkTokenFromEnv ) where import Data.ByteString.Char8 as BS import System.Environment ( lookupEnv ) ...
eiel/haskell-chatwork
src/Web/ChatWork.hs
bsd-3-clause
891
0
9
140
250
146
104
29
1
{-# OPTIONS_GHC -fno-warn-unused-binds #-} {-| Module : Database.Memcache.SASL Description : SASL Authentication Copyright : (c) David Terei, 2016 License : BSD Maintainer : code@davidterei.com Stability : stable Portability : GHC SASL authentication support for Memcached. -} module Database.Memcache.SA...
dterei/memcache-hs
Database/Memcache/SASL.hs
bsd-3-clause
2,178
0
15
509
448
231
217
38
3
{-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Functor.Identity -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science...
jstolarek/ghc
libraries/base/Data/Functor/Identity.hs
bsd-3-clause
3,203
0
11
843
550
318
232
44
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Health.Instances where import Numeric.Units.Dimensional.Prelude hiding (Activity) import Data.HasTime import Data.Fitness.SetRep im...
savannidgerinel/health
src/Health/Instances.hs
bsd-3-clause
3,472
0
12
1,123
982
517
465
83
0
{-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} module Math.Automata.Simple ( NFA , DFA , flattenDFAStates , faToDot , textToNFA , subsetConstruction ) where import Control.A...
owst/NFAToDFA
src/Math/Automata/Simple.hs
bsd-3-clause
12,630
0
20
3,796
2,836
1,533
1,303
196
8
module Signal.Wavelet.Repa2 where import Data.Array.Repa as R import Data.Array.Repa.Unsafe (unsafeTraverse) import Signal.Wavelet.Repa.Common {-# INLINE dwtS #-} {-# INLINE dwtP #-} {-# INLINE idwtS #-} {-# INLINE idwtP #-} dwtS, dwtP, idwtS, idwtP :: Array U DIM1 Double -> Array U ...
jstolarek/lattice-structure-hs
src/Signal/Wavelet/Repa2.hs
bsd-3-clause
4,532
0
15
1,652
1,582
791
791
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedLists #-} module Foreign.Erlang.TermSpec ( spec ) where import Data.Binary ( decode , encode ...
LTI2000/hinterface
test/Foreign/Erlang/TermSpec.hs
bsd-3-clause
9,887
0
23
6,233
2,024
1,149
875
343
4
{-# LANGUAGE MultiWayIf #-} -- | This module provides the /MSum/ processor. -- -- The /MSum/ processor runs two strategies in parallel and provides a "sum" on the resulting proof trees and -- certificates. Informally, the processor behaves like a monoid where open (sub)prooftrees and unknown bounds behave -- like neutr...
ComputationWithBoundedResources/tct-core
src/Tct/Core/Processor/MSum.hs
bsd-3-clause
2,700
0
14
692
854
446
408
-1
-1
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.MultiToggle.TabBarDecoration -- Copyright : (c) 2018 Lucian Poston -- License : BSD-style (see LICENSE) -- -- Maintainer : <lucianpo...
xmonad/xmonad-contrib
XMonad/Layout/MultiToggle/TabBarDecoration.hs
bsd-3-clause
1,594
0
12
245
148
98
50
10
0
-- | Matrices ------------------------------------------------------------------------------ {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} module Value.Matrix where -------------------------------------------...
Conflagrationator/HMath
src/Value/Matrix.hs
bsd-3-clause
4,289
0
21
836
1,460
757
703
56
0
----------------------------------------------------------------------------- -- | Module : Control.Monad.Trans.Chronicle -- -- The 'ChronicleT' monad, a hybrid error/writer monad that allows -- both accumulating outputs and aborting computation with a final -- output. ---------------------------------------------...
Zemyla/these
Control/Monad/Chronicle.hs
bsd-3-clause
1,028
0
6
332
101
71
30
11
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 The @TyCon@ datatype -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module ETA.Types.TyCon( -- * Main TyCon data types TyCon, FieldLabel, AlgTyConRhs(..), visibleDataCons, TyConParent(..), i...
alexander-at-github/eta
compiler/ETA/Types/TyCon.hs
bsd-3-clause
74,853
0
16
22,396
8,534
4,929
3,605
729
8
{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_HADDOCK hide #-} module Distribution.Compat.Environment ( getEnvironment, lookupEnv, setEnv, unsetEnv ) where import Prelude () import qualified Prelude import Distribution.Compat.Prelude #ifndef mingw32_HOST_OS #if __GLASGOW_HA...
sopvop/cabal
Cabal/Distribution/Compat/Environment.hs
bsd-3-clause
4,214
14
14
695
529
314
215
35
1
import Text.Read operators :: [(String, Integer -> Integer -> Integer)] operators = [("+", (+)), ("-", (-)), ("*", (*)), ("/", div)] rpolishIter :: Maybe [Integer] -> [String] -> Maybe [Integer] rpolishIter mns [] = mns rpolishIter (Just ns) (s : ss) = case lookup s operators of Just o -> case ns of y : x : ns' ->...
YoshikuniJujo/funpaala
samples/15_fold/rpolish0.hs
bsd-3-clause
533
0
15
106
272
150
122
13
3
-- | Assignment of unique IDs to values. -- Inspired by the 'intern' package. {-# LANGUAGE RecordWildCards, ScopedTypeVariables, BangPatterns #-} module Twee.Label(Label, unsafeMkLabel, labelNum, label, find) where import Data.IORef import System.IO.Unsafe import qualified Data.Map.Strict as Map import Data.Map.Stric...
nick8325/kbc
src/Twee/Label.hs
bsd-3-clause
3,995
0
19
912
916
493
423
83
4
len \*\ tms = (len - 1) * tms - (len + 3)
YoshikuniJujo/funpaala
samples/05_function/golf.hs
bsd-3-clause
42
0
8
13
34
17
17
1
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | Use...
naushadh/persistent
persistent-mongoDB/Database/Persist/MongoDB.hs
mit
59,967
0
21
14,516
15,228
7,929
7,299
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : ./CspCASL/SymbItems.hs Description : syntactic csp-casl symbols Copyright : (c) Christian Maeder, DFKI GmbH 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable -} mod...
spechub/Hets
CspCASL/SymbItems.hs
gpl-2.0
4,469
0
17
957
1,221
616
605
105
4
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} #ifdef LEKSAH_WITH_CODE_MIRROR {-# LANGUAGE RecordWildCards #-} #endif {-# LANGUAGE RankNTypes #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------...
cocreature/leksah
src/IDE/TextEditor/CodeMirror.hs
gpl-2.0
21,354
0
21
6,472
7,106
3,558
3,548
27
0
import Test.DocTest main :: IO () main = doctest ["-ilib", "lib"]
thsutton/aeson-diff
test/doctests.hs
bsd-2-clause
67
0
6
12
30
16
14
3
1
-- | -- Module : Foundation.IO.Terminal -- License : BSD-style -- Maintainer : Foundation -- Stability : experimental -- Portability : portable -- module Foundation.IO.Terminal ( putStrLn , putStr , stdin , stdout , getArgs , exitFailure , exitSuccess ) where import ...
vincenthz/hs-foundation
foundation/Foundation/IO/Terminal.hs
bsd-3-clause
819
0
7
196
155
95
60
19
1
data U = MkU (U -> Bool)
batterseapower/chsc
examples/toys/GHCBug.hs
bsd-3-clause
25
0
8
7
17
9
8
1
0
{-# LANGUAGE OverloadedStrings #-} -- | Main test suite. module Main where import Control.Monad import Data.Monoid import TryHaskell -- | Main entry point. main :: IO () main = do assert (SuccessResult ("'a'","Char","'a'") mempty mempty) (run "'a'" mempty mempty) assert (SuccessResult ("123","Num...
chrisdone/tryhaskell
src/test/Main.hs
bsd-3-clause
1,438
0
16
411
469
237
232
34
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Compiler -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability...
mydaum/cabal
Cabal/Distribution/Simple/Compiler.hs
bsd-3-clause
15,445
0
16
3,486
2,372
1,332
1,040
227
6
module DerivingRead where import DerivingUtils deriveRead stdnames src t@(_,TypeInfo{constructors=cs}) = do let pv = stdvalue stdnames mod_Prelude readParenArg <- pv "readParenArg" readArgument <- pv "readArgument" readToken <- pv "readToken" HsVar readsPrec <- pv "readsPrec" readAp <- pv "r...
forste/haReFork
tools/base/transforms/Deriving/DerivingRead.hs
bsd-3-clause
899
11
15
225
300
153
147
25
2
{-# LANGUAGE GADTs, KindSignatures #-} -- Test for trac #810 -- Should be able to infer bool :: Bool and integer :: Integer, so -- we should know that they both have Show instances. module Foo where import Data.Kind (Type) data Pair :: (Type -> Type) -> Type where Pair :: a b -> b -> Pair a data Sel :: Type ->...
sdiehl/ghc
testsuite/tests/gadt/gadt20.hs
bsd-3-clause
480
0
8
115
132
72
60
-1
-1
import System.Environment import System.Process import Data.Maybe main = do [ghc] <- getArgs info <- readProcess ghc ["+RTS", "--info"] "" let fields = read info :: [(String,String)] getGhcFieldOrFail fields "HostOS" "Host OS" getGhcFieldOrFail fields "WORDSIZE" "Word size" getGhcFieldOrFail fields "TARGE...
oldmanmike/ghc
testsuite/mk/ghc-config.hs
bsd-3-clause
3,147
0
17
626
1,024
500
524
75
3
{-# LANGUAGE FlexibleContexts #-} module TcRun038_B where class Foo a where op :: a -> Int -- Note the (Foo Int) constraint here; and the fact -- that there is no (Foo Int) instance in this module -- It's in the importing module! bar :: Foo Int => Int -> Int bar x = op x + 7
urbanslug/ghc
testsuite/tests/typecheck/should_run/TcRun038_B.hs
bsd-3-clause
294
0
7
76
57
31
26
6
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Database.PostgreSQL.Simple.Classy.Exceptions.ExecStatus ( AsExecStatus (..) ) where import Prelude (Eq,Show (show)) import Data.Profunctor (Profunctor) i...
mankyKitty/classy-pgsql-errors
src/Database/PostgreSQL/Simple/Classy/Exceptions/ExecStatus.hs
mit
2,002
0
12
456
377
222
155
40
0
module Main where {- - Testing module -} import Brain import Test.Hspec import Test.QuickCheck import Control.Monad.Trans.State.Lazy import Control.Exception import Control.Monad import System.Process checkFormat :: Bool checkFormat = format test1 == test1 && format test2 == "..><,,..>" && format test3 == "..[]>...
allonsy/brain
test/brainTest.hs
mit
4,581
0
15
915
1,861
997
864
104
1
{-| Module : Data.Algorithm.PPattern.Geometry.Point Description : Simple 2D point Copyright : (c) Laurent Bulteau, Romeo Rizzi, Stéphane Vialette, 2016 License : MIT Maintainer : vialette@gmail.com Stability : experimental -} module Data.Algorithm.PPattern.Geometry.Point ( -- * The @Point@ type Point...
vialette/ppattern-tmp
src/Data/Algorithm/PPattern/Geometry/Point.hs
mit
1,703
0
8
446
410
235
175
30
1
module Main where main = putStrLn "Hello, World!"
archdragon/haskell_exercises
hello_world/hello_world.hs
mit
50
0
5
8
12
7
5
2
1
{-# LANGUAGE BangPatterns #-} module Stage.Diffusion ( DiffSolver (..) , diffusion) where import Model import FieldElt import Stage.Linear import Data.Array.Repa as R import Data.Array.Repa.Eval as R import Data.Vector.Unboxed data DiffSolver = DiffStable Int | DiffUnst...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/raster/Fluid/src-repa/Stage/Diffusion.hs
mit
1,283
0
17
465
289
150
139
-1
-1
{- | Module : Numeric.Information.IT Description : Information quantities Copyright : (c) Malte Harder License : MIT Maintainer : malte.harder@gmail.com Stability : experimental Portability : portable This module contains various function to calculate information theoretic quantities -} module N...
mahrz/hit
src/Numeric/Information/IT.hs
mit
6,370
4
14
2,163
1,713
924
789
117
1
{-# LANGUAGE FlexibleInstances #-} module Qy.Chat.Types ( emptyRoomMap , Room(..) , Client(..) , getRoomChan , ErrorMsg(..) , IncomingMsg(..) , ChanMessage(..) , UserName , RoomName , RoomMap ) where import Data.Text import Control.Concurrent.STM import Control.Concurre...
realli/chatqy
src/Qy/Chat/Types.hs
mit
3,972
0
14
1,336
1,079
598
481
140
1
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Triangle (rows) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec spec...
c19/Exercism-Haskell
pascals-triangle/test/Tests.hs
mit
978
0
10
394
319
197
122
17
1
import CodeGen import HughesSaft ( saft_fluid, saft_entropy, yuwu_correlation, hughes_X, hughes_HB ) import WaterSaft ( water_saft, water_entropy, water_X, mu, water_saft_by_hand ) import IdealGas ( idealgas ) import FMT ( n, n2, n2mxx, n2x ) import SFMT ( sfmt ) import Rosenfeld ( fmt ) import WhiteBear ( whitebear, t...
droundy/deft
src/haskell/functionals.hs
gpl-2.0
4,533
0
13
1,233
862
450
412
81
2
import Control.Arrow error = (&&&) ==> (***)
alphaHeavy/hlint
tests/test-hints-fail.hs
gpl-2.0
45
0
5
7
19
12
7
2
1
{-# LANGUAGE DeriveDataTypeable, MultiParamTypeClasses #-} module Rewriting.Check where import Rewriting.TRS import Rewriting.Overlap import qualified Machine.Numerical.Config as C import Autolib.Size import Autolib.Set import Autolib.FiniteMap import Autolib.ToDoc import Autolib.Reader import Autolib.Reporter impor...
Erdwolf/autotool-bonn
src/Rewriting/Check.hs
gpl-2.0
5,536
0
22
2,269
1,610
773
837
130
1
type RingF2 a = RingF (RingF (RingF a))
hmemcpy/milewski-ctfp-pdf
src/content/3.8/code/haskell/snippet08.hs
gpl-3.0
39
0
9
7
23
12
11
1
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Main ( main ) where import Data.Aeson (decode, FromJSON) import Data.ByteString.Lazy.Char8 (ByteString, unpack) import Data.Maybe (fromMaybe) import Data.Text.Lazy (Text) import Data.Text.Lazy.Encoding (encodeUtf8) import Foreign.C.Error import ...
cdepillabout/haskell-github-updater
Main.hs
gpl-3.0
6,680
0
29
1,496
1,788
906
882
140
4
-- License: GPL v2 or later {-# LANGUAGE ForeignFunctionInterface #-} module Display(doDisplay, initDisplay) where import Graphics.UI.GLUT import qualified Sim import Data.Array.Unboxed import Data.Word(Word32) import Control.Monad(when, unless, liftM2, forM_) import System.Random import ArrayUtils (arraySize) import...
idupree/Pollutocracy
Display.hs
gpl-3.0
12,241
20
34
2,759
4,435
2,216
2,219
232
10
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Chap03.Data.RedBlackTree10 where import qualified Chap03.Exercise10 as Ex10 import Chap02.Data.Set import Chap03.Data.RedBlackTree import Control.Applicative (liftA2, pure) import Data.Foldable import Prelude hiding (foldr) import Te...
stappit/okasaki-pfds
src/Chap03/Data/RedBlackTree10.hs
gpl-3.0
917
0
11
188
311
167
144
23
0
{-# LANGUAGE ExistentialQuantification #-} import Data.Aeson (ToJSON (toJSON), encode) import Data.ByteString.Lazy (toStrict) import Data.Text.Buildable (Buildable (build)) import Data.Text.Encoding (decodeUtf8) import qualified Data.Text.IO ...
input-output-hk/rscoin-haskell
src/JsonDemo/Main.hs
gpl-3.0
1,834
0
17
665
524
276
248
51
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-codedeploy/gen/Network/AWS/CodeDeploy/StopDeployment.hs
mpl-2.0
3,898
0
11
839
516
311
205
61
1
{-# LANGUAGE TemplateHaskell, DataKinds #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Model.URL ( URI , validHDL , hdlURL , parseURL -- for testing , urlLink ) where import Control.Monad (guard) import Data.Aeson (ToJSON(..)) import Data.Char (isDigit) import Data.Maybe (fromMaybe, isNothing) import D...
databrary/databrary
src/Model/URL.hs
agpl-3.0
3,220
0
15
701
926
491
435
-1
-1
-- Copyright 2020 Google LLC -- -- 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 or agreed to in ...
google/cabal2bazel
src/Google/Google3/Tools/Cabal2Build/PackageName.hs
apache-2.0
2,668
0
12
517
350
202
148
36
2
import System.Random import Data.Char as C import Data.List as L main :: IO () main = undefined type Weight = Double -- data Network a b = Input (a -> Weight) -- | Neuron Weight [(Network a b, Weight)] -- | Output (Weight -> b) (Network a b) data Neuron = Neuron Weight [(Neuron, Weig...
niilohlin/neural
neural2.hs
apache-2.0
2,545
0
12
579
394
229
165
18
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} -- Some basic structures about nodes in a graph, etc. module Spark.Core.StructuresInternal( NodeName(..), NodePath(..), NodeId(..), FieldName(..), FieldPath(..), ComputationID(..), catNodePath, fieldNam...
krapsh/kraps-haskell
src/Spark/Core/StructuresInternal.hs
apache-2.0
4,463
0
13
784
1,037
576
461
89
1
distribution_Candies :: Int -> Int -> [Int] distribution_Candies c n = let result = [0 | _ <- [1 .. n]] in inner_dis 1 c (splitAt 0 result) where inner_dis :: Int -> Int -> ([Int], [Int]) -> [Int] inner_dis count can (h, []) = inner_dis count can ([], h) inner_dis count can (h, (x:xs)) | count ...
ccqpein/Arithmetic-Exercises
Distribute-Candies-to-People/DCtP.hs
apache-2.0
514
0
13
133
268
141
127
12
2
-- | -- Module : Crypto.PubKey.RSA.Prim -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : Good -- module Crypto.PubKey.RSA.Prim ( -- * decrypt primitive dp -- * encrypt primitive , ep ) where import Data.ByteStr...
vincenthz/hs-crypto-pubkey
Crypto/PubKey/RSA/Prim.hs
bsd-2-clause
2,503
0
11
566
700
374
326
33
1
module Prettyprinter.Render.String ( renderString, renderShowS, ) where import Prettyprinter.Internal (SimpleDocStream, renderShowS) -- | Render a 'SimpleDocStream' to a 'String'. renderString :: SimpleDocStream ann -> String renderString s = renderShowS s ""
quchen/prettyprinter
prettyprinter/src/Prettyprinter/Render/String.hs
bsd-2-clause
270
0
6
41
55
32
23
6
1
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module Language.Haskell.Liquid.Bare.RefToLogic ( Transformable , txRefToLogic ) where import Language.Haskell.Liquid.Types import Language.Haskell.Liquid.Misc (mapSnd) import Language.Haskell.Liquid.Bare.Env import Language.Fixpoin...
abakst/liquidhaskell
src/Language/Haskell/Liquid/Bare/RefToLogic.hs
bsd-3-clause
4,939
1
16
1,452
2,316
1,168
1,148
109
1
{-# LANGUAGE OverloadedStrings, EmptyDataDecls, FlexibleContexts, GADTs, GeneralizedNewtypeDeriving, MultiParamTypeClasses, QuasiQuotes, TemplateHaskell, TypeFamilies #-} module Main where import Protolude import Network.HTTP.Client (newManager, defaultManagerSettings) import qualified Data.Text as T import Database...
daniel-j-h/hosrm-qa
src/Main.hs
bsd-3-clause
2,514
0
13
539
455
248
207
37
2
import GitYrp import Test.QuickCheck import Text.Printf import System.Exit succOrFail :: Result -> IO () succOrFail (Success _ _ _) = return () succOrFail x = print x >> exitFailure >> return () testOne :: Testable p => (String, p) -> IO Result testOne (s, prop) = printf "%-25s: " s >> quickCheckResult prop main ::...
yaccz/git-yrp
tests/unit/main.hs
bsd-3-clause
977
0
7
177
281
149
132
26
1
module Main where import qualified Nlp1 import qualified Nlp2 import qualified Nlp3 import qualified Nlp4 import System.Environment import Control.Monad q = join [Nlp1.answers, Nlp2.answers, Nlp3.answers, Nlp4.answers] main :: IO () main = getArgs >>= (q !!) . read . head
Iruyan-Zak/Nlp100
app/Main.hs
bsd-3-clause
278
0
8
45
89
54
35
10
1
module Math.IRT.Model.Rasch ( RaschModel (..) ) where import Statistics.Distribution import Math.IRT.Internal.Distribution import Math.IRT.Internal.LogLikelihood import Math.IRT.Model.FourPLM ( FourPLM(..) ) import Math.IRT.Model.Generic data RaschModel = RaschModel { difficulty :: !Double ...
argiopetech/irt
Math/IRT/Model/Rasch.hs
bsd-3-clause
1,043
0
9
233
262
144
118
28
1
module Network.Wai.Session.VCache.SimpleSpec (spec) where import Network.Wai.Session.VCache.Simple import Test.Tasty import Test.Tasty.QuickCheck as QC import Test.QuickCheck import Test.QuickCheck.Instances spec :: TestTree spec = testGroup "Network.Wai.Session.VCache.Simple" [ QC.testProperty "`someFunction` sh...
athanclark/wai-session-alt
test/Network/Wai/Session/VCache/SimpleSpec.hs
bsd-3-clause
425
0
8
59
102
61
41
12
1
{-# LANGUAGE OverloadedStrings, FlexibleInstances, TypeSynonymInstances #-} -------------------------------------------------------------------- -- | -- Module : Text.Feed.Util -- Copyright : (c) Galois, Inc. 2008 -- License : BSD3 -- -- Maintainer: Sigbjorn Finne <sof@galois.com> -- Stability : provisional -- Por...
haskell-pkg-janitors/feed
Text/Feed/Util.hs
bsd-3-clause
6,811
0
14
1,433
1,235
680
555
72
3
module Day8 where import Data.List import Debug.Trace import Text.Parsec import Data.Bifunctor import qualified Data.Matrix as Mat import qualified Data.Vector as Vec bOff = '.' bOn = '#' totalRows = 6 totalCols = 50 type Screen = Mat.Matrix Char type ScreenFn = Screen -> Screen empty = Mat.matrix totalRows total...
amirci/aoc2016-hs
src/Day8.hs
bsd-3-clause
2,104
0
10
464
836
427
409
66
2
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, FlexibleInstances #-} -- TODO: The DRY principle is violated in the instance declarations of -- 'UniqueDeclaration'. Fix by writing an abstraction. -- -- TODO: The readability of the TH code here would be enhanced by writing in a -- comment something similar to an exa...
bairyn/global
src/Data/Global.hs
bsd-3-clause
40,628
0
16
8,490
3,497
2,094
1,403
186
1
module Vectorise.Env ( Scope(..), -- * Local Environments LocalEnv(..), emptyLocalEnv, -- * Global Environments GlobalEnv(..), initGlobalEnv, extendImportedVarsEnv, extendFamEnv, setPAFunsEnv, setPRFunsEnv, modVectInfo ) where import HscTypes import InstEnv import FamInstEnv import CoreSyn im...
nomeata/ghc
compiler/vectorise/Vectorise/Env.hs
bsd-3-clause
10,185
0
15
3,119
1,393
811
582
119
1
-- | -- Module: Trace.Hpc.Codecov.Types -- Copyright: (c) 2014 Guillaume Nargeot -- License: BSD3 -- Maintainer: Guillaume Nargeot <guillaume+hackage@nargeot.com> -- Stability: experimental -- -- Types to represent hpc code coverage data. module Trace.Hpc.Codecov.Types where import Network.Curl import T...
guillaume-nargeot/codecov-haskell
src/Trace/Hpc/Codecov/Types.hs
bsd-3-clause
761
0
6
187
109
74
35
16
0
{- ORMOLU_DISABLE -} -- Options passed to Haddock {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- {-# LANGUAGE CPP #-} -- CPP: GHC >= 7.8 for Safe Haskell #if __GLASGOW_HASKELL__ >= 708 {- The 'Data.DList.Unsafe' module exports 'UnsafeDList' and 'unsafeAppl...
spl/dlist
Data/DList/Unsafe.hs
bsd-3-clause
1,092
0
5
136
37
30
7
7
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad (replicateM_, liftM) import Control.Concurrent (threadDelay) import Control.Monad.IO.Class (liftIO) import Data.Int (Int64) import Test.Tasty import Test.Tasty.HUnit import qualified Test.Tasty.QuickCheck as QC import qualified Test.QuickCheck...
ambiata/wai-middleware-metrics
tests.hs
bsd-3-clause
3,379
0
15
589
901
462
439
64
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts #-} module Opaleye.Internal.Binary where import Opaleye.Internal.Column (Column(Column)) import qualified Opaleye.Internal.Tag as T import qualified Opaleye.Internal.PackMap as PM import qualified Opaleye.Internal.QueryArr as Q import qualified Opaleye.In...
silkapp/haskell-opaleye
src/Opaleye/Internal/Binary.hs
bsd-3-clause
2,816
0
13
644
827
464
363
50
1
{-# LANGUAGE OverloadedStrings, RankNTypes #-} -- | It should be noted that most of the code snippets below depend on the -- OverloadedStrings language pragma. -- -- Scotty is set up by default for development mode. For production servers, -- you will likely want to modify 'Trans.settings' and the 'defaultHandler'. See...
beni55/scotty
Web/Scotty.hs
bsd-3-clause
11,272
0
9
2,115
1,544
919
625
108
1
{-# LANGUAGE RankNTypes #-} -- -- Examples for package basic-lens -- module Basic where import Control.Applicative (pure) import Control.Applicative (Applicative) import Control.Lens.Basic infixl 0 ^. (^.) :: s -> Lens s t a b -> a (^.) = flip view infixl 1 .~ (.~) :: Lens s t a b -> b -> s -> t (.~) = set infixl...
notae/haskell-exercise
lens/Basic.hs
bsd-3-clause
1,123
0
8
246
455
246
209
28
1
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif -- | -- Module : Data.ByteString.Base64.Lazy -- Copyright : (c) 2012 Ian Lynagh -- -- License : BSD-style -- Maintainer : Emily Pillmore <emilypi@cohomolo.gy>, -- Herbert Valerio Riedel <hvr@gnu.org>, -- ...
bos/base64-bytestring
Data/ByteString/Base64/Lazy.hs
bsd-3-clause
2,382
0
13
581
319
189
130
24
2
{-# LANGUAGE RecordWildCards #-} module Passman.Engine.Strength where import Math.NumberTheory.Logarithms (intLog2) data Strength = Strength { strengthName :: String , strengthBits :: Int , strengthIterations :: Int ...
chwthewke/passman-hs
src/Passman/Engine/Strength.hs
bsd-3-clause
442
0
8
147
80
47
33
8
1
-- | Some more DOM examples. {-# LANGUAGE EmptyDataDecls #-} module Demo.Properties where import Language.Fay.FFI import Language.Fay.Prelude import Language.Fay.DOM main :: Fay () main = addEventListener "load" updateBody False updateBody :: Fay () updateBody = do printList [[1,2,3],[4,5,6]] print thebody ...
faylang/fay-server
modules/project/Demo/Properties.hs
bsd-3-clause
1,068
0
10
177
328
170
158
31
1
module Chapter9.ListsSpec where import Test.Hspec safeTail :: [a] -> Maybe [a] safeTail = undefined useRangeInstead :: [Integer] useRangeInstead = [1, 2, 3, 4, 5, 6] myWords :: String -> [String] myWords = undefined squares :: [Int] squares = fmap (^ 2) [1 .. 3] squareEvens :: [Int] squareEvens = fmap (...
yannick-cw/haskell_katas
test/Chapter9/ListsSpec.hs
bsd-3-clause
905
0
11
198
347
200
147
22
1
module Random where import Control.Monad import System.Random import Text.Printf bounds = 1.9 :: Float -- an infinte stream of random floats randomFloats g = let (a,g') = randomR (-bounds, bounds) g in a : randomFloats g' -- an infinite stream of random pairs randomPairs g = let (a,g') = randomR (-bounds, boun...
erantapaa/parse-complex
src/Random.hs
bsd-3-clause
603
0
15
127
246
128
118
15
1
{-| Description : Essential Critical Pairs generator. This module provides functions that generate all essential critical pairs between two productions. The essential critical pairs are classified with 'CriticalPairType', but each pair can be only a 'DeleteUse'. -} module Analysis.EssentialCriticalPairs ( findEssent...
Verites/verigraph
src/library/Analysis/EssentialCriticalPairs.hs
apache-2.0
3,313
0
14
606
734
397
337
41
1
import AI.HNN.FF.Network import Numeric.LinearAlgebra samples :: Samples Double samples = [ (fromList [ 1, 1, 1, 1, 1 , 0, 0, 0, 0, 1 , 0, 0, 1, 1, 1 , 0, 0, 0, 0, 1 , 1, 1, 1, 1, 1 ], fromList [1]), -- three (fromList [ 1, 1, 1, 1, 1 , 0, 0, 0, 0, 1...
marcusbuffett/hnn
examples/ff/three.hs
bsd-3-clause
2,063
0
11
883
878
548
330
51
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1999 Analysis functions over data types. Specficially, detecting recursive types. This stuff is only used for source-code decls; it's recorded in interface files for imported data types. -} {-# LANGUAGE CPP #-} module Eta.Ty...
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcTyDecls.hs
bsd-3-clause
34,725
2
19
9,569
4,795
2,540
2,255
314
10
-- Copyright Corey O'Connor {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} -- | This provides a mock terminal implementation that is nice for -- testing. This transforms the output operations to visible characters -- which is useful for testing. module Graphics.Vty.Output.Mock ( MockData , mockTer...
jtdaugherty/vty
src/Graphics/Vty/Output/Mock.hs
bsd-3-clause
3,857
0
21
1,143
591
342
249
48
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-rds/gen/Network/AWS/RDS/CreateEventSubscription.hs
mpl-2.0
8,720
0
10
1,783
893
552
341
94
1
{-# LANGUAGE FlexibleContexts, TypeOperators, MultiParamTypeClasses, ScopedTypeVariables #-} {- | Module : BaseTransCFJavaNew Description : Basic translation of dependently typed FCore to Java Copyright : (c) 2014—2015 The F2J Project Developers (given in AUTHORS.txt) License : BSD3 Maintainer : Jerem...
bixuanzju/fcore
lib/archive/BaseTransCFJavaNew.hs
bsd-2-clause
17,815
0
26
5,898
6,349
3,167
3,182
396
36
{-# LANGUAGE PolyKinds, TypeFamilies, MagicHash, DataKinds, TypeInType, RankNTypes #-} module T11473 where import GHC.Exts import GHC.Types type family Boxed (a :: k) :: * type instance Boxed Char# = Char type instance Boxed Char = Char class BoxIt (a :: TYPE lev) where boxed :: a -> Boxed a instance BoxIt Cha...
mcschroeder/ghc
testsuite/tests/typecheck/should_fail/T11473.hs
bsd-3-clause
587
0
9
120
169
94
75
13
1
{- NOTA BENE: Do NOT use ($) anywhere in this module! The type of ($) is slightly magical (it can return unlifted types), and it is wired in. But, it is also *defined* in this module, with a non-magical type. GHC gets terribly confused (and *hangs*) if you try to use ($) in this module, because it has different types ...
tolysz/prepare-ghcjs
spec-lts8/base/GHC/Base.hs
bsd-3-clause
42,231
187
46
11,059
6,462
3,638
2,824
397
2
module Dotnet.System.ObjectTy (Dotnet.Object(..)) where import qualified Dotnet --data Object_ a --type Object a = Dotnet.Object (Object_ a)
FranklinChen/Hugs
dotnet/lib/Dotnet/System/ObjectTy.hs
bsd-3-clause
147
0
5
23
24
17
7
2
0
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="hi-IN"> <title>Common Library</title> <maps> <homeID>commonlib</homeID> <mapref locatio...
kingthorin/zap-extensions
addOns/commonlib/src/main/javahelp/help_hi_IN/helpset_hi_IN.hs
apache-2.0
965
77
66
156
407
206
201
-1
-1
module IRTS.CodegenC (codegenC) where import Idris.AbsSyntax import IRTS.Bytecode import IRTS.Lang import IRTS.Simplified import IRTS.Defunctionalise import IRTS.System import IRTS.CodegenCommon import Idris.Core.TT import Util.System import Numeric import Data.Char import Data.Bits import Data.List (intercalate) imp...
osa1/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
31,711
0
28
9,074
14,411
7,168
7,243
570
24
module BST () where import Language.Haskell.Liquid.Prelude {-@ data Bst [blen] k v <l :: x0:k -> x1:k -> Prop, r :: x0:k -> x1:k -> Prop> = Empty | Bind (key :: k) (value :: v) (left :: Bst <l, r> (k <l key>) v) (right :: Bst <l, r> (k <r key>) v) @-} {-@ measure blen :: (Bst k...
ssaavedra/liquidhaskell
tests/pos/BST.hs
bsd-3-clause
2,233
2
13
740
833
414
419
42
2
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.StablePtr -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maint...
beni55/haste-compiler
libraries/ghc-7.8/base/Foreign/StablePtr.hs
bsd-3-clause
1,913
0
5
416
105
83
22
10
0
{-# LANGUAGE OverloadedStrings #-} import Network.Wai import Network.Wai.Handler.Warp import Blaze.ByteString.Builder (fromByteString) main = run 3000 $ const $ return $ responseBuilder status200 [("Content-Type", "text/html")] $ fromByteString "<form method='post' enctype='multipart/form-data'><textarea n...
jberryman/wai
warp/attic/undrained.hs
mit
371
0
9
44
66
37
29
8
1
{-# OPTIONS_GHC -Wmissing-signatures -Werror -Wwarn=missing-signatures #-} module Werror02 where -- this should generate missing-signatures warning foo () = ()
ezyang/ghc
testsuite/tests/warnings/should_compile/Werror02.hs
bsd-3-clause
161
0
6
20
18
11
7
3
1
{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} module T7171 where import T7171a import Data.ByteString -- this works -- test1 :: [Int] -> [Int] -- test1 = test -- this fails test2 :: ByteString -> ByteString test2 = test
ghc-android/ghc
testsuite/tests/typecheck/should_compile/T7171.hs
bsd-3-clause
254
0
5
44
32
22
10
6
1
module LightSpecular where import qualified Color3 import qualified Direction import qualified Normal import qualified Reflection import qualified Spaces import qualified Specular import qualified Vector3f specularPhong :: Direction.T Spaces.Eye -> Direction.T Spaces.Eye -> Normal.T -> Color3.T -> Float -> Specular.T...
io7m/r2
com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/LightSpecular.hs
isc
1,264
0
14
210
342
176
166
24
1
{-# OPTIONS_GHC -fplugin Foreign.Storable.Generic.Plugin #-} {-# OPTIONS_GHC -fplugin-opt=Foreign.Storable.Generic.Plugin:-crash #-} module Instances where import Types import Foreign.Storable.Generic instance GStorable Flat instance GStorable Nested instance GStorable Nested2
mkloczko/derive-storable-plugin
test/ids/Concrete/Instances.hs
mit
281
0
5
28
36
20
16
8
0
module Rebase.Data.Type.Bool ( module Data.Type.Bool ) where import Data.Type.Bool
nikita-volkov/rebase
library/Rebase/Data/Type/Bool.hs
mit
86
0
5
12
23
16
7
4
0
{-#LANGUAGE DeriveGeneric #-} module Types where import GHC.Generics data Flat = Flat Int Double deriving (Generic) data Flat2 = Flat2 Double Char deriving (Generic) data Nested = Nested Flat Flat2 deriving (Generic) data Nested2 = Nested2 Nested deriving (Generic) type TFlat = Flat type T...
mkloczko/derive-storable-plugin
test/ids/TypeSynonym/Types.hs
mit
364
0
6
85
98
58
40
10
0
{-# LANGUAGE Arrows #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} module OpaleyeDemo.Ids where import Data.Profunctor.Product.TH (makeAdaptorAndInstance) import Opaleye ...
charlydagos/haskell-sql-edsl-demo
code/opaleye/src/OpaleyeDemo/Ids.hs
mit
1,461
0
9
274
283
162
121
24
0
module HOI4.Types ( -- Used by Settings HOI4Data (..) , HOI4State (..) , HOI4Info (..) -- Features , HOI4EvtDesc (..), HOI4Event (..), HOI4Option (..) -- Low level , HOI4Scope (..) , Party (..) -- , AIWillDo (..) -- , AIModifier (..) -- , aiWillDo ...
HairyDude/pdxparse
src/HOI4/Types.hs
mit
4,729
0
11
1,168
693
412
281
-1
-1
module IEEE754 (floatToDecimal) where import Data.Char type Bits = [Int] floatToDecimal :: String -> Float floatToDecimal str = let bits = toBits str f = factor bits e = IEEE754.exponent bits m = mantissa bits (intP, ...
HenningBrandt/Study
IEEE754/IEEE754.hs
mit
2,700
0
13
645
732
399
333
44
2