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
-- | Data.TSTP.F module {-# LANGUAGE UnicodeSyntax #-} module Data.TSTP.F where import Data.TSTP.Formula (Formula (..)) import Data.TSTP.Role (Role (..)) import Data.TSTP.Source (Source (..)) -- | Main formula type, it contains all the elements and information --...
agomezl/tstp2agda
src/Data/TSTP/F.hs
mit
664
0
8
168
110
72
38
11
0
{-# LANGUAGE FlexibleInstances #-} {-| Module : Builtins Description : Built-in components of the langauge and the intial context. Copyright : (c) Michael Lopez, 2017 License : MIT Maintainer : m-lopez (github) Stability : unstable Portability : non-portable -} module Builtins ( builtinsCtx ) where impor...
m-lopez/jack
src/Builtins.hs
mit
3,872
0
12
899
1,141
612
529
62
1
{-# LANGUAGE OverloadedStrings #-} module Y2018.M06.D22.Exercise where import Data.Aeson import Network.HTTP.Conduit -- below import available via 1HaskellADay git repository import Y2018.M06.D19.Exercise {-- Okay, a rather simple exercise today involving a REST call. You have an AWS Lambda function at: --} typ...
geophf/1HaskellADay
exercises/HAD/Y2018/M06/D22/Exercise.hs
mit
927
0
7
155
74
47
27
10
1
import Text.ParserCombinators.Parsec hiding (spaces) import System.Environment symbol :: Parser Char symbol = oneOf "!#$%&|*+-/:<=>?@^_~" spaces :: Parser () spaces = skipMany1 space readExpr :: String -> String readExpr input = case parse (spaces >> symbol) "lisp" input of Left err -> "No match: " ++ show err ...
kenwilcox/WyScheme
parse.hs
mit
428
0
9
85
153
77
76
14
2
import Data.Array ts = [0,3,5,8,13]::[Double] xs = [0,225,385,623,993] x's= [75,77,80,74,72] [t,x,x'] = [(listArray (0,4) l!) | l<-[ts,xs,x's]] l::Int->(Int->Double)->Int->Double->Double l n xs k x = product [(x-xs i)/(xs k-xs i)|i<-[0..(k-1)]++[(k+1)..n]] alpha n xs j x = (1-2*(x-xs j)*sum[1/(xs j-xs k)|k<-...
ducis/haskell-numerical-analysis-examples
A/hm.hs
mit
561
0
14
92
510
276
234
11
1
module Handler.MentorProfile where import Import getMentorProfileR :: Handler Html getMentorProfileR = do defaultLayout $ do setTitleI MsgSiteTitle $(widgetFile "mentorprofile")
silky/foot-in-the-door
Handler/MentorProfile.hs
mit
200
0
12
41
45
22
23
7
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-snapshotoptions.html module Stratosphere.ResourceProperties.ElasticsearchDomainSnapshotO...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ElasticsearchDomainSnapshotOptions.hs
mit
1,776
0
12
157
173
100
73
22
1
{-# OPTIONS -w -O0 #-} {- | Module : Modal/ATC_Modal.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(overlappin...
nevrenato/Hets_Fork
Modal/ATC_Modal.hs
gpl-2.0
7,539
0
22
1,734
2,253
1,184
1,069
164
1
{-# LANGUAGE ImpredicativeTypes #-} module Quenelle.Rule ( ExprPred, ExprRule(..), RuleBinding(..), parseExprRule, runExprRule ) where import Control.Exception.Base import Control.Lens import Control.Monad.State.Strict import Data.Maybe import Language.Python.Common.AST import Language.Python.Comm...
philipturnbull/quenelle
src/Quenelle/Rule.hs
gpl-2.0
14,645
0
15
2,891
5,055
2,535
2,520
295
9
module Match (Team, Match(..), toCsv) where import qualified Data.List type Team = String data Match = Match { first_team :: Team, second_team :: Team, first_team_goals :: Int, second_team_goals :: Int, penalty_winner :: Maybe Team } deriving (Show) toCsv :: Match -> String toCsv m = Data.List.intercalate...
pikma/world_cup
Match.hs
gpl-2.0
484
0
9
147
137
80
57
14
1
{-# LANGUAGE DeriveDataTypeable, MagicHash, PolymorphicComponents, RoleAnnotations, UnboxedTuples #-} ----------------------------------------------------------------------------- -- | -- Module : Language.Haskell.Syntax -- Copyright : (c) The University of Glasgow 2003 -- License : BSD-style (see the fi...
jwiegley/ghc-release
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
gpl-3.0
49,509
36
14
13,669
8,738
4,805
3,933
623
9
{-# LANGUAGE NoImplicitPrelude #-} module Bamboo.Theme.MiniHTML5.Widget.Helper where import Bamboo.Theme.MiniHTML5.Env hiding (link, p) import qualified Bamboo.Model.Tag as Tag import qualified Bamboo.Type as C import qualified Bamboo.Type.State as State import MPS import Data.Maybe rss_url_link_pair :: State.Stat...
nfjinjing/bamboo-theme-mini-html5
src/Bamboo/Theme/MiniHTML5/Widget/Helper.hs
gpl-3.0
1,359
1
13
348
449
242
207
36
4
import Types import Process (runProgram) import FileIO (loadFile) import Errors (showError) import System.Exit (exitFailure, exitSuccess) import Data.Maybe (fromJust) goal = "A" file = "extra/simple.pco" tape = Tape { bytes = [(Cell 0) | x <- [0..]], cursor = 0 } checkResult :: String -> IO() checkResult x ...
toish/Pico
test/simple.hs
gpl-3.0
598
0
13
141
206
110
96
18
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} module Hkl.Detector ( Detector(..) , coordinates ) where import Hkl.PyFAI.Npt import Numeric.LinearAlgebra data ImXpadS140 data Xpad32 data ZeroD data Detector a where ImXpadS140 :: Detector ImXpadS1...
picca/hkl
contrib/haskell/src/Hkl/Detector.hs
gpl-3.0
1,949
0
12
580
703
362
341
-1
-1
-- sth-charfullwidth: replace characters with fullwidth equivalents module Main where import System.Exit (exitSuccess) import STH.Lib (charFilter, toFullwidth) main :: IO () main = do charFilter (map toFullwidth) exitSuccess
nbloomf/st-haskell
src/STH/CharFullwidth/Main.hs
gpl-3.0
233
0
9
36
58
32
26
7
1
import Control.Monad as M import Control.Monad.IO.Class import Data.Char import Data.Conduit import Data.Conduit.List as CL import Data.List as L import Data.Text.Lazy ...
XinhuaZhang/PetaVisionHaskell
Application/PVPAnalysis/PlotL1Norm.hs
gpl-3.0
3,123
0
22
1,084
1,150
594
556
92
5
module OutputParsers ( MachineInfo(..) , MachineName , parseMachineInfo ) where import Prelude hiding (takeWhile) import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BC import Data.Attoparsec.ByteString.Char8 type MachineName = ByteString data MachineInfo = MachineInfo { mi_name...
mjansen/remote-command
OutputParsers.hs
gpl-3.0
896
0
10
170
245
132
113
28
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/RegionDisks/GetIAMPolicy.hs
mpl-2.0
4,698
0
18
1,073
571
336
235
92
1
import System.Plugins main = do loadPackage "base" unloadPackage "base" loadPackage "base"
Changaco/haskell-plugins
testsuite/load/unloadpkg/Main.hs
lgpl-2.1
114
0
7
34
29
12
17
4
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE BangPatterns,OverloadedStrings, FlexibleContexts #-} module Proc.CodeBlock (toCodeBlock, runCodeBlock, CodeBlock) where import Control.Monad.State import Control.Monad.Except import Data.Array.IO import qualified Data.Map as M import VarName (arrName, NSQual(..)...
tolysz/hiccup
Proc/CodeBlock.hs
lgpl-2.1
4,923
0
20
1,378
1,964
978
986
142
8
{- nbd - A Haskell library to implement NBD servers - - Copyright (C) 2012 Nicolas Trangez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, o...
NicolasT/nbd
src/Network/NBD/Server/Simple.hs
lgpl-2.1
11,918
0
30
4,045
2,357
1,259
1,098
196
15
module Main where import Options.Applicative import Pagure.Command main :: IO () main = execParser opts >>= runPagureCli where opts = info (helper <*> options) ( fullDesc <> progDesc "pagure.io command-line interface" <> header "pg - interact with pagure.io from the command-line" )
fedora-infra/pagure-cli
src/Main.hs
bsd-2-clause
307
0
11
66
72
38
34
9
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QLabel.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:26 Warning : this file is machine generated - do not mo...
keera-studios/hsQt
Qtc/Gui/QLabel.hs
bsd-2-clause
50,247
0
14
8,711
17,570
8,907
8,663
-1
-1
{-# LANGUAGE Haskell2010 #-} {-# OPTIONS_HADDOCK hide #-} module Ticket61_Hidden where class C a where -- | A comment about f f :: a
haskell/haddock
html-test/src/Ticket61_Hidden.hs
bsd-2-clause
139
0
6
30
21
13
8
5
0
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTextTableFormat.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:16 Warning : this file is machine generated -...
keera-studios/hsQt
Qtc/Gui/QTextTableFormat.hs
bsd-2-clause
6,225
0
12
889
1,597
824
773
-1
-1
{-# LANGUAGE OverloadedStrings #-} -- | Parsing carma logs module System.Log.Carma ( LogMessage(..), LogEntry(..), parseLog, parseMessage, groupRequestsOn, groupRequests, groupLinedRequests ) where import Control.Arrow import Control.Applicative import Data.Aeson import Data.Aeson.Types (Parse...
f-me/carma-test
src/System/Log/Carma.hs
bsd-3-clause
3,416
0
15
820
1,061
591
470
78
5
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Time.EN.NZ.Corpus ( allExamples ) where import Data.Strin...
facebookincubator/duckling
Duckling/Time/EN/NZ/Corpus.hs
bsd-3-clause
3,298
0
10
1,191
870
525
345
66
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} import Servant import Transaction import...
bartfrenk/haskell-transaction
app/Server.hs
bsd-3-clause
822
0
8
124
172
97
75
28
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveFunctor #-} {-# L...
chrisdone/fore
src/Main.hs
bsd-3-clause
26,422
0
27
7,008
7,909
4,037
3,872
670
11
{-# LANGUAGE ScopedTypeVariables #-} module Main where import GHC.Float import Graphics.EasyPlot import qualified Sound.File.Sndfile as Snd import qualified Sound.File.Sndfile.Buffer.Vector as B import qualified Data.Vector.Generic as V import qualified Data.Sequence as S import qualified Data.Foldable as F import So...
Smurf/Tempoist
Examples/OnsetExample.hs
bsd-3-clause
1,759
0
17
396
566
306
260
34
1
module Main where import Test.Hspec import Test.QuickCheck sayHello :: IO () sayHello = putStrLn "hello!" dividedBy :: Integral a => a -> a -> (a, a) dividedBy num denom = go num denom 0 where go n d count | n < d = (count, n) | otherwise = go (n - d) d (count + 1) someInts = sample (arbitrary...
peterbecich/haskell-programming-first-principles
subprojects/additionHspec/Main.hs
bsd-3-clause
1,408
0
19
360
562
292
270
39
1
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} module Schema ( MatchesGenes , Schema (..) , order , matches ) where import Data.List import Genes class MatchesGenes a where matches :: a -> DnaString -> DnaString -> Bool class HasOrder a where order :: a -> Int newtype Sche...
satai/FrozenBeagle
Simulation/Lib/src/Schema.hs
bsd-3-clause
1,221
0
12
354
440
230
210
31
1
module Types.Job ( module RPC.Util , JobMap , JobName (..) , JobURIPath (..) , JobId (..) , JobInfo (..) ) where import RPC.Util import Control.Applicative ((<$>),(<*>),(<|>)) import qualified Data.Map as Map -------------------------------------------------------------------------------- newtype JobN...
GaloisInc/msf-haskell
src/Types/Job.hs
bsd-3-clause
1,788
0
11
332
433
246
187
44
0
{- PiForall language, OPLSS, Summer 2013 -} {-# LANGUAGE FlexibleInstances, FlexibleContexts, TupleSections, ExplicitForAll #-} {-# OPTIONS_GHC -Wall -fno-warn-unused-matches -fno-warn-orphans #-} -- | A parsec-based parser for the concrete syntax. module Parser ( parseModuleFile, parseModuleImports, par...
jonsterling/Luitzen
src/Parser.hs
bsd-3-clause
19,753
61
19
6,300
4,924
2,542
2,382
413
4
module Core.Core where type Name = String type Program = [Toplevel] data Toplevel = Declare Name Expression deriving (Eq, Show, Ord, Read) data Expression = Var Name | Lambda Pat Expression | Let Pat Expression Expression | If Expression Expression Expression | Case [CaseArm] Expression | Literal Lit...
demhydraz/waffle
src/Core/Core.hs
bsd-3-clause
1,457
0
9
355
553
298
255
51
1
{-| Representation of musical instruments. The 'Instrument' type represent any instrument in the MusicXML Standard Sounds 3.0 set, with some extensions. See <http://www.musicxml.com/for-developers/standard-sounds>. -} module Music.Parts.Instrument ( Instrument, -- * Name -- instrumentName, ...
music-suite/music-parts
src/Music/Parts/Instrument.hs
bsd-3-clause
7,597
0
12
1,669
1,555
845
710
119
3
module Main2 where import System.IO import Data.List import Data.Char import Data.Tuple import CaesarEncode import CaesarDecode englishData = [ ('A',8.167), ('B',1.492), ('C',2.782), ('D',4.253), ('E',12.702), ('F',2.228), ('G',2.015), ('H',6.094), ('I',6.996), ('J',0.153), ...
abhinav-mehta/CipherSolver
src/mainVigenere.hs
bsd-3-clause
2,166
10
15
592
1,002
587
415
48
2
module Main where import Attestation import VChanUtil import Demo3Shared import TPM import qualified Data.ByteString.Lazy as L import System.IO import Control.Monad import Control.Monad.Trans main :: IO () main = do putStrLn "START main of Attestation" --putStrLn "OPENING CHAN(Server chan for Appraiser)" apprCh...
armoredsoftware/protocol
tpm/mainline/attestation/AttestationMain.hs
bsd-3-clause
2,950
6
13
572
502
257
245
49
1
module Lib.List (filterA, unprefixed, unsuffixed, partitionA) where import Data.List (isPrefixOf, isSuffixOf) import Prelude.Compat filterA :: Applicative f => (a -> f Bool) -> [a] -> f [a] filterA p = go where go [] = pure [] go (x:xs) = combine <$> p x <*> go xs where combine True rest = x ...
buildsome/buildsome
src/Lib/List.hs
gpl-2.0
929
0
10
229
448
231
217
23
3
module Haddock.Utf8Spec (main, spec) where import Test.Hspec import Test.QuickCheck import Haddock.Utf8 main :: IO () main = hspec spec spec :: Spec spec = do describe "decodeUtf8" $ do it "is inverse to encodeUtf8" $ do property $ \xs -> (decodeUtf8 . encodeUtf8) xs `shoul...
jwiegley/ghc-release
utils/haddock/test/Haddock/Utf8Spec.hs
gpl-3.0
328
0
18
92
105
56
49
11
1
{-# LANGUAGE OverloadedStrings, GADTs, ScopedTypeVariables #-} {-| Description: Generate a new SVG file from the database graph representation. This module is responsible for taking the database representation of a graph and creating a new SVG file. This functionality is used both to create SVG for the Graph compone...
alexbaluta/courseography
app/Svg/Generator.hs
gpl-3.0
15,754
0
20
6,722
3,216
1,696
1,520
276
9
{-# 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-glacier/gen/Network/AWS/Glacier/ListVaults.hs
mpl-2.0
6,772
0
13
1,359
819
499
320
93
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/DescribeLoadBasedAutoScaling.hs
mpl-2.0
5,382
0
10
888
563
340
223
66
1
module RecursiveRef where {-# ANN module "HLint: ignore Eta reduce" #-} recNoSig x = recNoSig x dummy = localRecNoSig where localRecNoSig x = localRecNoSig x recWithSig :: a -> a recWithSig x = recWithSig x mutualNoSigA = mutualNoSigB mutualNoSigB = mutualNoSigA etaNoSig = etaNoSig
robinp/haskell-indexer
haskell-indexer-backend-ghc/testdata/basic/RecursiveRef.hs
apache-2.0
294
0
7
55
69
37
32
10
1
{-# LANGUAGE RecordWildCards, ScopedTypeVariables, BangPatterns, CPP #-} -- -- | Interacting with the interpreter, whether it is running on an -- external process or in the current process. -- module Eta.REPL ( -- * High-level interface to the interpreter evalStmt, EvalStatus_(..), EvalStatus, EvalResult(..), Ev...
rahulmutt/ghcvm
compiler/Eta/REPL.hs
bsd-3-clause
18,381
0
25
3,836
3,937
2,004
1,933
295
3
module Test006 where import qualified Data.Text as T import Kask.Print import Prelude hiding (print) test1 :: String test1 = strCat ["aaa", "bbb", "ccc"] test2 :: ShowS test2 = strCat [showString "aaa", showString "bbb", showString "ccc"] test3 :: T.Text test3 = strCat ["aaa", "bbb", "ccc"] test :: IO () test = do...
kongra/kask-base
app/Test006.hs
bsd-3-clause
369
0
7
68
136
75
61
15
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.Fog -- Copyright : (c) Sven Panne 2002-2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- This...
IreneKnapp/direct-opengl
Graphics/Rendering/OpenGL/GL/Fog.hs
bsd-3-clause
6,064
0
13
1,010
1,244
653
591
135
8
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-rds/gen/Network/AWS/RDS/DeleteEventSubscription.hs
mpl-2.0
3,859
0
9
744
421
257
164
55
1
module Generate.JavaScript.Variable ( fresh , canonical , modulePrefix , define , safe ) where import qualified Control.Monad.State as State import qualified Data.List as List import qualified Data.Set as Set import qualified Language.ECMAScript3.Syntax as JS import qualified AST.Helpers a...
laszlopandy/elm-compiler
src/Generate/JavaScript/Variable.hs
bsd-3-clause
2,916
0
13
664
968
546
422
72
4
module Main where import qualified Streaming.Prelude as Str import qualified System.IO.Streams as IOS import Conduit.Simple as S import Control.Exception import Criterion.Main import Data.Conduit as C import Data.Conduit.Combinators as C -- -- import Fusion a...
m0ar/safe-streaming
benchmarks/StreamingTest.hs
bsd-3-clause
3,149
0
15
1,052
1,160
606
554
82
1
module Let1 where data T1 a b = C2 b a data T2 a = C3 a res1 = let in error "f (C1 1 2) no longer defined for T1 at line: 3"
kmate/HaRe
old/testing/removeCon/Let1AST.hs
bsd-3-clause
159
0
7
68
40
23
17
7
1
{-# LANGUAGE GADTs #-} -- Test for #1396 -- Panics in GHC 6.6.1 module ShouldCompile where data Right provides final where RightNull :: Right final final RightCons :: b -> Right a final -> Right (b -> a) final collapse_right :: right -> Right right final -> final --collapse_right f (RightNull) = f collapse_...
sdiehl/ghc
testsuite/tests/gadt/gadt24.hs
bsd-3-clause
369
0
10
75
101
55
46
7
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- $Id: DriverPhases.hs,v 1.38 2005/05/17 11:01:59 simonmar Exp $ -- -- GHC Driver -- -- (c) The University of Glasgow 2002 -- ----------------------------------------------------------------------------- module Driver...
snoyberg/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
14,219
0
11
3,862
2,379
1,302
1,077
233
20
{-# LANGUAGE CPP #-} module Tests.DoubleDiv where str = show . (round :: Double -> Int) {-# NOINLINE a #-} a :: Double a = 1000000000 {-# NOINLINE b #-} b :: Double b = 34029340939 {-# NOINLINE c #-} c :: Double c = 234 runTest :: IO [String] runTest = return [ str (a/a), str (a/b), str (a/c), str (b/a), str (b...
joelburget/haste-compiler
Tests/DoubleDiv.hs
bsd-3-clause
371
0
9
82
195
110
85
17
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module T12444 where data Nat = Zero | Succ Nat data SNat (n :: Nat) where SZero :: SNat Zero SSucc :: SNat n -> SNat (Succ n) type family (:+:) (a :: Nat) (b :: Nat) :: Nat where m :+: Zero = m m :...
olsner/ghc
testsuite/tests/polykinds/T12444.hs
bsd-3-clause
1,267
0
11
424
175
100
75
14
1
{-# LANGUAGE OverloadedStrings #-} module App (withApp) where import Network.Wai import Network.HTTP.Types import Data.ByteString.Lazy.Char8 () withApp :: (Application -> IO ()) -> IO () withApp handler = handler app app :: Application app Request{requestMethod = m, pathInfo = p} = do case (m, p) of (...
martinrehfeld/wai-example
App.hs
mit
619
0
11
139
177
99
78
20
2
module Main (main) where import GameObject import Graphics.Gloss import Graphics.Gloss.Game as Game import Data.List window :: Display window = InWindow "Asteroid run" (1000,700) (10,10) background :: Color background = black fps :: Int fps = 200 render :: GameWorld -> Picture render gameWorld = pictures ([ b...
nsub93/asteroid-run
src/Main.hs
mit
17,609
0
24
6,355
4,679
2,565
2,114
243
17
fib n = fibs !! n where fibs = 0 : 1 : next fibs next (a : t@(b:_)) = (a + b) : next t
theDrake/haskell-experiments
fibonacci.hs
mit
109
0
12
48
70
36
34
3
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -Wall #-} module Main where import BasicPrelude hiding (Word, liftIO, lift) import CommandLine import TreeGenerator main :: IO () main = do (search_word, de...
mathfur/grep-tree
src/Main.hs
mit
632
0
11
126
153
81
72
19
2
module StartupHook (getStartupHook) where import XMonad import XMonad.ManageHook (composeAll) import Data.Foldable import SessionType import Commands getStartupHook sessionType = basicDesktopSetupCommands basicDesktopSetupCommands :: X () basicDesktopSetupCommands = composeAll $ map spawn [ "wmname LG3D" ...
willprice/dotfiles-xmonad
lib/StartupHook.hs
mit
601
0
7
253
77
45
32
12
1
{-# LANGUAGE OverloadedStrings #-} module Settings.Style where import Common.CssClass import Common.CommonClasses import Data.Monoid import Clay import Prelude hiding ((**)) settingsIconClassSymbol :: CssClass settingsIconClassSymbol = CssClass "fa fa-cog" settingsIconClassInternal :: CssClass settingsIconClassInte...
martin-kolinek/some-board-game
src/Settings/Style.hs
mit
2,163
0
14
441
714
322
392
73
1
{-# LANGUAGE OverloadedStrings #-} module Network.Wai.Twilio.RequestValidatorMiddlewareSpec where import Test.Hspec import Network.Wai.Twilio.RequestValidatorMiddleware import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Lazy as BL import Network.HTTP.Types import Network.Wai import Netwo...
steven777400/TwilioIVR
test/Network/Wai/Twilio/RequestValidatorMiddlewareSpec.hs
mit
1,496
0
16
338
300
169
131
35
1
---------------------------------------------------------------------------------------------------- {- | Module : InterfaceQAWindows Copyright : (c) Rawle Prince 2012 License : GPL-style Maintainer : Rawle Prince (rawle DOT prince at GMAIL dot com ) Stability : provisional Portability : uses gtk2hs Interface for ana...
rawlep/EQS
sourceCode/InterfaceQAWindows.hs
mit
54,692
0
41
18,794
6,769
3,398
3,371
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} module Handlers where import Greet import Servant.Server import Servant.API import GHC.Generics import Data.Aeson import Data.Monoid im...
mooreniemi/haskapi
handlers.hs
mit
1,050
0
10
201
184
103
81
22
3
module Main where import System.Exit (exitFailure) import Test.QuickCheck import LynCrypt {- tests = [ -- Test the chinese remainder theorem \xs -> map (\(a,b) -> (chineseRemainder a b) == a `mod` b), -- Test to see if the decryption function is an inverse -- of the encryption function with all k ...
Sintrastes/LynCrypt
tests/tests.hs
mit
644
0
6
168
32
20
12
6
1
{-# LANGUAGE DeriveGeneric #-} module DailyFeeling.Common.Types (Mood(..), Entry(..)) where import GHC.Generics import Data.Aeson data Mood = Happy | Normal | Sad deriving (Generic, Show, Read, Ord, Eq) instance ToJSON Mood instance FromJSON Mood data Entry = Entry { mood :: Mood ...
Denommus/DailyFeeling
Common/DailyFeeling/Common/Types.hs
mit
497
0
8
156
140
80
60
15
0
-- 1 f :: Int -> String f = undefined g :: String -> Char g = undefined h :: Int -> Char h = g . f -- 2 data A data B data C q :: A -> B q = undefined w :: B -> C w = undefined e :: A -> C e = w . q -- 3 data X data Y data Z xz :: X -> Z xz = undefined yz :: Y -> Z yz = undefined xform :: (X, Y) -> (Z, Z) xfo...
Numberartificial/workflow
haskell-first-principles/haskell-from-first-principles-master/05/05.08.10-type-kwon-do.hs
mit
524
0
9
156
246
142
104
-1
-1
import Test.Tasty import IntMap import List import Map main :: IO () main = defaultMain tests tests :: TestTree tests = testGroup "Tests" [listProps, mapProps, intMapProps]
phadej/range-set-list
tests/Tests.hs
mit
176
0
6
29
57
32
25
8
1
module J2S.AI.Random ( rand ) where import Control.Monad.Random import qualified Data.Foldable as F import J2S.AI.Types -- | A 'Player' strategy that choose randomly one of the available action. rand :: (ListableActions b, MonadRandom m) => Strategy m b rand = uniform . fmap fst ...
berewt/J2S
src/J2S/AI/Random.hs
mit
345
0
8
88
80
47
33
8
1
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards, ScopedTypeVariables, OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : IDE.LogRef -- Copyright : (c) Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GNU-GPL -- -- Maintaine...
cocreature/leksah
src/IDE/LogRef.hs
gpl-2.0
27,303
0
30
9,555
7,285
3,554
3,731
584
22
#!/usr/bin/env runhaskell {-# OPTIONS_GHC -Wall #-} {-# LANGUAGE QuasiQuotes, OverloadedStrings #-} module Main where import System.Process import System.Exit import Text.Printf (printf) import System.Environment (getArgs) import qualified Data.Text.Internal.Lazy import qualified Data.Text.Lazy import Data.Time import...
individuwill/share_monitor
src/Main.hs
gpl-2.0
3,266
0
18
634
876
483
393
70
4
-- This is test file to demonstrate use of Linear 2-class SVM Library and its inbuilt kernel functions. module Main where import Svm import Kernel_functions import Cga_code import Data.Array.Unboxed import System.IO import Text.ParserCombinators.Parsec import Data.CSV svm1 = LeastSquareSVM { kf=r...
rahulaaj/ML-Library
src/Svm/test_file.hs
gpl-3.0
2,913
13
12
631
874
436
438
56
3
{-# LANGUAGE OverloadedStrings #-} -- | Properties from the org.mpris.MediaPlayer2 interface -- -- More information at <http://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html> module DBus.Mpris.MediaPlayer2.Properties ( canQuit , fullscreen , identity , canSetFullscreen ...
Fuco1/mpris
src/DBus/Mpris/MediaPlayer2/Properties.hs
gpl-3.0
1,732
0
10
294
276
151
125
28
1
duplicate :: w a -> w (w a)
hmemcpy/milewski-ctfp-pdf
src/content/3.7/code/haskell/snippet14.hs
gpl-3.0
27
0
8
7
22
10
12
1
0
-- Copyright © 2014 Bart Massey -- Based on material Copyright © 2013 School of Haskell -- https://www.fpcomplete.com/school/advanced-haskell/ -- building-a-file-hosting-service-in-yesod -- This work is made available under the "GNU AGPL v3", as -- specified the terms in the file COPYING in this -- distribution. {-...
BartMassey/hgallery
Handler/Home.hs
agpl-3.0
1,521
0
18
382
302
160
142
36
2
{-# LANGUAGE OverloadedStrings #-} module Topical.Text.Regex ( Replace , rgroup , rtext , rstring , rfn , rtfn , rbuilder , replace , replace' , replaceAll , replaceAll' , parseReplace ) where import Control.Applicative import Data.Attoparsec...
erochest/topical
src/Topical/Text/Regex.hs
apache-2.0
922
0
9
274
255
143
112
30
1
module Util where import Data.List import System.Directory import Control.Monad import System.FilePath findIndexValue :: (a -> Bool) -> [a] -> Maybe (Int, a) findIndexValue f xs = find (f . snd) $ zip [0..] xs copyDirectory :: FilePath -> FilePath -> IO () copyDirectory from to = do xs <- getDirectoryContents...
ndmitchell/fossilizer
Util.hs
apache-2.0
1,240
0
17
288
586
299
287
32
1
module TAParser ( parseExpr ) where import CalcSyntax import Text.Parsec import Text.Parsec.String (Parser) import Text.Parsec.Language (emptyDef) import qualified Text.Parsec.Expr as Ex import qualified Text.Parsec.Token as Tok import Data.Functor.Identity lexer :: Tok.TokenParser () lexer = Tok.makeTokenParser...
toonn/wyah
src/TAParser.hs
bsd-2-clause
1,531
0
9
333
551
279
272
55
1
-- | A collection of parsing algorithms with a common interface, operating on grammars represented as records with -- rank-2 field types. {-# LANGUAGE FlexibleContexts, KindSignatures, OverloadedStrings, RankNTypes, ScopedTypeVariables #-} module Text.Grampa ( -- * Applying parsers failureDescription, simply, ...
blamario/grampa
grammatical-parsers/src/Text/Grampa.hs
bsd-2-clause
4,402
0
14
920
1,137
685
452
61
8
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoRebindableSyntax #-} {-# LANGUAGE OverloadedStr...
facebookincubator/duckling
Duckling/Numeral/KA/Rules.hs
bsd-3-clause
12,616
0
17
3,119
3,282
1,899
1,383
333
8
farey (a,b) n = if r == 0 then (k, n) else farey (a,b) (n - 1) where (k, r) = divMod (1 + a * n) b farey2 (a,b) (c,d) n = (p,q) where k = (n + b) `div` d p = k * c - a q = k * d - b count a b n = go a (farey a n) b n 0 where go a b f n r = if b == f then r else go b next f...
foreverbell/project-euler-solutions
src/73.hs
bsd-3-clause
466
0
10
169
284
156
128
14
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Standa...
time-cube/time-cube
src/Data/Time/Cube/Zones.hs
bsd-3-clause
11,110
0
25
3,180
2,548
1,352
1,196
-1
-1
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.EXT.PolygonOffsetClamp -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Porta...
haskell-opengl/OpenGLRaw
src/Graphics/GL/EXT/PolygonOffsetClamp.hs
bsd-3-clause
752
0
5
101
57
43
14
9
0
{-| Module : Util.Other Description : Hopefully useful utility functions. Copyright : (c) Andrew Michaud, 2015 License : BSD3 Maintainer : andrewjmichaud@gmail.com Stability : experimental This module houses any methods that don't quite fit in anywhere else (or are generic enough to deserve placement in ...
andrewmichaud/JustSudoku
src/Util/Other.hs
bsd-3-clause
2,109
0
10
462
458
259
199
26
2
{- TestErrorStuff.hs (adapted from test_errorstuff.c in freealut) Copyright (c) Sven Panne 2005 <sven.panne@aedion.de> This file is part of the ALUT package & distributed under a BSD-style license See the file libraries/ALUT/LICENSE -} import Sound.ALUT import System.Exit ( exitFailure, exitWith, ExitCode(...
FranklinChen/hugs98-plus-Sep2006
packages/ALUT/examples/TestSuite/TestErrorStuff.hs
bsd-3-clause
659
0
12
119
108
58
50
10
1
module Handler.Add (handleAdd) where import Kerchief.Prelude import Network.API.GoogleDictionary (Entry(..), lookupWord) import Text.Parsec (ParseError, parse) import Text.Parsec.Char (char, noneOf, spaces) import Text.Parsec.Combinator (between, choice) import Text.Parsec.String ...
mitchellwrosen/kerchief
src/Handler/Add.hs
bsd-3-clause
4,050
0
18
1,059
1,194
626
568
79
3
{-# LANGUAGE FlexibleContexts, TemplateHaskell #-} module HNN.Optimize ( module HNN.Optimize.Momentum , module HNN.Optimize.Vanilla , sgd ) where import Control.Monad.Morph import Control.Monad.Trans import Control.Monad.State import Data.VectorSpace import HNN.Optimize.Momentum import HNN.Optimize.Vanilla ...
alexisVallet/hnn
src/HNN/Optimize.hs
bsd-3-clause
1,362
0
13
340
501
265
236
33
1
-- Copyright 2019 Google LLC -- -- Use of this source code is governed by a BSD-style -- license that can be found in the LICENSE file or at -- https://developers.google.com/open-source/licenses/bsd {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LAN...
google-research/dex-lang
src/lib/Type.hs
bsd-3-clause
56,361
0
26
14,784
19,933
9,355
10,578
-1
-1
module Main where import Ivory.Tower.Config import Ivory.Tower.Options import Ivory.OS.FreeRTOS.Tower.STM32 import BSP.Tests.Platforms import BSP.Tests.LED.TestApp (app) main :: IO () main = compileTowerSTM32FreeRTOS testplatform_stm32 p $ app testplatform_leds where p :: TOpts -> IO TestPlatform p topts = ...
GaloisInc/ivory-tower-stm32
ivory-bsp-tests/tests/LEDTest.hs
bsd-3-clause
356
0
8
52
96
55
41
11
1
module TiNameMaps(module TiNameMaps,AccNames(..)) where import List(nub) import NameMaps(AccNames(..)) import TypedIds(IdTy(..),TypeInfo(..),idTy) import HsIdent(HsIdentI(..)) allTypeNames ds = nub (accNames typeName ds []) where typeName x = case idTy x of Class {} -> (HsCon...
forste/haReFork
tools/base/TI/TiNameMaps.hs
bsd-3-clause
430
7
13
120
178
103
75
12
4
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# LANGUAGE TemplateHaskell #-} module Telly.Tests where import Multiarg.Examples.Telly import Test.QuickCheck import Control.Applicative import Ernie import Multiarg.Internal import Test.Tasty import Test.Tasty.TH import Test.Tasty.QuickCheck tests :: TestTree tests ...
massysett/multiarg
tests/Telly/Tests.hs
bsd-3-clause
2,320
0
14
484
833
426
407
67
13
module ASTConvert where import qualified EvalAST as E import qualified ParseAST as P import Control.Monad.State -- function taking blockbody and prepending a statement or multiple statements type StatementWrapper = E.BlockBody -> E.BlockBody type ConvState = (StatementWrapper, Int) gensym :: State ConvState String g...
cg5-/continue
src/ASTConvert.hs
bsd-3-clause
4,926
0
18
776
1,803
912
891
90
1
{-# LANGUAGE BangPatterns, DeriveFunctor #-} -- | This module allows for incremental decoding of CSV data. This is -- useful if you e.g. want to interleave I\/O with parsing or if you -- want finer grained control over how you deal with type conversion -- errors. module Data.Csv.Incremental ( -- * Decoding hea...
edtsech/cassava
Data/Csv/Incremental.hs
bsd-3-clause
11,811
0
15
2,863
2,382
1,256
1,126
151
5
module Util.Hash ( sha1, sha1Lazy, sha1Text ) where import ClassyPrelude.Yesod hiding (unpack, hash) import Text.Printf (printf) import Data.ByteString (unpack) import qualified Data.ByteString.Lazy as L import Crypto.Hash.SHA1 (hash, hashlazy) sha1 :: ByteString -> Text sha1 bytes = pack $ unpack (hash b...
vinnymac/glot-www
Util/Hash.hs
mit
499
0
9
86
168
95
73
15
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Concurrent (threadDelay) import Control.Concurrent...
input-output-hk/pos-haskell-prototype
networking/src/Network/QDisc/Simulation.hs
mit
8,531
0
25
2,395
1,685
881
804
131
4
{-# language RankNTypes #-} module Database.Persist.SqlBackend.Internal.Statement where import Data.Acquire import Database.Persist.Types.Base import Data.Int import Conduit -- | A 'Statement' is a representation of a database query that has been -- prepared and stored on the server side. data Statement = Statement ...
yesodweb/persistent
persistent/Database/Persist/SqlBackend/Internal/Statement.hs
mit
561
0
15
130
126
74
52
13
0
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} {- | Module : ./Temporal/Ctl.hs Copyright : (c) Klaus Hartke, Uni Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : non-portable (MPTC-FD) -} module Ctl...
spechub/Hets
Temporal/Ctl.hs
gpl-2.0
3,245
0
14
896
1,741
917
824
74
2
{- | Module : ./CASL/Freeness.hs Description : Computation of the constraints needed for free definition links. Copyright : (c) Adrian Riesco, Facultad de Informatica UCM 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : ariesco@fdi.ucm.es Stability : experimental Portability : portable...
spechub/Hets
CASL/Freeness.hs
gpl-2.0
34,230
0
22
9,502
9,398
4,820
4,578
651
8
-- Class may not be nested in a class class X a where j :: a -> a class Y b where i :: b ->b
roberth/uu-helium
test/typeClassesParse/Nonnesting1.hs
gpl-3.0
105
3
6
37
39
19
20
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/AbortMultipartUpload.hs
mpl-2.0
5,741
0
9
994
523
328
195
70
1