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
-- -- 14.DataComplex.hs -- R_Functional_Programming -- -- Created by RocKK on 2/13/14. -- Copyright (c) 2014 RocKK. -- All rights reserved. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and...
RocKK-MD/R_Functional_Programming
Sources/14.DataComplex.hs
bsd-2-clause
1,078
2
9
215
112
56
56
10
1
module Warning {-# WARNINg ["This is a module warning", "multi-line"] #-} where {-# Warning foo , bar ["This is a multi-line", "deprecation message", "for foo"] #-} foo :: Int foo = 4 bar :: Char bar = 'c'
mpickering/ghc-exactprint
tests/examples/ghc710/Warning.hs
bsd-3-clause
257
0
4
89
26
17
9
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-| Module : Idris.ASTUtils Description : This implements just a few basic lens-like concepts to ease state updates. Similar to fclabels in approach, just without the extra dependency. Copyright : License : BSD3 Maintainer : The Idris Community. This implements just a...
jmitchell/Idris-dev
src/Idris/ASTUtils.hs
bsd-3-clause
5,482
0
12
1,120
1,223
678
545
74
2
module A5 where import B5 import C5 import D5 main :: Tree Int ->Bool main t = isSame (sumSquares (fringe t)) (sumSquares (B5.myFringe t)+sumSquares (C5.myFringe t))
kmate/HaRe
old/testing/renaming/A5.hs
bsd-3-clause
186
0
11
46
79
41
38
7
1
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, TemplateHaskell, NamedFieldPuns #-} module Distribution.Server.Users.Users ( -- * Users type Users, -- * Construction emptyUsers, addUserEnabled, addUserDisabled, addUser, insertUserAccount, -- * Modification deleteUs...
ocharles/hackage-server
Distribution/Server/Users/Users.hs
bsd-3-clause
11,335
0
17
2,784
2,595
1,357
1,238
189
7
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} module Options (injectDefaults) where import Control.Applicative import qualified Control.Exception as E import Control.Monad import Control.Monad.Trans.Except import ...
s9gf4ult/yesod
yesod-bin/Options.hs
mit
4,897
0
18
1,446
1,339
713
626
73
2
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-} -- |Define a lightweight wrapper, 'Angle', for floating point numeric -- types that comes with a 'Num' instance that wraps around at -- 0 and 2&#x03C0, and properly handles angle differencing. module AngleNum (Angle, angle, fromAngle, toDegrees) where import Dat...
bitemyapp/roshask
Examples/Turtle/src/AngleNum.hs
bsd-3-clause
1,776
0
10
398
689
368
321
-1
-1
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} {-# OPTIONS_GHC -O #-} -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected -- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow, 1997-2006 -- -- Char...
urbanslug/ghc
compiler/utils/Encoding.hs
bsd-3-clause
13,485
0
29
4,009
3,636
1,849
1,787
240
7
{-# LANGUAGE GADTs, KindSignatures, MultiParamTypeClasses, FunctionalDependencies #-} -- Program from Josef Svenningsson -- Just a short explanation of the program. It contains -- some class declarations capturing some definitions from -- category theory. Further down he have a data type for well typed -...
ezyang/ghc
testsuite/tests/gadt/josef.hs
bsd-3-clause
2,385
0
11
611
599
313
286
-1
-1
{-# LANGUAGE ExistentialQuantification, FlexibleInstances, UndecidableInstances #-} -- Tests context reduction for existentials module TestWrappedNode where class Foo a where { op :: a -> Int } instance {-# OVERLAPPABLE #-} Foo a => Foo [a] where -- NB overlap op (x:xs) = op x instance {-# OVERLAPPING #-} Foo ...
olsner/ghc
testsuite/tests/typecheck/should_compile/tc179.hs
bsd-3-clause
668
0
8
174
142
80
62
10
1
{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving, MagicHash, UnboxedTuples #-} -- !!! stress tests of copying/cloning primitive arrays -- Note: You can run this test manually with an argument (i.e. -- ./CopySmallArrayStressTest 10000) if you want to run the stress -- test for longer. {- Test strate...
wxwxwwxxx/ghc
testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs
bsd-3-clause
11,884
0
24
3,678
4,316
2,123
2,193
273
2
-- | -- Module : Interpolate.Parse -- Description : -- Copyright : (c) Jonatan H Sundqvist, 2015 -- License : MIT -- Maintainer : Jonatan H Sundqvist -- Stability : experimental|stable -- Portability : POSIX (not sure) -- -- Created September 30 2015 -- TODO | - Allow nested formats (?) -- - Allo...
SwiftsNamesake/Interpolate
lib/Interpolate/Parse.hs
mit
4,798
0
12
745
817
463
354
42
1
module Magento.Skin ( addSkin ) where import Control.Monad (when) import System.Directory (createDirectoryIfMissing, doesFileExist) import System.FilePath.Posix (joinPath, takeDirectory) import Data.String.Utils (replace) import Magento.Module.Path (skinBasePath) import Magento.Module ( ModuleInfo, getName...
prasmussen/magmod
Magento/Skin.hs
mit
1,292
0
11
246
391
202
189
36
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.List.NonEmpty import Language.SAL main :: IO () main = putStrLn (renderSAL ctx) ctx :: Context ctx = Context "mutex" Nothing body where body = ContextBody $ fromList [tyDecl, modDecl] tyDecl = TypeDecl "PC" (Just tyDef) tyDef = ScalarType $ fr...
GaloisInc/language-sal
examples/mutex.hs
mit
1,645
0
15
403
557
291
266
41
1
{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies, FlexibleContexts #-} module Database.Persist.Class.PersistStore ( PersistStore (..) , getJust , belongsTo , belongsToJust ) where import qualified Prelude import Prelude hiding ((++), show) import qualified Data.Text as T import Control.Monad.Trans....
gbwey/persistentold
persistent/Database/Persist/Class/PersistStore.hs
mit
5,241
0
11
1,074
1,258
677
581
-1
-1
module Data.CapnProto.Units where import Data.Word import Data.Int import Foreign.Ptr -------------------------------------------------------------------------------- type BitCount = Word type BitCount8 = Word8 type BitCount16 = Word16 type BitCount32 = Word32 type BitCount64 = Word64 type ByteCount = Word type Byt...
cstrahan/hs-capnp
src/Data/CapnProto/Units.hs
mit
1,829
0
7
339
427
254
173
67
1
-- Mouad NACIRI -- Master IAO -- TP1: Les n mots les plus fréquents import Data.Char as Char nCommonWords :: Int -> String -> [(String, Int)] nCommonWords _ [] = [] nCommonWords n s = take n . qSort' . compress . qSort . words $ s words' :: String -> [String] words' [] = [] words' xs = let (w, rest) = break Char.is...
NMouad21/HaskellSamples
CommonWords.hs
mit
817
0
14
183
494
267
227
16
1
{-| Module : ParMean2 Description : calculates the mean in parallel Copyright : (c) Fabrício Olivetti, 2017 License : GPL-3 Maintainer : fabricio.olivetti@gmail.com Calculates the mean of every line of a list in parallel. -} module Main where import System.IO import System.Environment import Control.Para...
folivetti/BIGDATA
03 - Paralelo/ParMean2.hs
mit
1,076
0
10
230
298
158
140
23
1
myButLast :: [a] -> a myButLast [x,_] = x myButLast (_:xs) = myButLast xs myButLast _ = error "Need at least two elements"
tamasgal/haskell_exercises
99questions/Problem02.hs
mit
124
0
7
24
56
29
27
4
1
import Data.Char import Data.List ex21 lst = init $ init $ init $ tail lst initials s1 s2 = head s1 : (". " ++ (head s2 : ".")) letterCount s = sum [length x | x <- words s, length x > 2] isPalindrome x = toUppers x == reverse (toUppers x) toUppers s = [toUpper c | c <- s] flipp xss = concat $...
kbiscanic/PUH
lectures/puh-lecture2.hs
mit
746
0
11
210
480
235
245
15
1
-------------------------------------------------------------------------- -- Copyright (c) 2007-2010, ETH Zurich. -- All rights reserved. -- -- This file is distributed under the terms in the attached LICENSE file. -- If you do not find this file, copies can be found by writing to: -- ETH Zurich D-INFK, Haldeneggsteig...
CoryXie/BarrelfishOS
hake/ArchDefaults.hs
mit
11,796
0
19
3,917
3,266
1,724
1,542
235
2
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} import Control.Monad (unless) import Data.Monoid import Data.Version (showVersion) import Options.Applicative import System.Environment (getEnvironment) import ...
erikd/yesod
yesod-bin/main.hs
mit
12,397
0
21
5,044
2,602
1,337
1,265
216
15
module Main where import Control.Applicative import Control.Monad import Network.Google.Api import Network.Google.Drive.File import Network.Google.OAuth2 import System.Environment.XDG.BaseDir import System.FilePath import Drync.Client import Drync.Config import Drync.Options import Drync.Sync main :: IO () main = do...
pbrisbin/drync
main.hs
mit
1,199
0
12
245
340
174
166
40
2
module Command.Migrate (migrateCommand, migrate, currentMigration, migrationRequired) where import Control.Monad (when) import Data.Char import Data.List (genericDrop, genericLength) import Data.Maybe (fromJust) import Data.UUID (toString) import Data.UUID.V1 (nextUUID) import Database.HDBC import Database.HDBC.Sqlite...
jpotterm/manila-hs
src/Command/Migrate.hs
cc0-1.0
5,364
0
14
1,209
833
439
394
71
3
module Probability.ProbabilityMeasure.Macro where import Types import Macro.Tuple import Functions.Application.Macro import Probability.Intro.Macro import Probability.SigmaAlgebra.Macro -- * Probability space -- | Probabilty space given a universe, sigma algebra a...
NorfairKing/the-notes
src/Probability/ProbabilityMeasure/Macro.hs
gpl-2.0
753
0
7
171
141
84
57
18
1
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-} {- | Module : $Header$ Description : logic instance for FPL Copyright : (c) Christian Maeder, DFKI GmbH 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portab...
nevrenato/Hets_Fork
Fpl/Logic_Fpl.hs
gpl-2.0
3,028
0
7
736
579
293
286
67
0
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} module Sound.SC3.Server.State.Monad.Command ( -- * Requests Request , R.exec , R.exec_ , Result , R.extract -- * Master con...
kaoskorobase/hsc3-server
Sound/SC3/Server/State/Monad/Command.hs
gpl-2.0
23,367
0
15
5,126
7,054
3,716
3,338
446
2
module StationCrawler.Queuers where import StationCrawler.Types import Types import qualified Data.Map.Strict as M queueTrains :: StationState -> TrainId -> StationState queueTrains state trainId = if not . M.member trainId $ visited then state { trainsLeftToVisit = trainId : (trainsLeftToVisit state) ...
mkawalec/infopassenger-crawler
src/StationCrawler/Queuers.hs
gpl-3.0
775
0
10
164
197
108
89
18
2
-- sth-escape: replace non-printable, non-ascii chars on stdin with c escape sequences module Main where import System.Exit (exitSuccess) import System.Environment (getArgs) import STH.Lib (charFilter, lineFilter, bsEsc) main :: IO () main = do args <- getArgs case args of ["--char"] -> charFilter bsEsc ...
nbloomf/st-haskell
src/STH/Escape/Main.hs
gpl-3.0
370
0
10
71
94
51
43
12
2
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Text.BlogLiterately.Image -- Copyright : (c) 2012 Brent Yorgey -- License : GPL (see LICENSE) -- Maintainer : Brent Yorgey <byorgey@gmail.com>...
byorgey/BlogLiterately
src/Text/BlogLiterately/Image.hs
gpl-3.0
5,409
0
25
1,571
1,257
651
606
103
6
{- Copyright (C) 2009 John Millikin <jmillikin@gmail.com> 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 3 of the License, or any later version. This program is ...
astro/network-protocol-xmpp
Network/Protocol/XMPP/Stanzas.hs
gpl-3.0
4,169
54
13
810
1,256
707
549
105
2
import Data.List import Data.Maybe import Data.Time import Control.Monad import Control.Exception import Control.Applicative import System.Process import System.Directory import System.Environment import System.Exit run :: CreateProcess -> String -> IO () run x err = do (_, _, _, h) <- createProcess x exitCode...
mikeplus64/plissken
doc/log/Add.hs
gpl-3.0
1,200
0
13
355
357
178
179
36
2
module Export2 where data Number = Three three :: Int three = 2
roberth/uu-helium
test/correct/Export2.hs
gpl-3.0
66
0
5
15
21
13
8
4
1
{- Copyright 2013 Matthew Gordon. This file is part of Gramophone. Gramophone 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 your option) any later v...
matthewscottgordon/gramophone
src/Gramophone/Core.hs
gpl-3.0
6,259
0
30
1,972
1,277
656
621
103
6
{- Name: Njagi Mwaniki Resources: Learn You A Haskell: Monoid, Functors, Applicative Functors and Monads Aeson tutorial - FPcomplete Aeson Documentation - Hackage -} {-# LANGUAGE DeriveGeneric, OverloadedStrings #-} module HW06 where import Data.Aeson import Data.Monoid import GHC.Generics impo...
urbanslug/cs194
Src/Week6/HW06.hs
gpl-3.0
4,846
0
12
1,219
1,113
584
529
81
2
{- (c) The AQUA Project, Glasgow University, 1994-1998 \section[ErrsUtils]{Utilities for error reporting} -} {-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} module U.ErrUtils (MsgDoc, Messages, ErrMsg, mkWarnMsg, makeIntoWarning, ...
shayan-najd/HsParser
U/ErrUtils.hs
gpl-3.0
2,639
0
11
660
396
239
157
44
1
-- |Implements Weber–Fechner law for per weight perception. Using S0 -- of 1, k of 1. See more information: -- http://en.wikipedia.org/wiki/Weber%E2%80%93Fechner_law module WeberFechner (weberFechnerTable,cTable) where import Data.List (intercalate) humanBits :: Integer pwmBits :: Integer s0 :: Integer huma...
elovalo/elovalo
helpers/WeberFechner.hs
gpl-3.0
1,151
0
12
223
260
142
118
20
1
module WebParsing.ParsecCombinators (getCourseFromTag, findCourseFromTag, getPostType, getDepartmentName, isDepartmentName, generalCategoryParser, parseCategory, postInfoParser, text, parseAll) where import qualified Text.Parsec as P import Text.Parsec ((<|>)) import qualifi...
hermish/courseography
app/WebParsing/ParsecCombinators.hs
gpl-3.0
3,828
0
17
801
1,300
641
659
99
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-plus-domains/gen/Network/Google/Resource/PlusDomains/Circles/List.hs
mpl-2.0
3,851
0
15
871
489
292
197
70
1
{-# LANGUAGE TemplateHaskell, CPP #-} -- | -- Module : Main -- Copyright : (c) 2013 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 ...
brendanhay/ligature
src/Main.hs
mpl-2.0
3,982
0
13
1,013
1,137
583
554
-1
-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/RegionOperations/Delete.hs
mpl-2.0
3,758
0
16
858
467
278
189
76
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QRegion.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:34 Warning : this file is machine generated - do not m...
uduki/hsQt
Qtc/Enums/Gui/QRegion.hs
bsd-2-clause
2,334
0
18
520
589
298
291
51
1
module Lecture.DT.April15Spec (main, spec) where import Lecture.DT.April15 import Test.Hspec import Test.QuickCheck import Test.QuickCheck.Instances main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction" $ do it "should work fine" $ do property someFunction someFunction :: Bool ...
athanclark/dt-haskell-intro
test/Lecture/DT/April15Spec.hs
bsd-3-clause
367
0
13
70
118
63
55
14
1
{-# OPTIONS_GHC -Wall #-} module Kitesys where import Classy --import Classy.State hiding ( run ) --import Control.Monad.State --import qualified Data.HashMap.Lazy as HM carouselSys :: IO System carouselSys = getSystemT $ do n <- newtonianBases rArm <- addParam "rArm" delta <- addCoord "d" _ <- derivIsSpeed...
ghorn/classy-dvda
src/Kitesys.hs
bsd-3-clause
3,195
0
15
664
1,177
549
628
84
1
--*- haskell -*- data Maybe a = Nothing | Just a data Ordering = LT | EQ | GT type ShowS = String -> String class Show a where showsPrec :: Int -> a -> ShowS show :: a -> String showsPrec _ x s = show x ++ s show x = showsPrec 0 x "" instance Show Int where showsPrec p n = if n < 0...
irori/hs2lazy
examples/hs2lazy-prelude.hs
bsd-3-clause
4,571
19
14
1,548
2,631
1,360
1,271
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.ByteString hiding (map) import qualified System.Network.ZMQ.MDP.Worker as W import Data.Foldable import Control.Concurrent.Thread.Group as TG import System.Posix.Signals import qualified Control.Concurrent as CC import quali...
mwotton/majordomo
src/echoworker.hs
bsd-3-clause
872
0
20
199
274
147
127
24
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module YX.Type.BuildTool where import Prelude (Bounded, Enum) import Control.Applicative (empty, pure) import Data.Eq (Eq) import Data.Function (($), (.)) import Data.Maybe (Maybe(Just, N...
trskop/yx
src/YX/Type/BuildTool.hs
bsd-3-clause
1,683
0
9
287
450
262
188
44
3
module Tct.Its.Processor.Sizebounds ( sizebounds , sizeboundsDeclaration ) where --import qualified Data.Graph.Inductive.Dot as Gr import Data.Maybe (fromMaybe) import qualified Tct.Core.Common.Pretty as PP import qualified Tct.Core.Common.Xml as...
ComputationWithBoundedResources/tct-its
src/Tct/Its/Processor/Sizebounds.hs
bsd-3-clause
4,865
0
14
940
1,160
621
539
-1
-1
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.IBM.RasterposClip -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabilit...
haskell-opengl/OpenGLRaw
src/Graphics/GL/IBM/RasterposClip.hs
bsd-3-clause
663
0
5
91
47
36
11
7
0
{-# LANGUAGE OverloadedStrings #-} -- ----------------------------------------------------------------------------- -- | -- Module : Ircfs.Filesystem -- Copyright : (c) Andreas-Christoph Bernstein 2011 -- License : BSD3-style (see LICENSE) -- -- Maintainer : andreas.bernstein@googlemail.com -- Stability...
bernstein/ircfs
Ircfs/Filesystem.hs
bsd-3-clause
11,312
0
19
3,239
3,508
1,827
1,681
233
3
{-# LANGUAGE OverloadedStrings #-} module Text.Domain.Parser ( Domain , domain ) where import Prelude hiding (takeWhile) import Control.Applicative import Control.Monad import Data.Char (isAscii, isDigit) import Data.Text (Text) import qualified Data.Text as T import Data.Attoparsec.Text import qualified...
abbradar/smtp
src/Text/Domain/Parser.hs
bsd-3-clause
1,200
0
14
237
359
190
169
29
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE OverlappingInstances #-} module Math.Metric.Metric where import Math.Coordinate.Coordinate --(...
wdanilo/algebraic
src/Math/Metric/Metric.hs
bsd-3-clause
1,032
0
9
229
142
83
59
15
1
module Module3.Task6 where groupElems :: Eq a => [a] -> [[a]] groupElems = iter [] where iter a [] = reverse a iter [] (x:xs) = iter [[x]] xs iter ((y:ys):yss) (x:xs) | x == y = iter ((x:y:ys):yss) xs | otherwise = iter ([x]:(y:ys):yss) xs
dstarcev/stepic-haskell
src/Module3/Task6.hs
bsd-3-clause
282
0
13
88
187
98
89
8
3
{-# LANGUAGE TypeFamilies #-} ---------------------------------------------------------------------- -- | -- Module : Data.Functor.Representable.Trie.Vector -- Copyright : (c) Edward Kmett 2011 -- License : BSD3 -- -- Maintainer : ekmett@gmail.com -- Stability : experimental -- -- a trie for zerole...
ekmett/representable-tries
src/Data/Functor/Representable/Trie/Vector.hs
bsd-3-clause
4,284
8
23
884
1,829
929
900
-1
-1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} module Test.ZM.ADT.NonEmptyList.Kbf2d1c86eb20 (NonEmptyList(..)) where import qualified Prelude(Eq,Ord,Show) import qualified GHC.Generics import qualified Flat import qualified Data.Model data NonEmptyList a = Elem a | Cons a (Tes...
tittoassini/typed
test/Test/ZM/ADT/NonEmptyList/Kbf2d1c86eb20.hs
bsd-3-clause
527
0
9
80
142
87
55
11
0
{-# LANGUAGE TupleSections #-} import CoreSyn import CoreUtils import Id import Type import MkCore import CallArity (callArityRHS) import MkId import SysTools import DynFlags import ErrUtils import Outputable import TysWiredIn import Literal import GHC import Control.Monad import Control.Monad.IO.Class import System.En...
gcampax/ghc
testsuite/tests/callarity/unittest/CallArity1.hs
bsd-3-clause
9,340
0
25
2,812
4,145
2,281
1,864
195
2
{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, FlexibleInstances #-} module OfficeClimate.TemperatureReport where import Database.HDBC.Query.TH (defineTableFromDB) import Database.HDBC.Schema.PostgreSQL (driverPostgreSQL) import Database.Record.TH (derivingShow) import OfficeClimate.Connection (connect) $(def...
igrep/office-climate
src/OfficeClimate/TemperatureReport.hs
bsd-3-clause
414
0
8
31
73
44
29
7
0
{- | - Module : Types.Internal.Username - Description : Representation of an IRC username. - Copyright : (c) Magnus Stavngaard, 2017 - License : BSD-3 - Maintainer : magnus@stavngaard.dk - Stability : experimental - Portability : POSIX - - An IRC username is a non-empty string of characters not i...
bus000/Dikunt
src/Types/Internal/Username.hs
bsd-3-clause
1,594
0
9
298
316
182
134
23
2
-- -- Unshipping Docker -- -- Copyright © 2014 Operational Dynamics Consulting, Pty Ltd and Others -- Copyright © 2014 Anchor Systems, Pty Ltd and Others -- -- The code in this file, and the program it is a part of, is -- made available to you by its authors as open source software: -- you can redistribute it and/or mo...
afcowie/detour
src/RuntimeProgram.hs
bsd-3-clause
2,977
0
14
819
527
284
243
68
3
module BowlingGame.KataSpec (spec) where import Test.Hspec import BowlingGame.Kata (roll, score, startGame, Game) spec :: Spec spec = describe "Bowling Game" $ do it "processes gutter game" $ score (rollMany 20 0 startGame) `shouldBe` 0 it "processes al...
Alex-Diez/haskell-tdd-kata
BowlingGameKata/BowlingGameDay03/test/BowlingGame/KataSpec.hs
bsd-3-clause
1,020
0
15
345
330
167
163
23
1
{-# LANGUAGE CPP #-} module Rumpus.Types where import Control.Monad.Trans import Graphics.GL.Pal import Data.IORef import Data.Time versionString :: String versionString = "0.2.0" isInReleaseMode :: Bool #if defined(RUMPUS_RELEASE) isInReleaseMode = True #else isInReleaseMode = False #endif isBeingProfiled :: Bool ...
lukexi/rumpus
src/Rumpus/Types.hs
bsd-3-clause
1,080
0
18
241
275
145
130
26
1
module Gittins.Main where import Gittins.Config import Gittins.FilePath import Gittins.Interpreter import Gittins.Process import Gittins.Types import Data.Either (partitionEithers) import Data.List (isPrefixOf, nub) import Data.Maybe (isJust) import Options.Applicative import Options.Applicative.Types (Completer(..)...
bmjames/gittins
src/Gittins/Main.hs
bsd-3-clause
7,463
0
22
2,007
2,264
1,139
1,125
158
8
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Monad import Control.Monad.Remote.JSON import Control.Applicative import Data.Monoid import Data.Aeson import Data.Maybe import Data.Text (Text) import qualified Data.Text.IO as IO import System.Random imp...
roboguy13/remote-json
example/Weak/Untyped.hs
bsd-3-clause
597
0
13
184
138
74
64
20
1
module Utils where import Data.Function (on) import Data.List (sortBy) import System.Random.MWC (GenIO,uniform) import Control.Monad.Primitive (PrimMonad, PrimState) import Numeric.LinearAlgebra.HMatrix (Vector) import qualified Data.Vector.Storable as V multinomial :: Vector Double -- ^ Probabilities of each of t...
DbIHbKA/mnistvb
src/Utils.hs
bsd-3-clause
1,403
0
15
676
369
207
162
35
3
module Parser where import Control.Applicative import Control.Monad import Data.Attoparsec.ByteString (IResult (..), Parser (..), Result (..)) import qualified Data.Attoparsec.ByteString.Char8 as A import Data.ByteString ...
thumphries/weather
src/Parser.hs
bsd-3-clause
3,452
0
12
991
995
521
474
-1
-1
import Distribution.MacOSX import Distribution.Simple import System.Cmd import System.Exit import System.Directory import System.FilePath import System.Info (os) import Control.Monad import Distribution.PackageDescription import Distribution.Simple.Setup import Distribution.Simple import Distribution.Simple.Utils impo...
elbrujohalcon/hPage
Setup.hs
bsd-3-clause
2,888
0
16
879
685
346
339
61
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Type checking of type signatures in interface files -} {-# LANGUAGE CPP #-} module TcIface ( tcLookupImported_maybe, importDecl, checkWiredInTyCon, tcHiBootIface, typecheckIface, tcIfaceDecl, tcIf...
sgillespie/ghc
compiler/iface/TcIface.hs
bsd-3-clause
66,733
299
28
23,060
11,720
6,283
5,437
-1
-1
{-# LANGUAGE BangPatterns #-} import Haha.Term {-Church Number -} type ChNum t = (t -> t) -> t -> t -- ch0 :: ChNum t ch0 = cK cI ch1 :: ChNum t ch1 = cS cB ch0 ch2 :: ChNum t ch2 = cS cB ch1 ch3 :: ChNum t ch3 = cS cB ch2 ch4 :: ChNum t ch4 = cS cB ch3 -- ch :: Int -> ChNum t ch 0 = cK cI ch i = cS cB (ch (i-1)) --...
jaiyalas/haha
experiment/v0.hs
mit
1,509
32
10
415
994
452
542
53
1
-- | -- Copyright : (c) 2017 Egor Tensin <Egor.Tensin@gmail.com> -- License : MIT -- Maintainer : Egor.Tensin@gmail.com -- Stability : experimental -- Portability : Windows-only module Utils.Path ( ExpandedPath(..) , pathExpandValue , pathExpandAll , pathAnyExpanded ) where import Contro...
egor-tensin/windows-env
app/Utils/Path.hs
mit
1,410
0
11
296
317
168
149
30
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} -- | Module for working with dependency trees. module NLP.Partage.AStar.DepTree ( Tree (..) , Dep (..) , mapDep , discard , toRose , fromDeriv ) where import qualified Data.Map.Strict as M import qualif...
kawu/partage
src/NLP/Partage/AStar/DepTree.hs
bsd-2-clause
4,446
0
13
1,080
857
485
372
61
3
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for ganeti-htools. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following condit...
apyrgio/snf-ganeti
test/hs/Test/Ganeti/HTools/Backend/Text.hs
bsd-2-clause
9,754
0
29
2,673
2,226
1,190
1,036
180
5
-- |Note: I copied a lot of this code from another project called -- "tn". So some of the things are named @tnThis@ and @tnThat@. Changing -- the variable names seemed more trouble than it was worth. module Main where import Desbot import Control.Concurrent import Control.Monad (forM_) import ...
pharpend/desbot
bin/Main.hs
bsd-3-clause
5,647
0
19
2,561
924
486
438
-1
-1
{-# LANGUAGE QuasiQuotes #-} module System.Console.CmdArgs.Test.SplitJoin(test) where import System.Console.CmdArgs.Explicit import System.Console.CmdArgs.Test.Util import Control.Monad test = do forM_ tests $ \(src,parsed) -> do let a = splitArgs src b1 = joinArgs parsed b2 = j...
copland/cmdargs
System/Console/CmdArgs/Test/SplitJoin.hs
bsd-3-clause
8,813
0
15
1,444
2,021
1,193
828
114
3
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, DeriveDataTypeable, DeriveFunctor, DeriveTraversable, DeriveFoldable, MultiParamTypeClasses, TypeFamilies #-} -- | -- Defines two variants of @(,)@ with lifted instance...
music-suite/music-score
src/Data/Functor/Couple.hs
bsd-3-clause
5,405
0
9
1,228
1,819
983
836
121
0
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-} module Grammatik.Config where import Language.Syntax import qualified Grammatik.Type as G import Grammatik.Property import Autolib.ToDoc import Autolib.Reader import Data.Typeable data Config = Config { lang :: Language.Syntax.Type , max_length :: ...
Erdwolf/autotool-bonn
src/Grammatik/Config.hs
gpl-2.0
901
6
9
218
188
119
69
24
1
-- | A streaming XML parser, using a method known as SAX. SAX isn't really a -- standard, but an implementation, so it's just an \"SAX-like\" parser. -- This module allows you parse an XML document without having to evaluate -- it as a whole. This is needed for protocols like jabber, which use xml -- streams fo...
alexbaluta/courseography
dependencies/HaXml-1.25.3/src/Text/XML/HaXml/SAX.hs
gpl-3.0
3,311
16
15
697
678
376
302
65
2
#!/usr/bin/env runhugs import Distribution.Simple main = defaultMain
binesiyu/ifl
examples/ch23/Setup.hs
mit
71
1
4
9
15
7
8
2
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TupleSections #-} -- | Names for packages. module Stack.Types.PackageName (PackageName ,Pack...
DanielG/stack
src/Stack/Types/PackageName.hs
bsd-3-clause
5,675
0
20
1,302
1,372
720
652
129
2
module Foo where {-@ LIQUID "--totality" @-} bar :: Int -> Int -> Int bar x y | x > y = 1 | x == y = 0
mightymoose/liquidhaskell
tests/neg/NoExhaustiveGuardsError.hs
bsd-3-clause
113
0
8
39
51
26
25
4
1
module Distribution.Server.Framework.AuthCrypt ( PasswdPlain(..), PasswdHash(..), newPasswdHash, checkBasicAuthInfo, BasicAuthInfo(..), checkDigestAuthInfo, DigestAuthInfo(..), QopInfo(..), ) where import Distribution.Server.Framework.AuthTypes import Distribution.Server.Users.Types (UserName...
mpickering/hackage-server
Distribution/Server/Framework/AuthCrypt.hs
bsd-3-clause
2,474
0
11
568
506
308
198
48
2
{-# LANGUAGE MagicHash, BangPatterns #-} import GHC.Base f :: Int -> Int# -> Int# f x i = i test = let !(I# i) = 3 in I# (f 2 i)
urbanslug/ghc
testsuite/tests/ghci.debugger/scripts/dynbrk009.hs
bsd-3-clause
132
1
11
34
73
33
40
5
1
{-# LANGUAGE GADTs, ExistentialQuantification, ScopedTypeVariables, RankNTypes #-} -- Here's an example from Doaitse Swiestra (Sept 06) -- which requires use of scoped type variables -- -- It's a cut-down version of a larger program -- -- It's also one which was sensitive to syntactic order -- in GHC 6.4...
nkaretnikov/ghc
testsuite/tests/gadt/doaitse.hs
bsd-3-clause
1,615
0
13
543
524
275
249
30
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE Strict #-} -- | The Futhark source language AST definition. Many types, such as -- 'ExpBase'@, are parametrised by type and name representation. -- E.g. in a val...
HIPERFIT/futhark
src/Language/Futhark/Syntax.hs
isc
38,952
0
14
8,747
11,331
6,029
5,302
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} import GTL.Example.FictitiousPlay.Setup import GTL.Data.Time import System.Console.CmdArgs data PDFArgs = PDFArgs { dir :: FilePath , endTime :: Time } deriving (Show, Data, Typeable) pdfArgs = PDFArgs { dir = def &= args &= typ "FILES/DIRS", endTime = 1...
dudebout/game-theoretic-learning
GTL/Example/FictitiousPlay/printAll.hs
isc
494
6
10
130
157
81
76
14
2
module Hage.Geometry where import qualified Graphics.UI.SDL as SDL (Rect(..)) import Hage.Geometry.Types infinity :: Float infinity = 1.0e9 movePoint :: Vector -> Point -> Point movePoint (vx, vy) (px, py) = (px + vx, py + vy) nullVector :: Vector nullVector = (0, 0) mirrorX :: Vector -> Vector mirrorX (vx, vy) =...
Hinidu/Arkanoid
src/Hage/Geometry.hs
mit
1,041
0
11
253
506
281
225
26
1
module HsSearch.FileTypesTest ( getFileTypeTests , getFileTypeFromNameTests ) where import HsSearch.FileTypes import Test.Framework import Test.Framework.Providers.HUnit import Test.HUnit hiding (Test) getFileTypeTests :: IO [Test] getFileTypeTests = do let archiveFile = "archive.zip" let binaryFile = ...
clarkcb/xsearch
haskell/hssearch/test/HsSearch/FileTypesTest.hs
mit
2,074
0
11
384
452
223
229
42
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} module PrettyPrint where import DataDynamic import DataTypeable import Text.PrettyPrint.HughesPJClass import StaticLang as SL -- ======================================================================================= -- | Pretty printer instace for our StaticE...
plclub/cis670-16fa
projects/DynamicLang/src/PrettyPrint.hs
mit
2,204
0
13
555
739
360
379
41
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGPreserveAspectRatio (pattern SVG_PRESERVEASPECTRATIO_UNKNOWN, pattern SVG_PRESERVEASPECTRATIO_NONE, pattern SVG_PRESERVEASPECTRATIO_XMINYMIN, pattern SVG_PRESERVEASPECTRATIO_XMIDY...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGPreserveAspectRatio.hs
mit
3,913
28
8
512
776
451
325
63
1
module Typed.Exception ( module M , pattern Terroras , Term (ExceptionTerm) ) where import Control.Monad import Control.Monad.Catch import qualified Data.Map as M import qualified Data.Tree as T import Preliminaries import Typed.Simply as M (pattern Ttrue, pattern Tfalse, pattern Tif, pattern Kbool, pattern Tv...
myuon/typed
tapl/src/Typed/Exception.hs
mit
3,013
0
16
892
1,306
636
670
-1
-1
{-# htermination (foldl1 :: (a -> a -> a) -> (List a) -> a) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil foldl :: (a -> b -> a) -> a -> (List b) -> a; foldl f z Nil = z; foldl f z (Cons x xs) = foldl f (f z x) xs; foldl1 :: (a -> a -> a) -> ...
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/foldl1_1.hs
mit
376
3
9
121
199
97
102
8
1
{-# LANGUAGE TupleSections #-} module Examples.GGM where import Examples.Goldreich import Circuit import Circuit.Builder import Circuit.Utils import Control.Monad import Control.Monad.Trans import Text.Printf export :: Gate g => [(String, [IO (String, Circuit g)])] export = [ ("big_ggm", [("ggm_4_128" ,) <$> g...
spaceships/circuit-synthesis
src/Examples/GGM.hs
mit
6,024
0
16
2,069
1,973
1,032
941
106
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module WS.Types where import Control.Applicative ((<$>), (<*>)) import Data.Aeson import Data.Aeson.Types import Data.Fixed (Pico) import Data.Ser...
krdlab/haskell-webapp-testing-experimentation
src/WS/Types.hs
mit
2,801
0
9
659
680
385
295
79
1
{-# Language NoImplicitPrelude #-} module Peano where import Prelude import Data.Monoid class Monoid a => Semiring a where sone :: a stimes :: a -> a -> a data Nat = Zero | Succ Nat deriving (Show, Read, Eq, Ord) instance Monoid Nat where mempty = Zero mappend = plus instance Semiring ...
passy/peano
src/Peano.hs
mit
1,100
0
9
286
426
226
200
39
1
-- specs.hs {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Specs where import qualified Database.Persist.TH as TH...
kubkon/conduit-persistent-example
specs.hs
mit
450
0
8
86
55
36
19
10
0
module Main where import Test.Hspec import TestNeuron main :: IO() main = do testNeuron
mckeankylej/hwRecog
test/Main.hs
mit
93
0
6
19
30
17
13
6
1
{-# LANGUAGE NegativeLiterals #-} import Data.Int -- Intermission: Exercises --1. Given a datatype data BigSmall = Big Bool | Small Bool deriving (Eq, Show) -- What is the cardinality of this datatype? Hint: We already know Bool’s -- cardinality. Show your work as demonstrated earlier. -- 4 -- 2. Given a data...
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/11_08.hs
mit
1,583
1
9
313
111
69
42
11
1
validBraces :: String -> Bool validBraces = f [] where isOpen x = x == '(' || x == '{' || x == '[' isMatch x y = x == '(' && y == ')' || x == '{' && y == '}' || x == '[' && y == ']' f [] [] = True f _ [] = False f st (x:xs) = if isOpen x then f (x:st) xs else not (nul...
delta4d/codewars
kata/valid-braces/Braces.hs
mit
369
1
15
141
230
107
123
10
4
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} module PostgREST.Error (PgError, pgErrResponse, errResponse) where import Data.Aeson ((.=)) import qualified Data.Aeson as JSON import Data.String.Conver...
NikolayS/postgrest
src/PostgREST/Error.hs
mit
3,484
0
11
752
1,137
615
522
69
23
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module Tests.Codegen ( verifyCodegen , verifyCppCodegen , verifyCppGrpcC...
sapek/bond
compiler/tests/Tests/Codegen.hs
mit
7,770
0
17
1,850
1,849
972
877
162
9
module Transformations.Basic where import Komposition import Data.Vect.Float import Data.Vect.Float.Util.Dim2 (angle2, rotMatrix2) type Transformation = Vec2 -> Vec2 -- Apply a transformation, work like they do in Processing transform :: Transformation -> Komposition a -> Komposition a transform t (Komposition f) = ...
Vetii/Komposition
Transformations/Basic.hs
gpl-2.0
1,267
0
13
238
506
270
236
31
1