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 TCompile where import Utils import Parser import qualified Data.Map as HashTable type HashTable a = HashTable.Map String a type FuncTable = HashTable (Type, [Type]) data Op = OpOp String | OpFunc | OpParam Int Bool | OpCall | OpRet | OpEnd | OpJr | OpPAt | OpGet | OpAloc Int | OpAt | OpJp | OpLb | OpIf...
gangsterveggies/julia-pinheiro-compiler
TCompile.hs
gpl-2.0
8,721
0
18
2,815
3,557
1,958
1,599
129
1
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid 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 Lice...
karamellpelle/grid
source/Game/LevelPuzzle/Helpers/Make.hs
gpl-3.0
8,891
0
16
3,080
1,530
822
708
157
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/DescribeLogGroups.hs
mpl-2.0
5,207
0
12
1,103
672
401
271
73
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/HTTPSHealthChecks/List.hs
mpl-2.0
6,854
0
18
1,484
678
409
269
98
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-servicebroker/gen/Network/Google/Resource/ServiceBroker/SetIAMPolicy.hs
mpl-2.0
5,258
0
16
1,178
780
456
324
112
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Jobs/Patch.hs
mpl-2.0
6,654
0
22
1,597
1,023
595
428
149
1
{-# LANGUAGE FlexibleInstances, GADTs, MultiParamTypeClasses #-} {- Copyright (C) 2010, 2011, 2012 Jeroen Ketema and Jakob Grue Simonsen This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either ...
jeroenk/iTRSsImplemented
RuleAndSystem.hs
agpl-3.0
5,538
0
12
1,273
1,422
743
679
89
2
module Stack where import Data.Maybe; push :: [a] -> a -> [a] push xs x = x:xs pop :: [a] -> (Maybe a, [a]) pop [] = (Nothing, []) pop (x:xs) = (Just x, xs) back :: [a] -> Maybe a back [] = Nothing back (x:xs) = Just x size :: [a] -> Int size = length clear :: [a] -> [a] clear xs = [] exit :: [a] -> Int exit xs ...
SeTSeR/Structures
Stack/Stack.hs
lgpl-2.1
1,517
31
16
424
796
433
363
47
8
{-# OPTIONS_GHC -Wno-unused-do-bind #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -Wno-missing-pattern-synonym-signatures #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GADTs #-} {-# LANGUA...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/fix-free/2016-01-benjamin-hodgson-parsing-to-free-monads/HMF.hs
unlicense
3,104
64
13
781
816
442
374
71
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} -- | This module contains API handlers pertaining to the 'Account' object module Handlers.Account ( -- * API handlers listAccountsHandler, showAccountHandler, createAccountHandler, updateAccountHandler, deleteAccountHandler, ...
b0d0nne11/hauth
src/Handlers/Account.hs
apache-2.0
2,670
0
9
735
447
236
211
56
1
{- © Utrecht University (Department of Information and Computing Sciences) -} module Domain.Scenarios.Parser where import Data.Char import Data.Either import qualified Data.Foldable as F import Data.List import qualified Data.List.NonEmpty as N import qualified Data.Map as M import Data.Maybe import Data.Monoid hidin...
UURAGE/ScenarioReasoner
src/Domain/Scenarios/Parser.hs
apache-2.0
18,580
1
15
3,843
4,159
2,154
2,005
293
6
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} -- | Pretty printing class and instances for CoreHW module CLaSH.Core.Pretty ( Pretty (..) , showDoc ) where import Data.Char (isSymbol, isUpper, ord)...
christiaanb/clash-compiler
clash-lib/src/CLaSH/Core/Pretty.hs
bsd-2-clause
11,233
0
17
3,164
4,396
2,202
2,194
270
3
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module ULCPretty ( ppexpr ) where import Text.PrettyPrint import ULCSyntax class Pretty p where ppr :: Int -> p -> Doc pp :: p -> Doc pp = ppr 0 viewVars :: Expr -> [Name] viewVars (Lam n a) = n : viewVars a viewVars _ = [] viewBody...
toonn/wyah
src/ULCPretty.hs
bsd-2-clause
978
0
16
333
411
205
206
34
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTextDocumentFragment.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:16 Warning : this file is machine genera...
uduki/hsQt
Qtc/Gui/QTextDocumentFragment.hs
bsd-2-clause
5,577
0
13
726
1,267
658
609
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Utils.Vigilance.TypesSpec (spec) where import Test.QuickCheck.Property.Common.Internal (Equal) -- bah no import Data.Aeson import SpecHelper spec :: Spec spec = parallel $ do describe "Monoid WatchState" $ do prop "obeys the law" $ property $ eq $ prop_Monoid (T ...
MichaelXavier/vigilance
test/Utils/Vigilance/TypesSpec.hs
bsd-2-clause
2,821
0
20
787
755
368
387
-1
-1
{-# LANGUAGE PatternGuards #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Convert -- Copyright : (c) Isaac Dupree 2009, -- License : BSD-like -- -- Maintainer : haddock@projects.haskell.org -- Stability : experimental -- Portability : porta...
nominolo/haddock2
src/Haddock/Convert.hs
bsd-2-clause
11,829
0
19
2,844
2,309
1,206
1,103
188
9
{- | Module : SAWScript.Crucible.JVM.ResolveSetupValue License : BSD3 Maintainer : atomb Stability : provisional -} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} module...
GaloisInc/saw-script
src/SAWScript/Crucible/JVM/ResolveSetupValue.hs
bsd-3-clause
10,385
0
20
2,639
2,967
1,487
1,480
-1
-1
-- Copyright : Daan Leijen (c) 1999, daan@cs.uu.nl -- HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net -- License : BSD-style module Opaleye.Internal.HaskellDB.PrimQuery where import qualified Opaleye.Internal.Tag as T import Data.ByteString (ByteString) type TableName = String type ...
benkolera/haskell-opaleye
src/Opaleye/Internal/HaskellDB/PrimQuery.hs
bsd-3-clause
3,182
0
8
1,319
544
338
206
67
0
{-# LANGUAGE FlexibleContexts #-} module Mapping -- (DBMapping, mappingFind, findRowIO, getColValueFromRow) where import Database.HDBC import Database.HDBC.ODBC import Data.Maybe --import Data.Convertible.Base import Database.HDBC.SqlValue {-| This is a first pass attempt at creating a mapping that can ...
timmyw/lapputils
src/Mapping.hs
bsd-3-clause
3,268
0
14
945
628
316
312
48
2
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} module Talks.Free.LanguageExample where import Control.Monad.Free import Data.Maybe import Data.Text import Talks.Free.Prelude import Talks.Free.Language program :: Free Language (Maybe Text, Maybe Text, Maybe Text) program = do genPw Nothing "p1" genPw (Ju...
markhibberd/fp-syd-free
src/Talks/Free/LanguageExample.hs
bsd-3-clause
696
0
9
145
225
110
115
24
1
-- !!! Testing Ptr arithmetic and shows import Foreign.Ptr testShowAndPlus :: IO () testShowAndPlus = sequence_ [putStrLn (show64 (nullPtr `plusPtr` i)) | i <- [-100..100]] show64 :: Ptr a -> String show64 p = case show p of '0':'x':xs -> '0':'x':pseudoSignExtend xs pseudoSignExtend :: String -> String pseu...
FranklinChen/Hugs
tests/libs/testPtr.hs
bsd-3-clause
413
0
11
92
164
83
81
12
2
-- | Generate profiles and cross sections of solid models. module Language.Mecha.Profile ( profile , crossSection , Point , Line ) where import System.Directory import System.Process import Language.Mecha.Export import Language.Mecha.Solid (Solid) -- | Project profile to x-y plane and extract line data fro...
tomahawkins/mecha
Language/Mecha/Profile.hs
bsd-3-clause
1,289
0
20
286
433
231
202
33
3
module Categorizer.Util.Maybe ( readSafe ) where readSafe :: Read a => String -> Maybe a readSafe s = case reads s of [(x, _)] -> Just x _ -> Nothing
ameingast/categorizer
src/Categorizer/Util/Maybe.hs
bsd-3-clause
177
0
9
57
70
37
33
7
2
module Blockchain.Data.Code where import Blockchain.Data.RLP import qualified Data.ByteString as B newtype Code = Code{codeBytes::B.ByteString} deriving (Show, Eq) instance RLPSerializable Code where rlpEncode (Code bytes) = rlpEncode bytes rlpDecode = Code . rlpDecode
jamshidh/ethereum-data-leveldb
src/Blockchain/Data/Code.hs
bsd-3-clause
284
0
8
46
81
48
33
7
0
module Mime ( combineParts ) where combineParts :: String -> String -> String combineParts textContent htmlContent = textContent ++ htmlContent
jdagilliland/md2multipart
Mime.hs
bsd-3-clause
150
0
6
26
36
20
16
5
1
module Main where import AikatsuTypes import Smile main :: IO () main = do print "ai!katsu!"
spinningfire/aikatsu
app/Main.hs
bsd-3-clause
103
0
7
26
31
17
14
6
1
{-# LANGUAGE CPP #-} module Options.Applicative.Builder ( -- * Parser builders -- -- | This module contains utility functions and combinators to create parsers -- for individual options. -- -- Each parser builder takes an option modifier. A modifier can be created by -- composing the basic modifiers provi...
d12frosted/optparse-applicative-kb
Options/Applicative/Builder.hs
bsd-3-clause
12,057
0
14
2,630
2,847
1,572
1,275
223
2
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} modul...
showpoint/refs
src/Main.hs
bsd-3-clause
971
0
12
193
249
134
115
32
1
----------------------------------------------------------------------------- -- | -- Module : Data.Matrix.Class.IMatrix -- Copyright : Copyright (c) , Patrick Perry <patperry@stanford.edu> -- License : BSD3 -- Maintainer : Patrick Perry <patperry@stanford.edu> -- Stability : experimental -- -- An overloaded i...
patperry/hs-linear-algebra
lib/Data/Matrix/Class/IMatrix.hs
bsd-3-clause
823
0
4
175
71
55
16
13
0
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------------------- import Text.Pandoc.JSON import Text.Pandoc ( writeLaTeX ) import Text.Pandoc.Options ( def ...
dfaligertwood/pandoc-filters
pandoc-cv.hs
bsd-3-clause
1,926
0
17
579
443
240
203
47
2
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.Selection -- Copyright : (c) Sven Panne 2002-2005 -- License : BSD-style (see the file libraries/OpenGL/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stability : provi...
FranklinChen/hugs98-plus-Sep2006
packages/OpenGL/Graphics/Rendering/OpenGL/GL/Selection.hs
bsd-3-clause
3,520
4
12
513
799
438
361
-1
-1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ScopedTypeVariables #-} module Test.Tasty.Runners.HPC where ------------------------------------------------------------------------------ import Control.Concurrent.MVar import Control.Exception import ...
imalsogreg/tasty-hpc
src/Test/Tasty/Runners/HPC.hs
bsd-3-clause
4,838
0
25
1,212
982
514
468
77
3
{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} #if __GLASGOW_HASKELL__ >= 706 {-# LANGUAGE PolyKinds #-} ...
omefire/lens
src/Control/Lens/Wrapped.hs
bsd-3-clause
24,672
0
12
4,832
7,196
3,820
3,376
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.Lordown ( module Text.Pandoc.Writers.Lorcode , markdownOptions , markdownExtensions , toLorcode , fromMarkdown , convert ) where import Text.Pandoc import Text.Pandoc.Walk import Text.Pandoc.Writers.Lorcode import qualified Data.Set as S -- | Con...
smaximov/lordown
src/Text/Pandoc/Lordown.hs
bsd-3-clause
1,361
0
9
289
301
173
128
32
1
{-# LANGUAGE GADTs, NoMonomorphismRestriction, ScopedTypeVariables #-} ------------------------------ -- | special actor for IO action ------------------------------ module Control.Monad.Trans.Crtn.IOActor where import Control.Monad.Reader -- import Control.Monad.Trans.Crtn -- import Control.Monad.Trans.Crtn.Event...
wavewave/coroutine-object
src/Control/Monad/Trans/Crtn/IOActor.hs
bsd-3-clause
1,103
0
15
290
359
190
169
20
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-codecommit/gen/Network/AWS/CodeCommit/CreateBranch.hs
mpl-2.0
4,294
0
12
959
564
339
225
78
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fno-cse #-} {-@ LIQUID "--cabaldir" @-} {-@ LIQUID "--diff" @-} -- | This module c...
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/CmdLine.hs
bsd-3-clause
14,075
0
19
4,259
3,092
1,588
1,504
256
4
{-# OPTIONS_GHC -Wall #-} module Optimize.DecisionTree where {- To learn more about how this works, definitely read through: "When Do Match-Compilation Heuristics Matter?" by Kevin Scott and Norman Ramsey. The rough idea is that we start with a simple list of patterns and expressions, and then turn that into a "d...
mgold/Elm
src/Optimize/DecisionTree.hs
bsd-3-clause
11,433
0
19
3,311
2,794
1,478
1,316
274
7
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} ------------------...
wherkendell/diagrams-contrib
src/Diagrams/TwoD/Layout/Tree.hs
bsd-3-clause
25,710
1
18
7,103
5,110
2,864
2,246
237
3
----------------------------------------------------------------------------- -- Standard Library: Array operations -- -- Suitable for use with Hugs 98 ----------------------------------------------------------------------------- module Hugs.Array ( module Data.Ix, -- export all of Ix unsafeIndex, Arra...
kaoskorobase/mescaline
resources/hugs/packages/hugsbase/Hugs/Array.hs
gpl-3.0
3,775
59
13
1,033
1,827
965
862
-1
-1
{-| Module : Idris.Elab.Utils Description : Elaborator utilities. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE FlexibleContexts, PatternGuards #-} module Idris.Elab.Utils where import Idris.AbsSyntax import Idris.Core.Elaborate hiding (Tactic(..)) import Idris.Core.Evaluate ...
markuspf/Idris-dev
src/Idris/Elab/Utils.hs
bsd-3-clause
32,940
40
23
12,078
11,651
5,820
5,831
583
33
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} module TestHpcCoverallsLix where import Test.HUnit import Trace.Hpc.Coveralls.Lix import Trace.Hpc.Coveralls.Types testToHit = "toHit" ~: [ Irrelevant @=? toHit [], None @=? toHit [False], None @=? to...
jdnavarro/hpc-coveralls
test/TestHpcCoverallsLix.hs
bsd-3-clause
665
0
9
160
205
119
86
18
1
-- | -- Language.Haskell.TH.Lib contains lots of useful helper functions for -- generating and manipulating Template Haskell terms -- Note: this module mostly re-exports functions from -- Language.Haskell.TH.Lib.Internal, but if a change occurs to Template -- Haskell which requires breaking the API offered in this mod...
shlevy/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
7,977
0
11
1,758
1,895
1,109
786
159
1
{-# LANGUAGE PackageImports, CPP, LambdaCase, TupleSections, RecordWildCards #-} import Data.IORef import Data.Maybe import Data.Char (toLower) import qualified Data.Map as Map import Control.Concurrent import Control.Monad import System.Environment import System.FilePath import System.Directory import System.IO impo...
csabahruska/quake3
mapviewer/Main.hs
bsd-3-clause
10,835
9
24
2,817
3,086
1,486
1,600
206
7
{-# LANGUAGE CPP #-} {-# OPTIONS_HADDOCK hide #-} module Distribution.Compat.Internal.TempFile ( openTempFile, openBinaryTempFile, openNewBinaryFile, createTempDirectory, ) where import System.FilePath ((</>)) import Foreign.C (eEXIST) import System.IO (Handle, openTempFile...
thoughtpolice/cabal
Cabal/Distribution/Compat/Internal/TempFile.hs
bsd-3-clause
4,660
0
17
1,235
844
466
378
70
5
{-# LANGUAGE DataKinds, GADTs, KindSignatures, RebindableSyntax #-} module Inhabitants (Inhabitable(..), Nat'(..)) where import qualified Prelude as P import Prelude (Show (..), Bool (..), ($), error, undefined, const, (.), flip) import Data.List data Nat' = Z' | S' Nat' class Inhabitable (ent :: Bool -> Nat' -> *)...
cartazio/omega
mosaic/Inhabitants.hs
bsd-3-clause
3,399
0
15
968
1,558
792
766
77
1
test y = let x = 1 in (x, y, y)
themattchan/tandoori
input/class-cascade-let.hs
bsd-3-clause
41
1
8
20
32
15
17
2
1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE ImplicitParams, RankNTypes #-} -- #1445 module Bug where f :: () -> (?p :: ()) => () -> () f _ _ = () g :: (?p :: ()) => () g = f () ()
sdiehl/ghc
testsuite/tests/typecheck/should_compile/tc230.hs
bsd-3-clause
205
0
8
46
81
47
34
7
1
module Opaleye.SQLite.Internal.Optimize where import Prelude hiding (product) import qualified Opaleye.SQLite.Internal.PrimQuery as PQ import qualified Data.List.NonEmpty as NEL optimize :: PQ.PrimQuery -> PQ.PrimQuery optimize = mergeProduct . removeUnit removeUnit :: PQ.PrimQuery -> PQ.PrimQuery remove...
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Internal/Optimize.hs
bsd-3-clause
1,250
0
13
428
368
203
165
25
3
{-# LANGUAGE CPP, Rank2Types, FlexibleContexts, MultiParamTypeClasses #-} -- | -- Module : Data.Vector.Generic.New -- Copyright : (c) Roman Leshchinskiy 2008-2010 -- License : BSD-style -- -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-portable --...
dolio/vector
Data/Vector/Generic/New.hs
bsd-3-clause
5,326
0
11
1,232
1,427
748
679
101
1
----------------------------------------------------------------------------- -- -- Module : IDE.Command.VCS.Common.GUI -- Copyright : 2007-2011 Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GPL Nothing -- -- Maintainer : maintainer@leksah.org -- Stability : provisional -- Portability : --...
573/leksah
src/IDE/Command/VCS/Common/GUI.hs
gpl-2.0
2,322
0
3
705
62
59
3
1
0
{-# LANGUAGE TypeFamilies #-} module ShouldCompile where import Data.Kind (Type) class C1 a where data S1 a :: Type -- instance of data families can be data or newtypes instance C1 Char where newtype S1 Char = S1Char ()
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/Simple7.hs
bsd-3-clause
228
0
7
47
54
31
23
-1
-1
module ListWatched where import qualified Github.Repos.Watching as Github import Data.List (intercalate) import Data.Maybe (fromMaybe) main = do possibleRepos <- Github.reposWatchedBy "mike-burns" putStrLn $ either (("Error: "++) . show) (intercalate "\n\n" . map formatRepo) ...
mavenraven/github
samples/Repos/Watching/ListWatched.hs
bsd-3-clause
890
0
22
186
283
146
137
21
1
module HAD.Y2014.M02.D26.Solution where -- | Sum the value inside the maybe if there aren't any Nothing, -- otherwise return Nothing -- -- Examples -- -- >>> sumIfAll [Just 1, Just 2] -- Just 3 -- -- >>> sumIfAll [Just 1, Nothing] -- Nothing -- sumIfAll :: Num a => [Maybe a] -> Maybe a sumIfAll = fmap sum . sequence ...
1HaskellADay/1HAD
exercises/HAD/Y2014/M02/D26/Solution.hs
mit
321
0
8
63
57
36
21
3
1
{-# LANGUAGE GADTs #-} -- Involves an equality that is not an existential module Foo2 where data T t a where T :: a -> T () a foo :: (a -> a) -> T t a -> T t a foo f (T x) = T (f x) bar :: T t Int -> T t Int bar t@(T _) = foo (+1) t
shlevy/ghc
testsuite/tests/gadt/gadt19.hs
bsd-3-clause
242
0
8
74
128
68
60
8
1
module ShouldCompile where import Foreign -- !!! test that a recursive newtype can be used as an argument or result -- type of a foreign import. newtype T = T (Ptr T) foreign import ccall foo :: T -> IO T
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/ffi/should_compile/cc011.hs
bsd-3-clause
209
0
7
45
40
24
16
4
0
module JoinList where import Data.Monoid import Sized import Scrabble data JoinList m a = Empty | Single m a | Append m (JoinList m a) (JoinList m a) deriving (Eq, Show) -- exercise 1 tag :: Monoid m => JoinList m a -> m tag Empty = mempty tag (Single m _) = m tag (Append m _ _) = m (+++) :: Monoid m =...
dirkz/haskell-cis-194
07/JoinList.hs
isc
2,157
0
12
663
1,101
545
556
67
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TupleSections #-} -- | C code generator framework. module Futhark.CodeGen.Backends.GenericC ( compi...
HIPERFIT/futhark
src/Futhark/CodeGen/Backends/GenericC.hs
isc
74,170
0
19
18,827
18,834
9,979
8,855
1,484
18
module Main where import Debug.Trace (trace) import System.Environment import Parser import Quote import Data.Matrix as M hiding (trace) import Data.List as L import Data.List.Split import Data.Vector as V hiding (foldl) [agpl_f|ttt.agpl|] --[agpl_f|chess.agpl|] --[agpl_f|connect4.agpl|] getMove :: GameState -> IO Mov...
matthew-eads/agpl
Main.hs
isc
1,442
0
19
584
470
254
216
-1
-1
data Tuple a b c d = One a | Two a b | Three a b c | Four a b c d tuple1 :: Tuple a b c d -> Maybe a tuple1 (One a) = Just a tuple1 (Two a b) = Just a tuple1 (Three a b c) = Just a tuple1 (Four a b c d) = Just a tuple2 :: Tuple a b c d -> Maybe...
fossilet/yaht
ex_4.6_4.7.hs
mit
1,128
0
9
410
624
315
309
29
1
{- Part of possum4 Copyright (c) 2014 darkf Licensed under the terms of the MIT license See LICENSE.txt for details -} module IntegrationTests where import Test.HUnit import AST import Parser import Interpreter runSource :: String -> IO Value runSource = interpret . parseStringWith builtinArities actual @??...
darkf/possum4
IntegrationTests.hs
mit
1,483
14
13
308
415
202
213
38
1
{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} {-# OPTIONS_GHC -fplugin GHC.TypeLits.Kn...
nshepperd/funn
AI/Funn/CL/Flat.hs
mit
8,356
1
17
2,550
3,530
1,779
1,751
197
1
{-# LANGUAGE JavaScriptFFI #-} -- | An implementation of the NodeJS elliptic-curve Diffie-Hellman API, as -- documented <https://nodejs.org/api/crypto.html#crypto_class_ecdh here>. module GHCJS.Node.Crypto.ECDH ( module GHCJS.Node.Crypto.ECDH -- FIXME: specific export list ) where import GHCJS.Array i...
taktoa/ghcjs-electron
src/GHCJS/Node/Crypto/ECDH.hs
mit
1,338
5
7
243
106
69
37
13
0
module Quark.Debug where import System.Directory ( getHomeDirectory ) import System.FilePath ( joinPath ) dbgFile :: IO FilePath dbgFile = (\h -> joinPath [h, "quarkDebug.log"]) <$> getHomeDirectory dbgClear :: IO () dbgClear = (\p -> writeFile p "") =<< dbgFile dbg :: String -> IO () dbg s = (\p -> appendFile p s)...
sjpet/quark
src/Quark/Debug.hs
mit
334
0
9
60
131
72
59
9
1
import qualified System.Environment as Env import qualified System.IO as IO import qualified Data.Maybe as Maybe import qualified Calcul main :: IO () main = do args <- Env.getArgs pure_main args where pure_main :: [String] -> IO () pure_main args | length args == 1 = inner ...
Engil/Integ
haskell/main.hs
mit
816
0
14
323
260
133
127
23
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE LambdaCase #-} -------------------------------------------------------------------- -- | -- Module : Data.Ruby.Marshal.RubyObject -- Copyright : (c) Philip Cunningham, 2015 -- License : MIT -- -- Maintainer: hello@fil...
filib/ruby-marshal
src/Data/Ruby/Marshal/RubyObject.hs
mit
3,796
0
14
1,030
969
527
442
97
0
module TypeInference1 where f :: Num a => a -> a -> a f x y = x + y + 3 g x y = x + y + 3 -- Intermission: Exercises -- Look at these pairs of functions. One function is unapplied, so the compiler -- will infer maximally polymorphic type. The second func- tion has been applied -- to a value, so the inferred type si...
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/05_07.hs
mit
1,121
0
8
269
217
122
95
14
1
{-# LANGUAGE NamedFieldPuns #-} module Sajson ( Value , Array , Object , ParseError (..) , Type (..) , parse , typeOf , asArray , asObject , asInt , asDouble , asNumber , asString , asByteString , getArrayElement , Sajson.length , numKeys , getObj...
andyfriesen/hs-sajson
src/Sajson.hs
mit
11,691
0
21
3,394
3,397
1,680
1,717
-1
-1
{-# OPTIONS_GHC -fno-warn-deprecations #-} module Network.Wai.Handler.Warp.Internal ( -- * Settings Settings (..) , ProxyProtocol(..) -- * Low level run functions , runSettingsConnection , runSettingsConnectionMaker , runSettingsConnectionMakerSecure , Transport (..) -- * Connection , Conne...
mfine/wai
warp/Network/Wai/Handler/Warp/Internal.hs
mit
2,164
0
5
459
275
207
68
46
0
import System.IO import System.Directory(getTemporaryDirectory, removeFile) import System.IO.Error(catchIOError) import Control.Exception(finally) main :: IO () main = withTempFile "mytemp.txt" myAction myAction :: FilePath -> Handle -> IO () myAction tempname temph = do putStrLn "Welcome to tempfile.hs"...
Bolt64/my_code
haskell/tempfile.hs
mit
1,299
0
12
404
365
171
194
34
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GADTs #-} module WhySomeException where import Control.Exception ( ArithException(..) , AsyncException(..)) import Data.Typeable data MyException = forall e . (Show e, Typeable e) => MyException e instance Show MyException where showsPrec p (MyExce...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter30.hsproj/WhySomeException.hs
mit
960
0
12
224
286
149
137
32
3
{-# LANGUAGE QuasiQuotes #-} module CSPMTypeChecker.TCTests (testHarness, runtests) where import Prelude import CSPMTypeChecker.TCCommon import CSPMTypeChecker.TCBuiltInFunctions import CSPMTypeChecker.TCDependencies import CSPMTypeChecker.TCModule import CSPMTypeChecker.TCMonad import CSPMDataStructures import CSPMP...
tomgr/tyger
src/CSPMTypeChecker/TCTests.hs
mit
8,314
588
28
1,790
4,073
2,319
1,754
74
2
{-| Module : Graphics.Shine.Image Description : Short description Copyright : (c) Francesco Gazzetta, 2016 License : MIT Maintainer : francygazz@gmail.com Stability : experimental Handling of external image (.png, .svg and all browser-supported formats). -} {-# LANGUAGE ForeignFunctionInterface #-} mod...
fgaz/shine
src/Graphics/Shine/Image.hs
mit
1,440
8
7
302
182
109
73
22
1
{-# Language BangPatterns #-} module HaskellCourse.UntypedLC.StrictInterp (interp, Value(..)) where import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe (fromMaybe) import HaskellCourse.Prim import HaskellCourse.UntypedLC.AST data Value = IntV Int | Closure Var Exp Env deriving (Show) type Env =...
joshcough/HaskellCourse
src/HaskellCourse/UntypedLC/StrictInterp.hs
mit
905
0
11
232
400
200
200
22
1
module Reverse where rvrs :: String -> String rvrs x = drop 9 x ++ (drop 5 (take 9 x)) ++ take 5 x main :: IO () main = print $ rvrs "Curry is awesome"
rasheedja/HaskellFromFirstPrinciples
Chapter3/reverse.hs
mit
154
0
10
38
77
39
38
5
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Criterion.Main import qualified Data.ByteString.Lazy as L import Pipes setupProduce :: IO (L.ByteString, L.ByteString, L.ByteString) setupProduce = return ("", "", "") main :: IO () main = defaultMain [ env setupProduce $ \ ~(small, medium, large) -> ...
iand675/pipes-wai
bench/Bench.hs
mit
388
0
10
72
132
75
57
13
1
-- -*- mode: haskell -*- {-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-} module Graph.Col.Config where import Autolib.ToDoc import Autolib.Reader import Data.Typeable data Config = Config { nodes :: Int -- ^ number of nodes , edges :: Int -- ^ number of edges , chi :: Integer -- ^ chr...
Erdwolf/autotool-bonn
src/Graph/Col/Config.hs
gpl-2.0
485
6
9
125
120
74
46
15
1
{-# LANGUAGE CPP, TypeFamilies, DeriveDataTypeable #-} module PGIP.GraphQL.Result.Sentence where import qualified PGIP.GraphQL.Result.Axiom as GraphQLResultAxiom import qualified PGIP.GraphQL.Result.Conjecture as GraphQLResultConjecture import Data.Data data Sentence = Axiom GraphQLResultAxiom.Axiom |...
spechub/Hets
PGIP/GraphQL/Result/Sentence.hs
gpl-2.0
415
0
7
67
67
44
23
8
0
{-# LANGUAGE FlexibleInstances #-} module SMCDEL.Examples.RussianCards where import Control.Monad (replicateM) import Data.HasCacBDD hiding (Top,Bot) import Data.List ((\\),delete,intersect,nub,sort) import Data.Map.Strict (fromList) import SMCDEL.Internal.Help (powerset) import SMCDEL.Language import SMCDEL.Other.P...
jrclogic/SMCDEL
src/SMCDEL/Examples/RussianCards.hs
gpl-2.0
10,075
0
16
2,413
4,577
2,512
2,065
192
7
import Data.List (nub) main :: IO () main = readLn >>= print . solve -- Explicitly calculate every one of the powers and count them solve :: Int -> Int solve p = (length . nub) [ a^b | a <- as p, b <- bs p] -- Define the range for the a and b as, bs :: Int -> [Integer] as p = [2.. fromIntegral p] bs p = [2...
NorfairKing/project-euler
029/haskell/solution.hs
gpl-2.0
339
0
9
87
138
73
65
8
1
module Main where import API (API, RunAPI, runAPI) import Config (Config (..)) import Control.Monad (void) import Control.Monad.IO.Class (MonadIO (..)) import Data.Aeson (eitherDecode) import qualified Data.ByteString.Lazy as BS import Data.Data (Proxy (..)) import Data.List (isSuffixOf) import Network.Wai.Handler.War...
phaazon/phaazon.net
backend/src/Main.hs
gpl-3.0
2,134
0
20
464
657
339
318
-1
-1
{- This file is part of ChaosFlight. ChaosFlight 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 version. ChaosFlight is di...
Marthog/ld34
src/Util.hs
gpl-3.0
1,026
0
7
221
166
94
72
12
1
{-| Description : Rearranging the actual code (not the comments) -} module Language.Haskell.Formatter.Process.FormatActualCode (formatActualCode) where import qualified Control.Applicative as Applicative import qualified Language.Haskell.Formatter.Process.Code as Code import qualified Language.Haskell.Formatter....
evolutics/haskell-formatter
src/library/Language/Haskell/Formatter/Process/FormatActualCode.hs
gpl-3.0
3,522
0
12
801
645
354
291
67
3
{-# LANGUAGE OverloadedStrings #-} -- Copyright (C) 2011 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 lat...
jmillikin/anansi-hscolour
lib/Anansi/HsColour/LaTeX.hs
gpl-3.0
3,059
9
20
630
758
392
366
66
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adsense/gen/Network/Google/Resource/AdSense/Accounts/AdClients/CustomChannels/List.hs
mpl-2.0
6,744
0
18
1,467
889
517
372
133
1
module Data.GI.CodeGen.GObject ( isGObject , apiIsGObject , nameIsGObject , isInitiallyUnowned , apiIsInitiallyUnowned ) where #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif import Data.GI.CodeGen.API import Data.GI.CodeGen.Code import Data.GI.CodeGen.Type -- Returns w...
hamishmack/haskell-gi
lib/Data/GI/CodeGen/GObject.hs
lgpl-2.1
1,817
0
16
442
461
232
229
38
4
-- one import Control.Distributed.Process import Control.Distributed.Process.Node import Network.Transport.TCP (createTransport, defaultTCPParameters) -- two import Control.Concurrent (threadDelay) import Control.Distributed.Process import Control.Distributed.Process.Node import Control.Monad (forever) import Network...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/distributed/tutorials/tutorial1.hs
unlicense
2,422
0
16
614
525
267
258
47
2
-- -- Minio Haskell SDK, (C) 2017 Minio, Inc. -- -- 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 ...
donatello/minio-hs
src/Network/Minio/XmlParser.hs
apache-2.0
9,324
0
16
2,039
2,483
1,233
1,250
164
1
parity :: Bit -> Bit parity input = output where output = xor (delay output) input -- deep embedding data Bit = Xor Bit Bit | Delay Bit | Input [Bool] | Var String deriving Show xor = Xor delay = Delay run :: (Bit -> Bit) -> [Bool] -> [Bool] run f bs = interp (f (Input bs)) interp...
egaburov/funstuff
Haskell/sharing/observable1.hs
apache-2.0
2,828
0
9
648
595
329
266
31
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fsimpl-tick-factor=200 #-} module RandomDates.Random ( randomDate , generateData ) where import Control.Applicative import Control.Monad import qualified Data.HashMap.Strict as M import qualified Data.Text ...
erochest/random-dates
src/RandomDates/Random.hs
apache-2.0
1,654
0
18
655
438
227
211
35
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} module Spark.Core.Internal.ProtoUtils(ToProto(..), FromProto(..), extractMaybe, extractMaybe') where import Data.ProtoLens.Message(Message(descriptor), MessageDescriptor(messageName)) import Lens.Family2 ((...
tjhunter/karps
haskell/src/Spark/Core/Internal/ProtoUtils.hs
apache-2.0
1,448
0
15
251
457
253
204
-1
-1
{-# LANGUAGE TypeFamilies, StandaloneDeriving, RecordWildCards, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Hoodle.BBox -- Copyright : (c) 2011, 2012 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gm...
wavewave/hoodle-types
src/Data/Hoodle/BBox.hs
bsd-2-clause
7,256
0
13
1,744
2,781
1,524
1,257
157
5
{-# LANGUAGE RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} module Network.HTTP.Client.Lens.Internal where import Control.Applicative import Control.Exception (Exception(..), SomeException) import Data.Profunctor (Profunctor(..), Choice(..)) type Prism s t a b = forall p f. (Choice p, Applicative f) => p a (f b) -> p s...
supki/libjenkins
src/Network/HTTP/Client/Lens/Internal.hs
bsd-2-clause
1,033
0
10
227
458
252
206
26
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Database.SqlServer.Definition.Database where import Database.SqlServer.Definition.Identifier (RegularIdentifier) import Database.SqlServer.Definition.Table (Table) import Database.SqlServer.Definition.View (View) import Database.SqlServer.Definitio...
SuperDrew/sql-server-gen
src/Database/SqlServer/Definition/Database.hs
bsd-2-clause
3,915
0
26
879
972
544
428
86
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE UndecidableInstances #-} module Language.Haskell.Liquid.Types.PredType ( PrType , TyConP (..), DataConP (..) ...
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Types/PredType.hs
bsd-3-clause
13,989
0
19
3,521
4,724
2,459
2,265
225
3
{-# LANGUAGE NamedFieldPuns, RecordWildCards, ViewPatterns #-} module Network.RMV.Output (ppTime,ppResult,ppRoute) where import Network.RMV.Types import qualified Data.ByteString.Lazy as B import qualified Data.Map as M import Control.Applicative import Control.Arrow import Control.Monad import Data.List import Data...
dschoepe/rmv-query
Network/RMV/Output.hs
bsd-3-clause
1,563
0
19
434
537
292
245
35
1
difference maxNumber = squareofsums - sumofsqares where sumofsqares = foldr (\x -> (+) (x * x)) 0 [1..maxNumber] squareofsums = (sum [1..maxNumber])^2 main :: IO () main = print $ difference 100
stulli/projectEuler
eu06.hs
bsd-3-clause
205
0
12
42
94
50
44
5
1
{-# LANGUAGE TemplateHaskell, TypeOperators #-} -- | An implementation of a zipper-like non-empty list structure that tracks -- an index position in the list (the 'focus'). module Data.List.PointedList where import Prelude hiding (foldl, foldr, elem) import Control.Applicative import Control.Monad -- import Contro...
jeffwheeler/pointedlist
Data/List/PointedList.hs
bsd-3-clause
8,848
0
15
1,848
2,574
1,331
1,243
115
5
-- | -- Module : Crypto.Hash.SHA1 -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- module containing the binding functions to work with the -- SHA1 cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} module Cry...
nomeata/cryptonite
Crypto/Hash/SHA1.hs
bsd-3-clause
1,156
0
10
271
236
132
104
20
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module Base.Job where import Base.App import Base.Context import Base.Import import Base.Logger import...
leptonyu/mint
corn/src/Base/Job.hs
bsd-3-clause
2,569
0
15
802
807
427
380
52
1