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 Parser.ParseDec (parseDec) where import Data.Maybe (fromMaybe) import qualified Data.Set as Set import Data.Char (isAlpha, isDigit) import Control.Monad (guard) import Parser.Syntax import Parser.Parse import Parser.ParseSpace import Parser.ParseIdent import Parser.ParseType import Parser.ParseStat import Par...
Kiwi-Labs/KWICK
kwick/parser/ParseDec.hs
mit
11,070
38
18
1,801
3,493
1,592
1,901
378
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE StandaloneDeriving ...
yesodweb/persistent
persistent/test/Database/Persist/TH/PersistWith/Model.hs
mit
687
0
7
78
51
38
13
17
0
-- -- -- ----------------- -- Exercise 10.6. ----------------- -- -- -- module E'10''6 where -- ( A ): -- ------ squares :: ( Num t , Ord t ) => [t] -> [t] squares numbers = map square numbers where square :: ( Num t , Ord t ) => t -> t square number = number * number {- GHCi> squares [] squares [ 0 ,...
pascal-knodel/haskell-craft
_/links/E'10''6.hs
mit
1,158
0
8
317
327
186
141
19
1
----------------------------------------------------------------------------- -- -- Stg to C-- code generation: bindings -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- {-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is ...
mcmaniac/ghc
compiler/codeGen/StgCmmBind.hs
bsd-3-clause
27,159
198
20
6,550
4,196
2,250
1,946
-1
-1
import Graphics.UI.Gtk main :: IO () main= do initGUI window <- windowNew set window [windowTitle := "Text Entry", containerBorderWidth := 10] vb <- vBoxNew False 0 containerAdd window vb hb <- hBoxNew False 0 boxPackStart vb hb PackNatural 0 txtfield <- entryNew boxPack...
k0001/gtk2hs
docs/tutorial/Tutorial_Port/Example_Code/GtkChap4-6.hs
gpl-3.0
1,275
0
14
414
366
161
205
33
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-} -- | All types. module HIndent.Types (Printer(..) ,PrintState(..) ,Extender(..) ,Style(..) ,Config(..) ,defau...
lunaris/hindent
src/HIndent/Types.hs
bsd-3-clause
4,362
0
15
1,028
788
479
309
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RankNTypes #-} {-# LANG...
mrkkrp/stack
src/Network/HTTP/Download/Verified.hs
bsd-3-clause
12,238
0
20
3,265
2,406
1,281
1,125
-1
-1
{-# LANGUAGE LambdaCase, RankNTypes, EmptyCase, StandaloneDeriving, FlexibleContexts, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveTraversable, ScopedTypeVariables, BangPatterns #-} {-# LANGUAGE UndecidableInstances #-} -- for Streaming show instance modul...
haskell-streaming/streaming
benchmarks/old/Stream/Internal.hs
bsd-3-clause
13,498
0
20
4,276
4,217
2,184
2,033
285
5
{-# LANGUAGE OverloadedLabels #-} module PatFail009 where f #a = _
sdiehl/ghc
testsuite/tests/parser/should_fail/patFail009.hs
bsd-3-clause
68
1
5
12
13
8
5
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} module Ros.Actionlib_msgs.GoalStatus where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Interna...
acowley/roshask
msgs/Actionlib_msgs/Ros/Actionlib_msgs/GoalStatus.hs
bsd-3-clause
1,553
1
10
305
420
249
171
49
1
{-# LANGUAGE ForeignFunctionInterface, CPP #-} import Foreign.C foreign import ccall unsafe "test" test :: CInt -> IO () main :: IO () -- Use conditional language to test passing a file with a filename -- starting with a hyphen to the preprocessor. #if defined(__GLASGOW_HASKELL__) main = test 3 #endif
sdiehl/ghc
testsuite/tests/driver/T12674/-T12674.hs
bsd-3-clause
304
0
8
50
52
29
23
4
0
module Distribution.Server.Framework.Logging ( Verbosity, lognotice, loginfo, logdebug, logTiming, ) where import Distribution.Verbosity import System.IO import qualified Data.ByteString.Char8 as BS -- No UTF8 in log messages import System.Environment import Control.Monad (when) import Data.Time....
ocharles/hackage-server
Distribution/Server/Framework/Logging.hs
bsd-3-clause
1,117
0
13
241
381
193
188
35
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} import Network.Wai.Application.Static import Network.Wai.Handler.Warp (run) import Data.FileEmbed import WaiAppStatic.Types import WaiAppStatic.Storage.Embedded main :: IO () main = run 3000 $ staticApp (embeddedSettings $(embedDir "test")) { ssIn...
jberryman/wai
wai-app-static/embedded-sample.hs
mit
363
0
12
54
92
53
39
11
1
{-# LANGUAGE FlexibleInstances #-} -- This just tests what the kind error message looks like -- Trac #1633 module T1633 where instance Functor Bool
ezyang/ghc
testsuite/tests/typecheck/should_fail/T1633.hs
bsd-3-clause
151
0
5
27
14
9
5
3
0
-- Explicit export list -- Produces error -- > ghc-stage2: panic! (the 'impossible' happened) -- > (GHC version 7.7.20130109 for x86_64-unknown-linux): -- > nameModule solveV{v r3Ep} -- It is something about internal vs external names. {-# LANGUAGE ParallelArrays, ParallelListComp #-} {-# OPTIONS -fvectorise #-...
ghc-android/ghc
testsuite/tests/dph/modules/ExportList.hs
bsd-3-clause
988
10
9
218
197
129
68
20
1
-- !!! string gaps -- !!! module Main(main) where ----------- main = putStr "\ \Some girls give me money\n\ \Some girls buy me clothes\n\ \..." ----------- main2 = putStr "\ \ \ ..." ----------- main3 = putStr "\ \Some girls give me money\n\ -- and here is a comment \Some girls buy me clothes\n\ \..." -----...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/parser/should_fail/readFail004.hs
bsd-3-clause
458
15
6
100
105
65
40
-1
-1
module System.Apotiki.Tar (getControl, getStrictControl) where import Data.List import qualified Data.Map as M import qualified Codec.Archive.Tar as Tar import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy.Char8 as BC import qualified Codec.Compression....
pyr/apotiki
System/Apotiki/Tar.hs
isc
1,169
0
14
207
360
199
161
27
3
{- | Haskell functions for consuming the API. -} module Factory.Haskell where import Servant import qualified Control.Monad.Trans.Except as Except import qualified Factory.API as API import qualified Factory.Types.Widget as Widget import qualified Servant.Client as Servant import qualified Network.HTTP.Client as ...
alexanderkjeldaas/factory
library/Factory/Haskell.hs
mit
1,850
0
12
354
346
189
157
27
2
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} module Castor.Externs ( Exports(..) , mkBif , mkImport' , importCompiled , importScript ) where import Control.Applicative import Control.Monad.Error imp...
rfw/castor
src/Castor/Externs.hs
mit
2,317
0
17
664
680
352
328
59
3
{-# LANGUAGE BangPatterns #-} {-| Copyright (c) 2014 Maciej Bendkowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the r...
maciej-bendkowski/LCCLUtils
src/Memo.hs
mit
2,113
0
9
641
337
176
161
19
2
{-# LANGUAGE CPP #-} module GHCJS.DOM.HTMLEmbedElement ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.HTMLEmbedElement #else module Graphics.UI.Gtk.WebKit.DOM.HTMLEmbedElement #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIP...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/HTMLEmbedElement.hs
mit
465
0
5
39
33
26
7
4
0
{-# LANGUAGE NoImplicitPrelude #-} module Goolosh.SDL.Init where import System.IO import Data.String(IsString(..),String) import Control.Monad(Monad(..)) import qualified SDL import Goolosh.SDL.State initSDL :: String -> IO SDLState initSDL title = do SDL.initialize [ SDL.InitTimer , SDL.InitVid...
LeviSchuck/Goolosh
src/Goolosh/SDL/Init.hs
mit
737
0
11
191
198
107
91
22
1
-- | Data.TSTP.Theory module. -- Adapted from https://github.com/agomezl/tstp2agda. module Data.TSTP.Theory ( Theory ( AC , Equality ) ) where ------------------------------------------------------------------------------ data Theory = AC | Equality deriving (Eq, Ord, Read, Show)
jonaprieto/athena
src/Data/TSTP/Theory.hs
mit
312
0
6
62
50
32
18
8
0
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module IHaskell.Display.Widgets.Selection.SelectionRangeSlider ( -- * The SelectionRangeSlider Widget SelectionRangeSlider -- * Constru...
gibiansky/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Selection/SelectionRangeSlider.hs
mit
2,499
0
19
573
461
257
204
48
1
module IsbnVerifier (isbn) where import Data.Char (isDigit, digitToInt) isbn :: String -> Bool isbn s = length (filter (/= '-') s) == 10 && length nums == 9 && verify > -1 && 0 == (verify + sum (zipWith (*) [10,9..] nums)) `mod` 11 where nums = map digitToInt $ filter isDigit $ init s verify = check $ last ...
c19/Exercism-Haskell
isbn-verifier/src/IsbnVerifier.hs
mit
422
0
16
99
212
110
102
11
1
module Main where import Control.Applicative (Applicative((<*>), pure)) import Control.Monad (ap) import Data.Ratio ((%)) import System.Exit (exitFailure, exitSuccess) import System.IO (hPutStrLn, stderr) import System.Timeout (timeout) import Text.Printf (printf) import qualified Text.ParserCombinators.ReadP as P impo...
Rufflewind/sci-ratio
tests/Main.hs
mit
5,427
0
17
1,309
2,162
1,169
993
167
3
module Main where import Primes (primeFactors) import Util (removeDuplicates, iterativelyTake) n = 5 checkGroup g = (head nums, check1) where nums = map fst g factors = map snd g check1 = all (\x-> length x == n) factors main :: IO () main = let candidates = [2..] fac...
liefswanson/projectEuler
app/p1/q47/Main.hs
gpl-2.0
554
0
12
163
181
96
85
17
1
module Probability.Distribution.Binomial where import Probability.Random import MCMC builtin binomial_density 3 "binomial_density" "Distribution" builtin builtin_sample_binomial 3 "sample_binomial" "Distribution" binomial_bounds n = integer_between 0 n binomial_effect n x = do add_move $ slice_sample_integer_rand...
bredelings/BAli-Phy
haskell/Probability/Distribution/Binomial.hs
gpl-2.0
687
0
12
83
206
101
105
-1
-1
module Main ( main ) where import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import System.Environment ( getArgs ) import GL.Bindings ( display, idle, reshape ) import Program.EventHandle ( timerLoop, keyboardChar, mouse, mouseMotion , passiveMotion, keyboardCharUp ) im...
szbokhar/genetic-boxes
GuiInteractive.hs
gpl-2.0
1,519
0
10
389
353
179
174
30
1
{- Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu> 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 your option) any later version. This program is ...
sol/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
33,352
0
18
8,835
10,551
5,304
5,247
788
4
{- $Id: Command.hs,v 1.2 2003/11/10 21:28:58 antony Exp $ ***************************************************************************** * I N V A D E R S * * * * Module: ...
pushkinma/frag
src/Command.hs
gpl-2.0
1,158
0
5
632
29
22
7
6
0
module Amoeba.GameLogic.Data.World where import qualified Control.Lens as L import qualified Data.Map as M import Prelude hiding (null, lookup) import Amoeba.GameLogic.Data.Object import Amoeba.Middleware.Math.Geometry data Effect = Effect deriving (Show, Read, Eq) type Effects = [Effect] type EffectMap = M.Map Ob...
graninas/The-Amoeba-World
src/Amoeba/GameLogic/Data/World.hs
gpl-3.0
815
0
9
222
257
149
108
20
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | HTML publishing module for the Anorak system. module Anorak.Publisher (publishLeagues) where import Anorak.Config import Anorak.Results import Anorak.RLTParser import Anorak.Sequences import Anorak...
dwdyer/anorak
src/haskell/Anorak/Publisher.hs
gpl-3.0
22,582
1
17
9,172
4,962
2,650
2,312
277
3
main :: IO ()
hmemcpy/milewski-ctfp-pdf
src/content/3.5/code/haskell/snippet31.hs
gpl-3.0
13
0
6
3
11
5
6
1
0
{-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables #-} -- Generators in Haskell -- -- We translate the in-order tree traversal example from an old article -- Generators in Icon, Python, and Scheme, 2004. -- http://okmij.org/ftp/Scheme/enumerators-callcc.html#Generators -- -- using Haskell and delimited continua...
nishiuramakoto/logiku
my-CC-delcont-cxe-0.1.0.2/Generator2.hs
gpl-3.0
7,002
10
13
1,499
1,654
874
780
73
2
module NeuroNet where import qualified Data.Matrix as M type DMatrix = M.Matrix Double type Weights = DMatrix type Bias = DMatrix type Input = DMatrix type Output = DMatrix data Level = Level {weights::Weights, bias::Bias} type Net = [Level] data LevelRun = LevelRun {input::Input, output::Output, wInput::Input} typ...
brachiel/neuronet
src/NeuroNet.hs
gpl-3.0
2,186
0
11
529
547
307
240
37
1
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TupleSections #-} -- FIXME: for functions prefixedShowDot {-# LANGUAGE FlexibleContexts #-} {- | Module : Web.Theory Description : Pretty-printing security protocol theories into HTML code. Copyright : (c) 2011, 2012 Simon Me...
kelnage/tamarin-prover
src/Web/Theory.hs
gpl-3.0
90,915
0
21
29,450
21,259
10,603
10,656
1,359
30
{-# LANGUAGE DeriveFunctor #-} module Lamdu.Data.Ops ( newHole, wrap , replace, replaceWithHole, setToHole, lambdaWrap, redexWrap , addListItem , newPublicDefinition , newDefinition, presentationModeOfName , savePreJumpPosition, jumpBack , newPane , newClipboard , makeNewTag, makeNewPublicTag , isIn...
Mathnerd314/lamdu
src/Lamdu/Data/Ops.hs
gpl-3.0
6,161
0
17
1,036
2,100
1,058
1,042
164
2
-- | Types used for web communication. module RSCoin.Explorer.WebTypes ( module Exports ) where import RSCoin.Explorer.Extended as Exports import RSCoin.Explorer.Web.Sockets.Types as Exports
input-output-hk/rscoin-haskell
src/RSCoin/Explorer/WebTypes.hs
gpl-3.0
245
0
4
76
32
24
8
5
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-games-management/gen/Network/Google/Resource/GamesManagement/Quests/Reset.hs
mpl-2.0
3,001
0
13
674
314
194
120
49
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-route53-domains/gen/Network/AWS/Route53Domains/UpdateDomainNameservers.hs
mpl-2.0
5,485
0
10
1,104
616
382
234
68
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Accounttax/Patch.hs
mpl-2.0
4,480
0
15
1,045
583
344
239
86
1
-- -- Copyright 2017-2018 Azad Bolour -- Licensed under GNU Affero General Public License v3.0 - -- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md -- {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE DisambiguateRecordFields #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUA...
azadbolour/boardgame
haskell-server/src/BoardGame/Server/Domain/CrossWordFinder.hs
agpl-3.0
4,063
2
16
704
998
569
429
69
2
{-# OPTIONS_GHC -fno-warn-orphans #-} module Test.SwiftNav.SBP.Encoding ( tests ) where import BasicPrelude import Data.ByteString as BS import qualified Data.Aeson as A import SwiftNav.SBP.Encoding () import Test.QuickCheck import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck as QC instance Ar...
paparazzi/libsbp
haskell/test/Test/SwiftNav/SBP/Encoding.hs
lgpl-3.0
977
0
14
190
277
157
120
28
1
-- mod from https://github.com/8c6794b6/haskell-sc-scratch/blob/master/Scratch/FP/PFDS/ElimAmort/Scheduled.hs module Scheduled where newtype Schedule a = Schedule [[a]] type Less a = a -> a -> Bool data Sortable a = Sortable { less :: Less a , size :: Int , segments :: [([a],Schedule a)] } merge :: Less a -> ...
prt2121/haskell-practice
okasaki/src/Scheduled.hs
apache-2.0
1,497
0
16
400
776
405
371
40
3
-- | -- Stability: stable -- -- Hspec is a testing framework for Haskell. -- -- This is the library reference for Hspec. -- The <http://hspec.github.io/ User's Manual> contains more in-depth -- documentation. module Test.Hspec ( -- * Types Spec , SpecWith , Arg , Example -- * Setting expectations , module Test.Hspec...
holoed/Junior
lib/hspec-2.1.5/src/Test/Hspec.hs
apache-2.0
1,318
0
10
282
218
144
74
38
1
module Data.Integrated.Partition where import qualified Data.List as L import Data.Integrated.TestModule (Map) import qualified Data.Map as M -- RETRO: -- I'm curious if a OTS data structure is available to otherwise represent/enforce this data Partition = Partition { equal :: Map, displacing :: Map, added :: Map ...
jfeltz/tasty-integrate
src/Data/Integrated/Partition.hs
bsd-2-clause
681
0
15
145
174
103
71
13
0
{-# LANGUAGE GADTs, OverloadedStrings, TypeOperators #-} module Main where import Control.Natural ((:~>), wrapNT) import Control.Remote.Monad.JSON import Control.Remote.Monad.JSON.Router(transport,router,Call(..),methodNotFound) import Data.Aeson import Data.Text(Text) -- Our small DSL say :: Text -> RPC () say msg...
ku-fpg/remote-json
front/Main.hs
bsd-3-clause
989
0
13
267
297
155
142
25
3
module Main where import Pretty main :: IO () main = interact prettyHS
Zane-XY/haskell-pretty
src/Main.hs
bsd-3-clause
72
0
6
14
25
14
11
4
1
module ChessTools.Test.Board where import Control.Applicative ((<$>), (<*>)) import Control.Monad (join, liftM) import Data.List (group, sort) import Data.Maybe (fromJust) import Test.QuickCheck import ChessTools.Board import ChessTools.Board.Internal import ChessTools.Test.Utils -- | For some of the more complex t...
malcolmt/chess-tools
src/ChessTools/Test/Board.hs
bsd-3-clause
6,052
0
16
1,156
1,562
829
733
113
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_HADDOCK hide #-} module Network.Xmpp.Concurrent.IQ where import Control.Applicative ((<$>)) import Control.Concurrent (forkIO) import Control.Concurrent.STM import Co...
Philonous/pontarius-xmpp
source/Network/Xmpp/Concurrent/IQ.hs
bsd-3-clause
8,502
0
27
2,765
1,970
991
979
169
5
{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports, NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE GADTs #-} module Main where ...
pepeiborra/narradar
src/Main.hs
bsd-3-clause
6,802
0
16
1,505
1,604
845
759
106
4
module System35.Test.Base (assertEqual', assertEqualSeq) where import Test.HUnit import Data.Word (Word8) import qualified Data.ByteString as S import Control.Monad (unless, foldM) assertEqualSeq :: (Eq a, Show a) => String -> [a] -> [a] -> Assertion assertEqualSeq preface expected actual = unless (actual == expe...
smly/haskell-xsystem
System35/Test/Base.hs
bsd-3-clause
2,619
0
21
967
999
515
484
47
5
module CutElimination where import Search.Types eliminateCut :: CutProof -> CutFreeProof eliminateCut cp = case cp of FMap f cp -> _ At f cp -> _ Cut cp cp' -> _ Axiom t -> _
imeckler/mote
Search/CutElimination.hs
bsd-3-clause
192
0
8
52
72
36
36
8
4
{-# LANGUAGE OverloadedStrings #-} module LogReader.Reader (readExercise) where import Data.Aeson import Data.Maybe import Data.List import Data.Text (Text) import Data.Text.Lazy.Encoding import System.Directory import System.FilePath import LogReader.Types import qualified Data.Text as T import qualified Data.Text.IO...
keveri/logreader
src/LogReader/Reader.hs
bsd-3-clause
1,632
0
15
366
567
285
282
45
2
module Cipher where import Data.Char shift :: Int -> Char -> Char shift n x = chr $ (mod ((ord x) + n) (orda + 26)) + orda where orda = ord 'a' blah = shift 1 'z' caesar :: Int -> String -> String caesar n = fmap $ shift n
taojang/haskell-programming-book-exercise
src/ch09/Cipher.hs
bsd-3-clause
229
0
12
58
116
61
55
8
1
{-# LANGUAGE ScopedTypeVariables #-} import Test.Hspec import Test.Cabal.Path import Text.Regex.Posix import Control.Exception shouldReturnRegex :: IO String -> String -> IO () shouldReturnRegex exe pattern = do v <- exe (v =~ pattern) `shouldBe` True main :: IO () main = hspec $ do describe "library-test" $ do...
junjihashimoto/cabal-test-bin
tests/test.hs
bsd-3-clause
850
0
17
133
236
125
111
20
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables, InstanceSigs, AllowAmbiguousTypes, FlexibleContexts #-} module Platform.CleanTest where import Spec.Machine import Spec.Decode import Utility.Utility import Spec.CSRFileIO import qualified Spec.CSRField as Field import Data.Bits import Data.Int...
mit-plv/riscv-semantics
src/Platform/CleanTest.hs
bsd-3-clause
10,866
0
20
3,573
3,384
1,686
1,698
242
2
module Main where import Control.Lens import Control.Monad.Catch import Control.Monad.Except import Data.Proxy import Data.Text import Data.Text.Encoding import Foreign.C import System.IO import System.IO.Temp import Game.GoreAndAsh.Core import Game.GoreAndAsh.Logging import Game.GoreAndAsh.Resource import Game.Gor...
Teaspot-Studio/gore-and-ash-resource
examples/Example015.hs
bsd-3-clause
4,511
0
17
959
1,685
855
830
-1
-1
module Game.Pong.Graphics where import Data.Functor import Game.Pong.Core import Game.Util (sfVec2f,forceCleanup) import Game.Vector import Control.Monad.SFML (SFML) import qualified SFML.Graphics as G import qualified SFML.Window as W import qualified Control.Monad.SFML.Window as WM import qualified Control.Monad.S...
Ginto8/Pong-Haskell
src/Game/Pong/Graphics.hs
bsd-3-clause
3,248
0
14
843
1,267
630
637
82
1
module Utils.Array (sampleAtInterval) where import Data.Array sampleAtInterval :: Int -> Array Int a -> Array Int a sampleAtInterval interval array = listArray (min, max) $ sample min [] where min = (fst . bounds) array sourceMax = (snd . bounds) array max = sourceMax `div` interval ...
thlorenz/Pricetory
src/Utils/Array.hs
bsd-3-clause
445
0
12
133
169
87
82
10
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.InstallPlan -- Copyright : (c) Duncan Coutts 2008 -- License ...
kolmodin/cabal
cabal-install/Distribution/Client/InstallPlan.hs
bsd-3-clause
26,972
0
18
6,725
5,113
2,697
2,416
408
7
module DroidSignatureFileFilter ( FilterOption(..) , filterSigFile , listFileFormats ) where import Text.XML.Light import Data.List ((\\), nub, intercalate) import Data.Maybe (fromMaybe) -- | Configuration options for the 'filterSigFile' function. data FilterOption -- | Include file formats that are supertypes of...
marhop/droidsfmin
src/DroidSignatureFileFilter.hs
bsd-3-clause
7,176
0
15
1,952
1,163
641
522
94
4
module Parser.ParseType (parseType ,parseArgDefInterface) where import Parser.Syntax import Parser.Parse import Parser.ParseIdent import Parser.ParseSpace parseOpaqueType :: Parse Char [Type] parseOpaqueType = greedy $ do name <- parseUnresolvedIdent return [OpaqueType name] parseVoidType :: Parse Char [Type] pa...
Kiwi-Labs/kwirc
kwick/parser/ParseType.hs
mit
2,709
10
12
424
887
423
464
99
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} -- | -- Module: Options -- License: MIT -- -- The @options@ package lets library and application developers easily work -- with command-line options. -- -- The following example is a full program that can accept two options, -- @--message@ and @-...
jmillikin/haskell-options
lib/Options.hs
mit
37,706
135
21
7,539
7,360
3,982
3,378
504
10
{-# LANGUAGE DeriveDataTypeable #-} module InnerEar.Types.GScore where import Text.JSON import Text.JSON.Generic import Data.Map data GScore = GScore { score :: Double, outOf :: Double } deriving (Eq, Typeable, Data) -- asPercent' :: GScore -> Double -- asPercent (GScore 0 b) = 0.0 -- asPercent (GScore a b) = a...
JamieBeverley/InnerEar
src/InnerEar/Types/GScore.hs
gpl-3.0
533
0
10
101
174
97
77
14
1
#!/usr/bin/env stack {- stack runghc --verbosity info --package pandoc-types -} -- Ensure level 1 and 2 headings are first-letter-capitalised. import Data.Char import Text.Pandoc.JSON import Text.Pandoc.Walk main :: IO () main = toJSONFilter capitalizeHeaders capitalizeHeaders :: Block -> Block capitalizeHeaders (He...
ony/hledger
tools/pandoc-capitalize-headers.hs
gpl-3.0
708
0
10
117
181
92
89
11
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-dynamodb/gen/Network/AWS/DynamoDB/Types.hs
mpl-2.0
103,319
0
32
22,571
13,631
7,877
5,754
-1
-1
{-# LANGUAGE BangPatterns, FlexibleContexts, UnboxedTuples #-} -- | -- Module : Statistics.Sample.KernelDensity -- Copyright : (c) 2011 Bryan O'Sullivan -- License : BSD3 -- -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : portable -- -- Kernel density estimation. This module pro...
bos/statistics
Statistics/Sample/KernelDensity.hs
bsd-2-clause
4,936
0
17
1,256
1,194
655
539
60
1
{-# LANGUAGE CPP, FlexibleContexts, FlexibleInstances, UndecidableInstances, TypeFamilies #-} module Language.Hakaru.Runtime.CmdLine where import qualified Data.Vector.Unboxed as U import qualified System.Random.MWC as MWC import C...
zachsully/hakaru
haskell/Language/Hakaru/Runtime/CmdLine.hs
bsd-3-clause
2,391
0
15
767
661
349
312
57
1
{-# LANGUAGE RecordWildCards, ViewPatterns #-} module Development.Bake.Build( ovenIncremental, incrementalDone, incrementalStart ) where import Development.Bake.Core.Type import Development.Shake.Command import Control.Monad.Extra import Control.Applicative import System.FilePath import Control.Exception.Extr...
Pitometsu/bake
src/Development/Bake/Build.hs
bsd-3-clause
1,821
9
18
378
323
172
151
29
1
{-# LANGUAGE OverloadedStrings #-} module FormatMultinom ( formatMultinom , formatMultinoms ) where import Data.Foldable import Data.Monoid import qualified Data.Text.Lazy.IO as TL import qualified Data.Text.Lazy.Builder as TB import Data.Text...
beni55/bayes-stack
network-topic-models/FormatMultinom.hs
bsd-3-clause
1,101
0
12
335
351
190
161
22
1
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, StandaloneDeriving, OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Server.Framework.ResponseContentTypes -- Copyright : (c) David...
haskell-infra/hackage-server
Distribution/Server/Framework/ResponseContentTypes.hs
bsd-3-clause
5,145
0
12
900
1,182
679
503
107
1
{-# LANGUAGE TypeOperators, RankNTypes #-} {- $Id: AFRPMiscellany.hs,v 1.4 2003/11/10 21:28:58 antony Exp $ ****************************************************************************** * A F R P * * ...
snowmantw/Frag
src/AFRPMiscellany.hs
gpl-2.0
4,300
0
10
1,295
1,147
699
448
59
1
fooer input = catMaybes . map Just $ input
mpickering/hlint-refactor
tests/examples/Default71.hs
bsd-3-clause
42
0
7
8
20
9
11
1
1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ms-MY"> <title>Passive Scan Rules - Alpha | ZAP Extension</title> <maps> <homeID>top</homeID...
thc202/zap-extensions
addOns/pscanrulesAlpha/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesAlpha/resources/help_ms_MY/helpset_ms_MY.hs
apache-2.0
987
78
67
162
420
212
208
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} -- | The Name Cache module NameCache ( lookupOrigNameCache , extendOrigNameCache , extendNameCache , initNameCache , NameCache(..), OrigNameCache ) where import Module import Name import UniqSupply import TysWiredIn import Util import Outputable...
olsner/ghc
compiler/basicTypes/NameCache.hs
bsd-3-clause
4,102
0
12
865
416
224
192
46
2
module T () where import Language.Haskell.Liquid.Prelude {-@ assert zipW :: (a -> b -> c) -> xs : [a] -> ys:{v:[b] | len(v) = len(xs)} -> {v : [c] | len(v) = len(xs)} @-} zipW :: (a->b->c) -> [a]->[b]->[c] zipW f (a:as) (b:bs) = f a b : zipW f as bs zipW _ [] [] = [] zipW _ [] (_:_) = liquidError "zipWit...
ssaavedra/liquidhaskell
tests/pos/zipW.hs
bsd-3-clause
496
0
8
125
166
90
76
8
1
module NegativeIn3 where f :: Maybe a -> Int -> Int f x y = x * 2
kmate/HaRe
old/testing/introCase/NegativeIn3_TokOut.hs
bsd-3-clause
69
0
6
21
34
18
16
3
1
import Test.Cabal.Prelude -- Test missing internal build-tool-depends does indeed fail main = setupAndCabalTest $ do assertOutputContains "missing internal executable" =<< fails (setup' "configure" [])
mydaum/cabal
cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.test.hs
bsd-3-clause
214
0
12
36
40
20
20
4
1
module Main where import qualified Data.Set as Set import Control.Monad import Data.List --- --- --- data Direction = DirUp | DirLeft | DirRight | DirDown deriving (Eq,Ord,Show,Read) directions = [DirUp,DirLeft,DirRight,DirDown] coordOffset DirUp = (-1,0) coordOffset DirLeft = (0,-1) coordOffset DirRight = (0,...
ezyang/ghc
testsuite/tests/rts/T2047.hs
bsd-3-clause
2,365
0
11
645
953
503
450
72
3
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE PatternSynonyms, GADTs, ViewPatterns #-} -- Pattern synonyms module ShouldCompile where data T a where MkT :: (Eq b) => a -> b -> T a f :: (Show a) => a -> Bool f = undefined pattern P{x} <- MkT (f -> True) x
ezyang/ghc
testsuite/tests/patsyn/should_compile/records-req.hs
bsd-3-clause
281
0
8
57
86
49
37
8
1
module ShadowVarianceChebyshev0 where chebyshev :: (Float, Float) -> Float -> Float chebyshev (d, ds) t = let p = if t <= d then 1.0 else 0.0 variance = ds - (d * d) du = t - d p_max = variance / (variance + (du * du)) in max p p_max factor :: (Float, Float) -> Float -> Float fac...
io7m/r2
com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/ShadowVarianceChebyshev0.hs
isc
336
0
13
103
139
78
61
10
2
module Shaker.Reflexivite ( RunnableFunction(..) -- * Collect module information functions ,runFunction ) where import Control.Exception as C import Control.Monad.Reader import Data.Maybe import DynFlags import GHC import GHC.Paths import Shaker.Action.Compile import Shaker.GhcInterface import Shaker.Type imp...
bonnefoa/Shaker
src/Shaker/Reflexivite.hs
isc
1,882
0
16
403
521
265
256
43
2
-- | Event module. Wait until OpenCL commands are done. module Data.OpenCL.Event ( CLEvent() , waitEvents ) where import Control.Concurrent.MVar import Control.Monad.IO.Class import Control.Monad.Catch import Control.Monad.Primitive import Data.Foldable import Data.OpenCL.Exception import Data.OpenCL.Handle imp...
Noeda/opencl-bindings
src/Data/OpenCL/Event.hs
isc
780
0
14
151
190
106
84
22
1
{-# LANGUAGE CPP #-} module Data.Streaming.Network.Internal ( ServerSettings (..) , ClientSettings (..) , HostPreference (..) , Message (..) , AppData (..) #if !WINDOWS , ServerSettingsUnix (..) , ClientSettingsUnix (..) , AppDataUnix (..) #endif ) where import Data.String (IsString...
fpco/streaming-commons
Data/Streaming/Network/Internal.hs
mit
3,297
0
13
742
564
338
226
105
0
{-# LANGUAGE ScopedTypeVariables, BangPatterns #-} {-# LANGUAGE ExplicitNamespaces, Arrows #-} module Document.Document where -- -- Modules -- import Document.Machine as Mch import Document.Pipeline import Document.Phase as P import Document.Phase.Types import Document.Phase.Structures as Mch im...
literate-unitb/literate-unitb
src/Document/Document.hs
mit
4,699
2
18
1,356
1,450
763
687
-1
-1
{-# LANGUAGE BangPatterns , FunctionalDependencies , CPP , RecordWildCards , TypeFamilies , TypeOperators #-} module BigPixel.PixelSize ( PixelSize (..) ) where import Vision.Image.Class import Vision.Image.Grey.Type (GreyPixel (..)) import Vision.Image...
eklinkhammer/haskell-vision
BigPixel/PixelSize.hs
mit
2,255
0
10
492
762
401
361
-1
-1
module EdExecute (execute) where import System.IO (putStrLn) import System.Exit (exitSuccess) import Ed (ed) import EdOption (EdOption(..)) import EdError (EdError(NO_INPUT_FILE), edError) execute :: [EdOption] -> IO () execute [] = edError NO_INPUT_FILE "" execute es = exe es "" where exe (e:es') p = case e of ...
demmys/hed
EdExecute.hs
mit
1,236
0
12
531
261
138
123
28
6
module TestSuites.ParserHTMLSpec(spec, matches) where --3rd party import Test.Hspec.Contrib.HUnit(fromHUnitTest) import Test.Hspec (hspec) import Test.HUnit --own import HsPredictor.ParserHTML main = hspec spec spec = fromHUnitTest $ TestList [ TestLabel ">>readMatches" test_readMatches, TestLabel ">>convertHtml"...
Taketrung/HsPredictor
tests/TestSuites/ParserHTMLSpec.hs
mit
3,480
0
13
576
598
325
273
77
1
module ProgrammingInHaskell2.Chap02Spec (spec) where import SpecHelper import ProgrammingInHaskell2.Chap02 spec :: Spec spec = do describe "2.3" $ do it "head [1,2,3,4,5]" $ do head [1,2,3,4,5] `shouldBe` 1 it "tail [1,2,3,4,5]" $ do tail [1,2,3,4,5] `shouldBe` [2,3,4,5] describe "2.5" $...
akimichi/haskell-labo
test/ProgrammingInHaskell2/Chap02Spec.hs
mit
466
0
15
114
194
104
90
15
1
{-# LANGUAGE OverloadedStrings #-} module Ebay.Types.Shipping ( ShippingDetails (..) , xpShippingDetails , ShippingTypeCode (..) , xpShippingTypeCode , ShippingServiceOptions (..) , xpShippingServiceOptions ) where import Data.Text as T import Da...
AndrewRademacher/hs-ebay-trading
src/Ebay/Types/Shipping.hs
mit
3,801
0
12
1,341
660
359
301
72
1
module SFML.Graphics.SFShapeResizable where class SFShapeResizable a where -- | Set the number of points of a resizable shape. setPointCount :: a -> Int -- ^ New number of points of the shape -> IO ()
SFML-haskell/SFML
src/SFML/Graphics/SFShapeResizable.hs
mit
241
0
10
75
36
20
16
6
0
{-# LANGUAGE GeneralizedNewtypeDeriving, OverloadedStrings #-} module EventEnv ( MsgEnv(..) , MQTTEnv(..) , EventEnv , runEnv , lift , asIO , respond , respondNick , publish , ask , asks , runReaderT ) where import Control.Monad.Trans.Reader import Control.Monad.Trans.Cla...
k00mi/bckspc-bot
src/EventEnv.hs
mit
2,455
0
11
847
714
378
336
71
2
module PPL2.Pretty.MProg where import PPL2.VM.Types import PPL2.Pretty.Instr -- ---------------------------------------- prettyMProg :: (Show v) => (OpCode -> Maybe Mnemonic) -> (MCode, [v]) -> String prettyMProg toMn (mcode, mdata) = unlines $ [ "code segment" , "============" , "" ] ++ p...
UweSchmidt/ppl2
src/PPL2/Pretty/MProg.hs
mit
858
0
9
185
274
151
123
26
1
{- If compiled without ForeignFunctionInterface (part of Haskell2010), it complains not about FFI but about missing TemplateHaskell -} foreign import ccall unsafe "getProgArgv" getProgArgv :: Ptr CInt -> Ptr (Ptr CString) -> IO ()
Pnom/haskell-ast-pretty
Test/examples/ForeignImport.hs
mit
234
0
10
37
41
20
21
2
0
{-# LANGUAGE OverloadedStrings #-} module Network.API.Mandrill.SendersSpec where import Test.Hspec import Test.Hspec.Expectations.Contrib import Network.API.Mandrill.Types import Network.API.Mandrill.Utils import qualified Data.Text as Text import qualified Network.API.Mandrill.Sen...
krgn/hamdrill
test/Network/API/Mandrill/SendersSpec.hs
mit
2,161
0
14
487
520
260
260
63
1
{-# htermination getChar :: IO Char #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_getChar_1.hs
mit
40
0
2
7
3
2
1
1
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module DeepShallow where import Prelude hiding (mod,min,(<),(<=),(>),(>=),(==),(/=),(&&),(++)) import qualified Prelude import Contr...
josefs/deep-shallow-paper
DeepShallow.hs
mit
14,701
0
20
4,460
6,987
3,543
3,444
-1
-1
module Physics.RigidBody2d.Forces where import Algebra.Vector as Vector import Data.List as List import Geometry.Vector2d as Vector2d import Physics.Dynamics as Dynamics import Physics.RigidBody2d as RigidBody2d import Prelude.Extensions as PreludeExt linearForce = \rigid_body direction acceleration -> let mass = ...
stevedonnelly/haskell
code/Physics/RigidBody2d/Forces.hs
mit
2,712
0
20
403
796
433
363
45
1