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 : XMonad.Prompt.Workspace -- Copyright : (C) 2007 Andrea Rossato, David Roundy -- License : BSD3 -- -- Maintainer : -- Stability : unstable -- Portability : unportable -- -- A workspace prompt for XMonad -- -...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Prompt/Workspace.hs
bsd-2-clause
1,571
0
11
472
222
130
92
17
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, MagicHash #-} {-# OPTIONS_HADDOCK hide #-} module PrimInt( ptake, mtake, ztake, itake ) where import Data.Maybe import GHC.Base {-@ assert ztake :: n: {v: Int# | 0 <= v} -> {v: Int | v = n } @-} ztake :: Int# -> Int ztake 0# = 0 ztake n# = 1 + ztake (n# -# 1#) {-@ ...
mightymoose/liquidhaskell
tests/pos/primInt0.hs
bsd-3-clause
858
0
8
247
241
133
108
19
1
{- expireGititCache - (C) 2009 John MacFarlane, licensed under the GPL This program is designed to be used in post-update hooks and other scripts. Usage: expireGititCache base-url [file..] Example: expireGititCache http://localhost:5001 page1.page foo/bar.hs "Front Page.page" will produce POST requests to htt...
bergmannf/gitit
expireGititCache.hs
gpl-2.0
2,083
0
16
516
433
215
218
38
4
{-# LANGUAGE TypeOperators, TypeFamilies #-} {-# OPTIONS -Wno-star-is-type #-} module X (type (X.*)) where type family (*) a b where { (*) a b = Either b a }
sdiehl/ghc
testsuite/tests/warnings/should_compile/StarBinder.hs
bsd-3-clause
160
4
5
31
36
29
7
-1
-1
{-# OPTIONS_GHC -O2 #-} -- Trac #1988: this one killed GHC 6.8.2 -- at least with -O2 module ShouldCompile where newtype CFTree = CFTree (String, [CFTree]) prCFTree :: CFTree -> String prCFTree (CFTree (_,trees)) = concatMap ps trees where ps t@(CFTree (_,[])) = prCFTree t
urbanslug/ghc
testsuite/tests/stranal/should_compile/T1988.hs
bsd-3-clause
284
0
12
55
88
51
37
6
1
{-# LANGUAGE KindSignatures #-} -- Trac #3095 module T3095 where class Bla (forall x . x :: *) where
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/parser/should_fail/T3095.hs
bsd-3-clause
102
1
8
20
28
16
12
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} module ShouldCompile where f (x :: Int) = x + 1
GaloisInc/halvm-ghc
testsuite/tests/parser/should_compile/read022.hs
bsd-3-clause
86
0
7
16
24
14
10
3
1
{-# LANGUAGE TemplateHaskell #-} module UnitTest.CallbackParse.PreCheckoutCallback where import Data.Aeson (Value) import Data.Yaml.TH (decodeFile) import Test.Tasty as Tasty import Web.Facebook.Messenger import UnitTest.Internal ---------- -- READ -- ---------- preCheckoutCallbackVal :: Value preCheckoutCallback...
Vlix/facebookmessenger
test/UnitTest/CallbackParse/PreCheckoutCallback.hs
mit
1,195
0
10
421
194
112
82
-1
-1
module RailFenceCipher (encode, decode) where import Data.List (sortBy) import Data.Function (on) encode :: Int -> [a] -> [a] encode n xs = concat [[a | (a, b) <- zip xs c, b == i] | i <- [1..n]] where c = cycle $ [1..n] ++ [n-1,n-2..2] decode :: Int -> [a] -> [a] decode n xs = map snd $ sortBy (compare `on` fst) ...
exercism/xhaskell
exercises/practice/rail-fence-cipher/.meta/examples/success-standard/src/RailFenceCipher.hs
mit
383
0
12
83
228
125
103
9
1
module Main where fib :: Integer -> Integer fib = fst . fibNthPair fibNextPair :: (Integer, Integer) -> (Integer, Integer) fibNextPair (x,y) = (y,x+y) fibNthPair :: Integer -> (Integer, Integer) fibNthPair 0 = (0,1) fibNthPair n = fibNextPair(fibNthPair(n-1))
henryaddison/7-lang-7-weeks
week7-haskell/1/fib_pair.hs
mit
276
0
9
54
120
69
51
8
1
import Control.Arrow ((***), (&&&)) import Data.List (sort, break) import Data.Tuple (swap) intervals :: [String] -> [(Int, Int)] intervals = sort . map parse where parse = (read *** read . tail) . break (=='-') merge :: [(Int, Int)] -> [(Int, Int)] -> [(Int, Int)] merge xs [] = reverse xs merge [] (y:ys) = m...
mattvperry/AoC_2016
day20/haskell/day20.hs
mit
807
0
10
208
462
253
209
-1
-1
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GADTs #-} ------------...
piyush-kurur/yesod
yesod-auth/Yesod/Auth/HashDB.hs
mit
9,790
0
18
3,092
1,582
860
722
132
4
module Prettify where import SimpleJSON data Doc = Empty | Char Char | Text String | Line | Concat Doc Doc | Union Doc Doc deriving (Show, Eq) empty :: Doc empty = Empty string :: String -> Doc string str = undefined text :: String -> Doc text "" = Empty text...
Bolt64/my_code
haskell/myprecious/Prettify.hs
mit
2,336
0
14
913
1,063
558
505
78
7
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-...
nshepperd/funn
AI/Funn/CL/DSL/Tensor.hs
mit
3,016
0
12
721
1,121
594
527
69
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} module Data.FreeAgent.Types.Users where import qualified Data.ByteString as BS import Control.Applicative ((<$>), (<*>), empty) import Control.Lens import Data.Aeson import ...
perurbis/hfreeagent
src/Data/FreeAgent/Types/Users.hs
mit
1,454
0
23
510
296
173
123
36
0
module Feature.UpsertSpec where import Network.Wai (Application) import Network.HTTP.Types import Test.Hspec import Test.Hspec.Wai import Test.Hspec.Wai.JSON import Protolude hiding (get, put) import SpecHelper spec :: SpecWith ((), Application) spec = describe "UPSERT" $ do context "with POST" $ do co...
steve-chavez/postgrest
test/Feature/UpsertSpec.hs
mit
19,376
0
20
5,668
2,422
1,498
924
-1
-1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGFETurbulenceElement (pattern SVG_TURBULENCE_TYPE_UNKNOWN, pattern SVG_TURBULENCE_TYPE_FRACTALNOISE, ...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGFETurbulenceElement.hs
mit
3,548
0
10
456
688
406
282
52
1
{-# LANGUAGE RecordWildCards, PatternSynonyms, BangPatterns #-} module Genetic where import Data.Vector (Vector(..), fromList) import Data.List (foldl', genericLength, splitAt, sortBy) import Data.Ord (comparing) import System.Random import Control.Monad.Random (MonadRandom(), getRandomR, getRandomRs) import Dat...
cirquit/genetic-tic-tac-toe
src/Genetic.hs
mit
3,844
0
17
1,448
1,110
602
508
52
5
module My.Serialize ( encodeDir , decodeDir , encodeEntry , encodeEntry0 , decodeEntry ) where import My.Data import My.Exception import My.Crypt import Control.Monad.Catch import Control.Monad import Control.Monad.Trans import Control.Applicative import Data.Char import Data.Word import Data.Conduit impo...
CindyLinz/GCryptDrive
src/My/Serialize.hs
mit
2,678
0
18
539
838
415
423
-1
-1
{-# LANGUAGE CPP, NondecreasingIndentation, TupleSections, LambdaCase #-} -- GHC frontend ( ghc/Main.hs ) adapted for GHCJS #undef GHCI #undef HAVE_INTERNAL_INTERPRETER {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- -...
ghcjs/ghcjs
src/Compiler/Program.hs
mit
43,329
0
29
11,888
8,824
4,547
4,277
671
23
{-# LANGUAGE OverloadedStrings #-} module Text.CSS.Shorthand.ListStyleSpec (main, spec) where import Test.Hspec import Text.CSS.Shorthand import Data.Maybe parse = fromJust . parseListStyle parseSingle f = fromJust . f . parse lsType = parseSingle getListStyleType lsPosition = parseSingle getListStylePosition l...
zmoazeni/csscss-haskell
spec/Text/CSS/Shorthand/ListStyleSpec.hs
mit
1,167
0
17
261
330
150
180
32
1
-- | -- Module : $Header$ -- Description : The low level dataflow graph that the compiler produces in the end. -- Copyright : (c) Sebastian Ertel and Justus Adam 2017. All Rights Reserved. -- License : EPL-1.0 -- Maintainer : sebastian.ertel@gmail.com, dev@justus.science -- Stability : experimental -- Thi...
ohua-dev/ohua-core
core/src/Ohua/DFGraph.hs
epl-1.0
4,023
0
15
1,074
959
515
444
-1
-1
{- | Module : $Header$ Copyright : DFKI GmbH 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable printing AS_ExtModal ExtModalSign data types -} module ExtModal.Print_AS where import Common.Keywords import Common.D...
nevrenato/Hets_Fork
ExtModal/Print_AS.hs
gpl-2.0
4,871
0
22
1,432
1,552
785
767
116
7
{-# LANGUAGE TemplateHaskell #-} module PL.Signatur where import PL.Data import PL.Util import PL.ToDoc import Autolib.FiniteMap import Autolib.TES.Identifier import Autolib.Set import Autolib.Reporter import Autolib.Reader import Autolib.ToDoc data Signatur = Signatur { funktionen :: FiniteMap Identifier Int ...
florianpilz/autotool
src/PL/Signatur.hs
gpl-2.0
2,720
65
15
753
801
437
364
67
1
{-# OPTIONS -w -O0 #-} {- | Module : ATC/OrderedMap.der.hs Description : generated Typeable, ShATermConvertible instances Copyright : (c) DFKI Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable(overlapping...
nevrenato/Hets_Fork
ATC/OrderedMap.der.hs
gpl-2.0
954
0
5
145
68
47
21
9
0
-- P05 Reverse a list. -- Predefined function f0 :: [a] -> [a] f0 = reverse -- Recursion (inefficient) f1 :: [a] -> [a] f1 [] = [] f1 (x:xs) = f1 xs ++ [x] -- Tail recursion f2 :: [a] -> [a] f2 = f2' [] where f2' :: [a] -> [a] -> [a] f2' acc [] = acc f2' acc (x:xs) = f2' (x:acc) xs -- Folding f3 :: [...
pavelfatin/ninety-nine
haskell/p05.hs
gpl-3.0
354
0
9
98
203
114
89
12
2
module Deploy where { import Deployment; import State; import Control.Concurrent.MVar; import WASH.CGI.RawCGI as RawCGI; addDeployment :: DeployedObject -> IO (); addDeployment dobj = do { st0 <- takeMVar currentState; let { ds = deploymentState st0; dobjs = objs ds; ...
ckaestne/CIDE
CIDE_Language_Haskell/test/WSP/Webserver/Deploy.hs
gpl-3.0
1,916
0
15
664
621
346
275
44
2
-- 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
designer/source/Game/Grid/GridWorld.hs
gpl-3.0
2,522
0
10
544
282
190
92
-1
-1
module Hkl.H5 ( Dataset , File , check_ndims , closeDataset , get_position , get_ub , lenH5Dataspace , openDataset , withH5File ) where import Bindings.HDF5.Core ( HSize(..) ) import Bindings.HDF5.File ( File , AccFlags(ReadOnly) ...
picca/hkl
contrib/haskell/src/Hkl/H5.hs
gpl-3.0
3,146
0
15
1,037
805
428
377
75
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/Locations/DeidentifyTemplates/Delete.hs
mpl-2.0
5,886
0
15
1,210
703
414
289
111
1
{- Habit of Fate, a game to incentivize habit formation. Copyright (C) 2019 Gregory Crosswhite This program is free software: you can redistribute it and/or modify it under version 3 of the terms of the GNU Affero General Public License. This program is distributed in the hope that it will be usef...
gcross/habit-of-fate
misc/Template.hs
agpl-3.0
862
1
4
170
17
11
6
-1
-1
---------------------------------------------------------------- -- Jedes Modul beginnt mit diesen Teil -- weil wir ein lauffähiges Programm haben wollen -- schreiben wir nur das Hauptmodul (`Main`) module Main where -- danach kommt de Teil wo externe Module improtiert werden import Control.Monad (forM_) import Syst...
CarstenKoenig/DOS2015
Countdown/CountdownFast.hs
unlicense
6,056
0
11
1,285
1,601
878
723
86
1
{-# LANGUAGE CPP #-} module Main (main) where import Data.List.Split import Generator import Options.Applicative version = "1.0" data Input = Input { includes :: String , name :: String, baseName :: String, properties :: String, interactive :: Bool } deriving S...
curiousily/source-generator
Main.hs
apache-2.0
3,251
0
16
1,016
917
447
470
93
2
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {- # ANN module "HLint: ignore Functor law" #-} {- # ANN module "HLint: ignore Evaluate" #-} {- # ANN module "HLint: ign...
erochest/stat-nlp
specs/StatNLP/ContextSpec.hs
apache-2.0
6,113
0
21
2,818
1,460
766
694
108
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExistentialQuantification #-} module Language.K3.Interpreter.Builtins.Math where import Control.Monad.State import Language.K3.Core.Annotation import Language.K3.Core.Common import Language.K3.Core.Type import Language.K3.Interpreter.Data.Types import Language.K3.Interpre...
yliu120/K3
src/Language/K3/Interpreter/Builtins/Math.hs
apache-2.0
1,726
0
16
342
494
263
231
28
4
main :: IO () main = print "Thanks Carlos" -- doubleMe x = x + x
carlospatinos/experiments
haskell/main.hs
apache-2.0
68
0
6
19
20
10
10
2
1
module Application.Hoodle.Cache.Job where startJob :: IO () startJob = do putStrLn "job started"
wavewave/hoodle-cache
lib/Application/Hoodle/Cache/Job.hs
bsd-2-clause
102
0
7
18
29
16
13
4
1
-- | Maintainer: Jelmer Vernooij <jelmer@jelmer.uk> module Propellor.Property.Logcheck ( ReportLevel (Workstation, Server, Paranoid), Service, defaultPrefix, ignoreFilePath, ignoreLines, installed, ) where import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Fi...
np/propellor
src/Propellor/Property/Logcheck.hs
bsd-2-clause
1,063
14
10
158
276
160
116
27
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE Sco...
schernichkin/BSPM
graphomania/src/Graphomania/Shumov/Offheap.hs
bsd-3-clause
2,956
0
13
826
720
368
352
73
1
module Parse.Module (moduleDef, getModuleName, imports) where import Control.Applicative ((<$>), (<*>)) import Data.List (intercalate) import Text.Parsec hiding (newline,spaces) import Parse.Helpers import SourceSyntax.Module (ImportMethod(..), Imports) varList :: IParser [String] varList = commaSep1 (var <|> paren...
deadfoxygrandpa/Elm
compiler/Parse/Module.hs
bsd-3-clause
1,666
0
16
424
535
271
264
48
2
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Compile.Compile where import Bytecode.Definition import Bytecode.Instruc...
exFalso/lambda
src/lib/Compile/Compile.hs
bsd-3-clause
6,710
0
24
1,480
1,888
968
920
125
5
{-# LANGUAGE QuasiQuotes, LambdaCase, RecordWildCards #-} module ExampleSpec where import Wrecker import qualified Wrecker.Statistics as Stats import Test.Hspec import qualified Server as Server import qualified Client as Client import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as H import Contr...
skedgeme/wrecker
test/ExampleSpec.hs
bsd-3-clause
6,978
0
15
2,055
1,565
803
762
108
1
{-# LANGUAGE FlexibleContexts, RankNTypes #-} module Cloud.AWS.CloudWatch ( -- * CloudWatch Environment CloudWatch , runCloudWatch , runCloudWatchwithManager , setRegion , apiVersion -- * Metric , module Cloud.AWS.CloudWatch.Metric , module Cloud.AWS.CloudWatch.Alarm ) where...
worksap-ate/aws-sdk
Cloud/AWS/CloudWatch.hs
bsd-3-clause
1,472
0
12
280
344
202
142
40
1
module Pkgs.Parser ( parse, parseAll, parsePkg, parseIface ) where import Data.Maybe (isJust, fromMaybe) import Data.Either (partitionEithers) import Control.Monad import Control.Applicative ((<$>), (<*>)) import Text.Parsec import Text.Parsec.String -- import Text.Parser.Char (char) import Text.Parsec.Prim import Te...
markflorisson/packages
Pkgs/Parser.hs
bsd-3-clause
6,245
0
12
1,623
1,766
889
877
138
3
module RPF.Domain where import Data.Map (Map) import qualified Data.Map as M hiding (Map) import Data.Maybe import Network.DNS.Types (Domain) type DomainTable = Map Domain Bool domainMatch :: Domain -> DomainTable -> Bool domainMatch dom = fromMaybe False . M.lookup dom makeDomainTable :: [Domain] -> DomainTable ma...
kazu-yamamoto/rpf
RPF/Domain.hs
bsd-3-clause
376
0
8
60
127
71
56
10
1
{- A module containing additional functions for printing. In particular, this includes functions for producing SMT-LIB output that can be processed by Z3 -} module HOCHC.Printing(printOut,pprint,printInd,smtPrint,smtPrint2,printEnv,printLog, deand,printLong) where import Data.List import HOCHC.DataTypes import HO...
penteract/HigherOrderHornRefinement
HOCHC/Printing.hs
bsd-3-clause
5,049
0
16
980
2,173
1,159
1,014
101
2
module Wyas.EvalSpec where import Test.QuickCheck import Test.Hspec import Wyas import Wyas.Eval spec :: Spec spec = return ()
parsonsmatt/wyas
test/Wyas/EvalSpec.hs
bsd-3-clause
130
0
6
21
39
23
16
7
1
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {-| Module : PolyPaver.Input.SPARK Description : parser of SPARK vcg and siv files Copyright : (c) Michal Konecny, Jan Duracz License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable ...
michalkonecny/polypaver
src/PolyPaver/Input/TPTP.hs
bsd-3-clause
18,971
0
15
4,862
5,129
2,634
2,495
491
3
{-# LANGUAGE ScopedTypeVariables #-} module TestFSM where import System.IO import Control.Monad.State import Control.Exception data Event = LoYes | LoNo | LoNum -- buttons on your phone | ReYes | ReNo | ReNum -- buttons on his phone getEvent :: IO Event getEvent = getChar >>= \c -> case c of 'y' -> re...
homam/fsm-conversational-ui
src/TestFSM.hs
bsd-3-clause
3,396
0
14
948
1,170
582
588
82
7
module AI.API.GameTree ( alphabeta , negascout , minimax ) where import Types import Game import AI.Eval import AI.Types import Data.Tree.Game_tree.Game_tree import qualified Data.Tree.Game_tree.Negascout as Algo newtype GTSimple b = GTSimple { unGTSimple :: Position b } instance Board b => Game_tree (GTSimp...
sphynx/hamisado
AI/API/GameTree.hs
bsd-3-clause
1,977
0
13
400
741
394
347
47
1
module Turbinado.Server.Network ( receiveRequest -- :: Handle -> IO Request , sendResponse -- :: Handle -> Response -> IO () ) where import Data.Maybe import Network.Socket import Network.HTTP hiding (receiveHTTP, respondHTTP) import Network.HTTP.Stream import Network.StreamSocket import Ne...
alsonkemp/turbinado-website
Turbinado/Server/Network.hs
bsd-3-clause
4,376
0
17
1,504
966
519
447
75
3
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} -- -- | The core language, almost all transformations and opti...
jystic/river
src/River/Core/Syntax.hs
bsd-3-clause
3,675
0
9
708
1,029
534
495
133
2
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ARB.SeamlessCubeMap -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabil...
haskell-opengl/OpenGLRaw
src/Graphics/GL/ARB/SeamlessCubeMap.hs
bsd-3-clause
668
0
5
91
47
36
11
7
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[HsBinds]{Abstract syntax: top-level bindings and signatures} Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@. -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleConte...
mcschroeder/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
39,008
0
18
11,260
6,190
3,335
2,855
415
4
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuo...
ashutoshrishi/blogserver
src/Model.hs
bsd-3-clause
2,419
0
13
536
574
312
262
50
2
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {- | These declarations allow the use of a DirectionalSeq, which is a Seq that uses a phantom type to identify the ordering of the elements in the sequence (Forward or Reverse). The constructors are not exported...
aisamanra/matterhorn
src/Types/DirectionalSeq.hs
bsd-3-clause
3,733
0
13
882
794
414
380
-1
-1
{-# LANGUAGE OverloadedStrings #-} module PeerTrader.Route.P2PPicks (p2ppicksHandler) where import Snap.Core import Snap.Extras.JSON (writeJSON) import Snap.Extras.TextUtils (readBS) import Control.Applicative ((<|>)) import ...
WraithM/peertrader-backend
src/PeerTrader/Route/P2PPicks.hs
bsd-3-clause
2,460
0
14
696
562
288
274
50
1
-- | Defines document template module Text.PDF.Slave.Template( TemplateName , TemplateInput , TemplateBody , TemplateBibtex , DependencyBody , BibTexBody , TemplateDependency(..) , Template(..) , TemplateDependencyFile(..) , TemplateFile(..) ) where import Control.Monad (mzero, unless) import D...
NCrashed/pdf-slave
pdf-slave-template/src/Text/PDF/Slave/Template.hs
bsd-3-clause
6,978
4
21
1,764
1,478
790
688
-1
-1
#!/usr/local/bin/runghc {-# LANGUAGE OverloadedStrings #-} import Interactive info = "Math trainer n3 : cubes of n" main = interactive info (\x -> x*x*x)
alexander31415926535/Liftconsole
math-tutor3.hs
bsd-3-clause
159
0
9
28
37
21
16
4
1
{-| Module : Diplomacy.OrderValidation Description : Definition of order validation Copyright : (c) Alexander Vieth, 2015 Licence : BSD3 Maintainer : aovieth@gmail.com Stability : experimental Portability : non-portable (GHC only) -} {-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE...
avieth/diplomacy
Diplomacy/OrderValidation.hs
bsd-3-clause
45,631
369
21
11,150
10,701
5,732
4,969
-1
-1
module Util (normalizeFields) where import Data.Char import Data.List normalizeFields :: String -> [String] -> [String] normalizeFields name fields = map toSnakeCase xs where xs | all (uncapitalize name `isPrefixOf`) fields = map (drop (length name)) fields | otherwise = fields ...
beni55/json-fu
src/Util.hs
mit
580
0
12
157
215
109
106
16
1
{- DATX02-17-26, automated assessment of imperative programs. - Copyright, 2017, see AUTHORS.md. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at...
DATX02-17-26/DATX02-17-26
libsrc/Norm/SumsOfProducts.hs
gpl-2.0
2,375
0
12
762
665
330
335
41
7
module Main where import Geometry import Drawing main = drawPicture myPicture myPicture points = drawTriangle (a,b,c) & drawLabels [a,b,c] ["A","B","C"] & message $ "angle(ABC)=" ++ shownum (angle a b c) ++ ", angle(BCA)=" ++ shownum (angle b c a) ...
alphalambda/hsmath
src/Learn/Geometry/demo09anglemeasure.hs
gpl-2.0
419
0
14
151
154
82
72
10
1
{-# LANGUAGE OverloadedStrings #-} module Main where import qualified Github.Auth as Github import qualified Github.Issues as Github import Report -- The example requires wl-pprint module "The Wadler/Leijen Pretty Printer" import Text.PrettyPrint.ANSI.Leijen auth :: Maybe Github.Auth auth = Just $ Github.Enterprise...
jwiegley/github
samples/Issues/IssueReport/IssuesEnterprise.hs
bsd-3-clause
1,598
0
13
388
436
235
201
31
2
module Tandoori.Typing.UnifyPred (substMono, resolvePred, satisfies) where import Tandoori.Typing import Tandoori.Typing.Monad import Tandoori.Typing.Error import Tandoori.Typing.Unify import Tandoori.Typing.Substitute import Tandoori.Typing.MonoEnv import MonadUtils (anyM) import Control.Monad.Error import Contr...
bitemyapp/tandoori
src/Tandoori/Typing/UnifyPred.hs
bsd-3-clause
2,395
0
16
751
764
397
367
46
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module MockedEnv where import Control.Monad.Catch import Control.Monad.Trans.Reader import Control.Monad.IO.Class import Tinc.Fail import Control.Monad.Trans.Class newtype WithEnv e a = WithEnv (ReaderT e IO a) deriving ...
sol/tinc
test/MockedEnv.hs
mit
542
0
7
125
157
88
69
13
1
{-# LANGUAGE PatternGuards, ScopedTypeVariables #-} module Main where import Prelude hiding ( mod, id, mapM ) import GHC --import Packages import HscTypes ( isBootSummary ) import Digraph ( flattenSCCs ) import DriverPhases ( isHaskellSrcFilename ) import HscTypes ( msHsFilePath ) import N...
lukexi/ghc-7.8-arm64
utils/ghctags/Main.hs
bsd-3-clause
14,738
33
21
4,256
3,893
1,983
1,910
275
23
{-# LANGUAGE UnliftedNewtypes #-} main :: IO () main = return () newtype Baz = Baz (Show Int)
sdiehl/ghc
testsuite/tests/typecheck/should_fail/UnliftedNewtypesFail.hs
bsd-3-clause
96
0
7
20
36
19
17
4
1
module Compose where import Prelude hiding (Monad(..)) -- | TODO -- | -- | 1. default methods are currently not supported -- | ie. if we remove the definition of fail method it fails -- | as I assume that dictionaries are Non Recursive -- | -- | 2. check what happens if we import the instance (it should work) da...
ssaavedra/liquidhaskell
tests/neg/StateConstraints0.hs
bsd-3-clause
4,256
0
16
1,621
559
307
252
27
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- | Parsing the top of a Haskell source file to get its module name, -- imports and options. -- -- (c) Simon Marlow 2005 -- (c) Lemmih 2006 -- -------------------------------------------------------------------------...
TomMD/ghc
compiler/main/HeaderInfo.hs
bsd-3-clause
13,425
1
28
4,110
2,723
1,400
1,323
212
11
{-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -O -Wno-inline-rule-shadowing #-} -- Rules are ignored without -O module Orphans where import GHC.Exts (IsList(..)) -- Some orphan things instance IsList Bool where type Item Bool = Double fromList = undefined toList = undefined {-# RULES "myrule1" id id = id #-} ...
ezyang/ghc
testsuite/tests/showIface/Orphans.hs
bsd-3-clause
510
0
7
108
108
65
43
17
1
-- !!! Check that we can have a type for main that is more general than IO a -- main :: forall a.a certainly also has type IO a, so it should be fine. module Main(main) where main :: a main = error "not much luck"
hferreiro/replay
testsuite/tests/typecheck/should_compile/tc120.hs
bsd-3-clause
219
0
5
51
24
15
9
3
1
{-# htermination zipWithM :: Monad m => (a -> b -> m c) -> [a] -> [b] -> m [c] #-} import Monad
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Monad_zipWithM_1.hs
mit
96
0
3
23
5
3
2
1
0
{-# LANGUAGE GADTs, RankNTypes #-} module Vyom.Data.Run where -- Runtime representation for values - -- runtime environment (h) -> the actual value (a) newtype Run h a = Run { run :: h -> a } -- UTILITY -- Basic ops for Run rop0 :: a -> Run h a rop0 = Run . const rop1 :: (a -> b) -> Run h a -> Run h b rop1 f a = R...
ajnsit/vyom
src/Vyom/Data/Run.hs
mit
578
0
9
168
309
161
148
11
1
module Unison.Codebase.Serialization.PutT where import Data.Bytes.Put import qualified Data.Serialize.Put as Ser import Data.Serialize.Put ( PutM , runPutM ) newtype PutT m a = Pu...
unisonweb/platform
parser-typechecker/src/Unison/Codebase/Serialization/PutT.hs
mit
1,893
0
13
545
530
281
249
50
0
-- |This module contains 'toIsabelle' definitions of all the core Zeno types. module Zeno.Isabellable.Core () where import Prelude () import Zeno.Prelude import Zeno.Core import Zeno.Isabellable.Class import qualified Data.Map as Map import qualified Data.Text as Text instance Isabellable Id where toIsabelle = fro...
Gurmeet-Singh/Zeno
src/Zeno/Isabellable/Core.hs
mit
6,784
0
21
1,985
2,346
1,147
1,199
-1
-1
bools :: [Bool] bools = [True] nums :: [[Int]] nums = [[1]] add :: Int -> Int -> Int -> Int add x y z = x+y+z copy :: a -> (a,a) copy a = (a,a) apply :: (a -> b) -> a -> b apply f a = f a second :: [a] -> a second xs = head (tail xs) swap :: (a,a) -> (a,a) swap (x,y) = (y,x) pair :: a -> a -> (a,a) pair x y = (x...
craynafinal/cs557_functional_languages
practice/week1/ch3.hs
mit
441
0
7
123
316
174
142
20
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} import Confetti import Data.Maybe import Data.Version (showVersion) import Paths_confetti (version) import System.Console.CmdArgs import System.Consol...
aviaviavi/confetti
app/Main.hs
mit
2,161
0
14
518
486
254
232
48
1
module Euler.E39 where import Data.Function (on) import Data.List (maximumBy) euler39 :: Int -> Int euler39 n = maximumBy (compare `on` numTriangles) [1..n] numTriangles :: Int -> Int numTriangles = length . findTriangles findTriangles :: Int -> [ (Int, Int, Int) ] findTriangles n = [ (x, y, (n - y - x)) | x <- ...
D4r1/project-euler
Euler/E39.hs
mit
589
10
12
140
277
150
127
19
1
import Prelude hiding ((&&)) -- True && True = True -- _ && _ = False --a && b = if a -- then -- if b -- then True -- else False -- else -- False a && b = if b then a else False mult = \ x -> (\ y -> (\ z -> x * y * z)) remove n xs = take n xs ++ drop...
jugalps/edX
FP101x/week3/test.hs
mit
599
0
11
241
328
184
144
16
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveGeneric #-} module Cilia.CI.Travis(getInternalRepos) where import Prelude import qualified Data.Maybe as DM import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.ByteString.Char8 as BSC import ...
bbiskup/cilia
src-lib/Cilia/CI/Travis.hs
mit
4,396
0
20
1,071
1,182
650
532
107
3
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE MultiWayIf #-} module Model.Common where import GHC.Generics import Data.Aeson import Data.Text as T newtype Uuid = Uuid Text deriving (Show, Eq, Generic) instance FromJSON Uuid where parseJSON (String s) = if | T.length s == 36 -> ret...
gip/cinq-cloches-ledger
src/Model/Common.hs
mit
494
0
12
112
140
73
67
15
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} module Stackage.BuildPlanSpec (spec) where import qualified Data.Map as Map import qualified Data.Map.Strict as M import qualified Data.Set as S import Data.Yaml import qualified Data.Yaml as Y import Distrib...
k0001/stackage
test/Stackage/BuildPlanSpec.hs
mit
5,124
0
18
1,722
1,486
829
657
121
2
module Dist3 where import Context import DB3 import Measure import Network.Socket.Internal (withSocketsDo) import Network.Socket (close) import Control.Concurrent (forkIO,threadDelay) import Network -- (PortID(PortNumber),listenOn,accept,connectTo) import System.IO (hGetLine,hPutStrLn,hClose,hFlush) import Control.Mo...
thiry/DComp
src/Dist3.hs
gpl-2.0
1,488
0
18
278
633
311
322
46
1
{-| Module : Constants Description : IVI's constant values -} module Constants ( -- * Strings iviName , iviExtension , iviDirname -- * Paths , iviDirectory ) where import System.Directory (getHomeDirectory) import System.FilePath.Posix ((</>)) iviName, iviExtension, iviDirname :: St...
NorfairKing/IVI
src/Constants.hs
gpl-2.0
658
0
9
142
109
70
39
13
1
{-# LANGUAGE TemplateHaskell #-} {-| Some common types. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the Licens...
narurien/ganeti-ceph
src/Ganeti/HTools/Types.hs
gpl-2.0
15,496
0
12
4,006
2,430
1,485
945
261
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} module Moonbase.DBus ( Call , Signal , Help , Usage , Com(..) , Nameable(..) , withoutHelp , packName, unpackName , moonbaseBusName , moonbaseC...
felixsch/moonbase
src/Moonbase/DBus.hs
gpl-3.0
2,960
0
14
711
878
478
400
83
2
{-# LANGUAGE TemplateHaskell #-} module Haemu.Instruction ( sliced , instruction , Instruction(..) , datalength , dataflags , condition , optype , opcode , dataBlock , int ) where import Haemu.Types import Data.Word import Data.Bits import qualified Data.Vector.Unboxed as V import Control.Lens im...
bennofs/haemu
src/Haemu/Instruction.hs
gpl-3.0
3,026
0
18
794
737
389
348
-1
-1
{- Copyright (C) 2014 Ellis Whitehead 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 (at your option) any later version. This program is distributed in the hope...
ellis/OnTopOfThings
old-20150308/src/OnTopOfThings/Data/Time.hs
gpl-3.0
4,361
0
20
837
1,197
647
550
70
5
module Main where import Control.Applicative import Control.Monad import Control.Monad.Reader import Control.Monad.Error import System.FilePath import System.Directory import System.Log.Logger -- -- import HEP.Automation.MadGraph.Card import HEP.Automation.MadGraph.Model import HEP.Automation.MadGraph.Model.SM -- ...
wavewave/madgraph-auto
test/madgraphRun.hs
gpl-3.0
2,973
0
16
902
782
436
346
82
4
-- -- Copyright (c) 2017 Daniel Gonçalves da Silva - https://github.com/danielgoncalvesti -- GPL version 3 or later (see http://www.gnu.org/copyleft/gpl.html) -- module Main where import System.Environment verifyValue :: Integer -> Bool verifyValue x | x < -1 || x == 2 = True | otherwise = False -- | T...
danielgoncalvesti/BIGDATA2017
Atividade01/Haskell/Activity1/Exercises1/Ex5.hs
gpl-3.0
387
0
11
78
92
49
43
8
1
{- | An encapsulation of a grid-based GUI, where rows and columns of textures are rendered at 1:1 aspect ratio, and specific parts of the grid can be labelled with the intent of locating mouse clicks. -} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} module Jell...
mtolly/jelly
src/Jelly/Arrangement.hs
gpl-3.0
4,035
0
22
1,231
1,749
901
848
103
10
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE OverloadedLabels #-} {-# LANGUAGE GADTs #-} module Network.HTTP.WebSub.Subscriber ( SubscriptionId(..) , SubscribeError(..) , Subscr...
owickstrom/websub
src/Network/HTTP/WebSub/Subscriber.hs
mpl-2.0
10,006
0
17
2,320
2,231
1,143
1,088
215
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.DFAReporting -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting.hs
mpl-2.0
108,660
0
207
22,544
11,890
8,546
3,344
2,542
0
{-# 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/URLMaps/Validate.hs
mpl-2.0
3,924
0
17
961
476
285
191
77
1
module Language.Interpreter.Dao.TestSuite where import Prelude hiding (error, undefined, print, putStr, putStrLn) import Language.Interpreter.Dao --import Control.Arrow import Control.Concurrent import Control.Exception import Control.Monad import ...
RaminHAL9001/Dao
src/Language/Interpreter/Dao/TestSuite.hs
agpl-3.0
33,488
0
23
7,982
10,482
5,269
5,213
-1
-1
module AbsoluteVal where absoluteVal :: Int -> Int absoluteVal a = if a > 0 then a else -a
thewoolleyman/haskellbook
04/09/chad/AbsoluteVal.hs
unlicense
92
0
6
20
35
20
15
3
2
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Lib where import Data.Type.Equality import GH...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/type-level/2018-09-alex-peitsinis-writing-and-using-proofs/src/Lib.hs
unlicense
17,361
0
19
4,805
2,264
1,175
1,089
109
1
{-# LANGUAGE OverloadedStrings #-} module Main(main) where import Generator import Data.Text (Text) import Control.Applicative ((<$>)) import Control.Exception (fromException, handle, SomeException) import Control.Monad (forM_, forever, replicateM) import Control.Monad.Writer (liftIO) import Control.Concurrent (MVar, n...
eigengo/hwsexp
ws/main/Main.hs
apache-2.0
3,020
0
14
664
665
357
308
53
2
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} -- | This assumes environment variables for the Github authentication -- information, `GITHUB_USER` and `GITHUB_PASSWD`. module Main where import Control.Applicative import Control.Error import Control.Monad.Writer import...
erochest/gitreview-core
test/GitReviewTest.hs
apache-2.0
2,681
0
16
956
611
311
300
59
2