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 ExplorerSpec (spec) where import Test.Hspec import Language.Haskell.Explorer spec :: Spec spec = do describe "bindingsOf" $ do it "answers bindings for binding" $ do let code = "f x = (:[]) . m x y . g h 2" (bindingsOf "f" code) `shouldBe` [".","m","x","y", "g","h"] de...
flbulgarelli/hs-inspector
spec/ExplorerSpec.hs
mit
572
0
15
176
155
83
72
13
1
module Y2021.M03.D23.Exercise where {-- HOWDY! So, what shall we do today? I would like to implement FORTH, but that's just me. Did you know that in FORTH pi is simply defined as: : pi 355 113 */ ; (c.f.: https://www.forth.com/resources/forth-programming-language/) I LOVE IT! What's even more amazing is that Chuc...
geophf/1HaskellADay
exercises/HAD/Y2021/M03/D23/Exercise.hs
mit
1,022
0
7
206
82
48
34
8
1
{-# LANGUAGE OverloadedStrings #-} module Landing.App (app) where import Network.Wai import Network.HTTP.Types (status200, status404) import Network.HTTP.Types.Header (hContentType) import Data.Time (diffUTCTime, getCurrentTime) import Control.Monad (when) import Data.Text (Text) import qualified Data.ByteString.Lazy...
dennis84/landing-haskell
Landing/App.hs
mit
1,782
0
17
347
588
312
276
48
4
-- | -- Module: Capnp.Rpc -- Description: Cap'n Proto RPC system -- -- This module exposes the most commonly used parts of the RPC subsystem. module Capnp.Rpc ( -- * Establishing connections handleConn , ConnConfig(..) -- * throwing errors , throwFailed -- * Transmitting messages , T...
zenhack/haskell-capnp
lib/Capnp/Rpc.hs
mit
1,037
0
6
261
169
119
50
29
0
import Utils.Prime (isPrime) main = print problem50Value -- build up the list of primes <1e6 in descending order primes :: [Int] primes = filter isPrime [999999,999998..2] problem50Value :: Int problem50Value = findLongestSum [head primes] (tail primes) 1 (head primes) -- cps: consecutive primes that we've built up...
jchitel/ProjectEuler.hs
Problems/Problem0050.hs
mit
1,197
0
10
286
294
156
138
15
1
{-# LANGUAGE DeriveDataTypeable #-} module Control.Admin.CGI ( main ) where -- $Id$ import Control.Types import Gateway.CGI import Inter.Crypt import Control.Schule as U import Control.Student.Type as T import Control.Student.DB import qualified Control.Student import Control.Admin.DB import qualified Control.Sch...
Erdwolf/autotool-bonn
src/Control/Admin/CGI.hs
gpl-2.0
2,899
14
18
859
877
463
414
87
3
{- | Module : $Id: ChaseImports.hs 17202 2012-08-17 14:32:55Z maeder $ Copyright : (c) DFKI GmbH License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable This module coordinates the whole shebang. Parses input and plucks out ...
nevrenato/HetsAlloy
utils/DrIFT-src/ChaseImports.hs
gpl-2.0
4,484
0
18
1,275
1,353
713
640
79
4
-- | this module contains data types -- that are needed to write the API for polynomials. -- implementors of API should not rely on their efficiency (?) {-# language TemplateHaskell #-} {-# language DeriveDataTypeable #-} {-# language GeneralizedNewtypeDeriving #-} module Polynomial.Base where import qualified P...
marcellussiegburg/autotool
collection/src/Polynomial/Base.hs
gpl-2.0
3,391
8
14
921
1,440
764
676
86
4
module Handler.CategoryListSpec (spec) where import TestImport spec :: Spec spec = withApp $ do describe "getCategoryListR" $ do error "Spec not implemented: getCategoryListR" describe "postCategoryListR" $ do error "Spec not implemented: postCategoryListR"
Southern-Exposure-Seed-Exchange/Order-Manager-Prototypes
yesod/test/Handler/CategoryListSpec.hs
gpl-3.0
288
0
11
62
60
29
31
8
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UnicodeSyntax #-} module Prelude.Unicode.SR ( (×), (⨯), (↑), (⇑), (‼), (+≫), (≪+), (⦷), (⁄), (↑≪), (≫↑), (⥈), (↭), (↑+), (↑×), (∥), (‖), (∨∨), (∧∧) ) where import Control.Applicative import Control.Applicative....
eigengrau/haskell-unicode-symbols
src/Prelude/Unicode/SR.hs
gpl-3.0
2,568
0
9
621
1,060
646
414
73
1
module Match.State.MatchBase where import Control.Monad import qualified Data.IntMap as M import Data.Maybe import Data.List import Data.Ord import FVector import qualified Gen import Match.Ball import Match.Player import Match.State.MatchState plspeed :: Float -> Float -> Float -> Player -> Float plspeed sc smin ...
anttisalonen/freekick2
src/Match/State/MatchBase.hs
gpl-3.0
6,197
0
14
1,328
2,295
1,184
1,111
168
3
module Main where import Statistics.Test.StudentT import Statistics.Test.MannWhitneyU import Statistics.Types import qualified Data.Vector.Generic as Vect main :: IO () main = do let p = 0.05 xs = [134, 146, 104, 119, 124, 161, 107, 83, 113, 129, 97, 123] ys = [70, 118, 101, 85, 107, 132, 94] let mw...
thalerjonathan/phd
coding/learning/haskell/mannWhitney/src/Main.hs
gpl-3.0
1,486
0
12
442
453
237
216
38
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Commands.Unset (commands) where import qualified Data.Text as T import System.Exit (exitFailure) import Core import Options import Schema import Sql (SqlBackend, SqlRecord, ToBackendKey, Transaction, (=.)) import qualif...
merijn/GPU-benchmarks
benchmark-analysis/ingest-src/Commands/Unset.hs
gpl-3.0
5,585
0
13
1,654
1,070
581
489
113
2
module Chap05.Data.BinaryTree where import Prelude hiding (foldr) import Test.QuickCheck (Arbitrary(..), sized, choose) import Control.Applicative (pure, liftA3) import Data.Foldable data BinaryTree a = E | T a (BinaryTree a) (BinaryTree a) deriving (Show, Eq) instance Functor Bin...
stappit/okasaki-pfds
src/Chap05/Data/BinaryTree.hs
gpl-3.0
785
0
13
266
347
178
169
23
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.Healthcare -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla P...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare.hs
mpl-2.0
62,538
0
122
8,841
5,770
4,433
1,337
1,064
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/QuickPreview.hs
mpl-2.0
5,674
0
16
1,220
705
413
292
110
1
-- | Important comment thrown in type MySynonym b a = MySynonym a b -> MySynonym a b -> MyParamType a b -> MyParamType a b
lspitzner/brittany
data/Test180.hs
agpl-3.0
125
0
8
28
42
21
21
2
0
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } func = if x then if y -- y is important then foo else bar else Nothing
lspitzner/brittany
data/Test510.hs
agpl-3.0
197
0
6
40
24
15
9
5
3
module X_2019_05_21_NonEmpty_Exercise where import Prelude as P import qualified Data.List.NonEmpty as NE {-# ANN module ("HLint: ignore Eta reduce"::String) #-} -- Below, whereever it uses 'undefined' means -- there is no 'a' to create a 'NonEmpty a' with - so the function is not TOTAL. -- I c...
haroldcarr/learn-haskell-coq-ml-etc
haskell/0-geoff/misc/src/X_2019_05_21_NonEmpty_Exercise.hs
unlicense
2,990
0
11
685
897
468
429
52
2
module Main (main) where import Control.Comonad import Control.Monad (unless) import Control.Monad.IO.Class (liftIO) import System.Random (randomIO) import UI.NCurses import GameOfComonads.Board generateBoard :: Integer -> Integer -> IO (Board Bool) generateBoard w h = fmap Board $ sequence [ sequence [ randomIO | _...
puffnfresh/game-of-comonads
GameOfComonads/Main.hs
unlicense
1,179
0
14
268
468
233
235
30
2
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} -- Plugin LDAP authentication for Yesod, based heavily on Yesod.Auth.Kerberos. -- Verify that your LDAP installation can bind and return LDAP objects before -- trying to use this module. -- sample manual LDAP code he...
keynslug/sustain
src/Yesod/Auth/LDAP.hs
unlicense
4,012
0
29
1,468
751
412
339
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} module CallbackPeriodicSpec(spec) where import Bio.Motions.Callback.Class import Bio.Motions.Callback.Periodic import Bio.Motions.Representation.Class import Data.Proxy import Test....
Motions/motions
test/CallbackPeriodicSpec.hs
apache-2.0
2,112
0
21
498
451
228
223
-1
-1
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, TemplateHaskell, TypeFamilies, OverloadedStrings #-} module Bindrop.State.UploadDB where import Control.Lens.TH ( makeLenses ) import Data.Acid import Data.Data ( Data, Typeable ) import Data.IxSet ( Indexable(..), (@=), (@<), ge...
mcmaniac/bindrop
src/Bindrop/State/UploadDB.hs
apache-2.0
1,921
0
8
617
474
276
198
45
1
module Emul8.Machine where import Common.Core import Common.Instr import Emul8.Font import Emul8.Keyboard import Emul8.Screen import Control.Applicative import Data.Array import Data.Bits import Data.Maybe (isJust, fromJust) import System.Random -- Registers type Regs = Array Nybble Byte -- initial registers (all ...
jepugs/emul8
src/Emul8/Machine.hs
apache-2.0
10,066
0
16
3,960
3,458
1,778
1,680
234
47
fib = 1 : 1 : [a + b | (a, b) <- zip fib (tail fib)] ff n = head $ filter ((> 1) . (gcd n)) fib tst = do n <- getLine let n' = read n let x = ff n' putStrLn $ show x ++ " " ++ (show $ gcd x n') main = getLine >>= \t -> mapM_ (const tst) [1 .. (read t)]
pbl64k/CodeSprints
CodingChallenge-2012-06-18-Amazon-India/FibonacciFactor/ff.accepted.hs
bsd-2-clause
266
0
11
84
183
92
91
8
1
{- - Early parser for TAGs: Core Types. -} module NLP.LTAG.Early3.Core where -- | Position in the sentence. type Pos = Int -- | Additional identifier. type ID = Int -- | Symbol: a (non-terminal, maybe identifier) pair. type Sym n = (n, Maybe ID) -- | Label: either a symbol or a terminal. type Lab n t = Eit...
kawu/ltag
src/NLP/LTAG/Early3/Core.hs
bsd-2-clause
334
0
7
76
60
40
20
5
0
{-# LANGUAGE ImplicitParams #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Certify (certify, certifySD) where import Tct.Core import qualified Tct.Trs.Data.Problem as Prob import qualified Tct.Trs.Data.Signature as Sig import qualified Tct.Trs.Data.Trs as Trs import Tct.T...
ComputationWithBoundedResources/tct-config-mischel
Certify.hs
bsd-3-clause
3,085
0
19
904
1,050
523
527
68
2
module Data.Foldable.Strict ( foldMap' , module Data.Foldable ) where import Data.Foldable import Data.Monoid foldMap' :: (Monoid m, Foldable f) => (a -> m) -> f a -> m foldMap' f xs = foldl' (\a b->mappend a $ f b) mempty xs
bgamari/minir
Data/Foldable/Strict.hs
bsd-3-clause
284
0
9
99
103
56
47
6
1
module Main where import Test.DocTest main :: IO () main = doctest [ "-XOverloadedStrings" , "Network/Wai/Application/Classic.hs" ]
kazu-yamamoto/wai-app-file-cgi
test/doctests.hs
bsd-3-clause
142
0
6
27
33
19
14
6
1
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANG...
afcady/servant-reflex
src/Servant/Reflex/Multi.hs
bsd-3-clause
15,944
0
20
4,855
4,622
2,425
2,197
267
1
{- Copyright (c) 2013, Markus Barenhoff <alios@alios.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of c...
alios/nauticlib
src/Data/ISO8211.hs
bsd-3-clause
1,698
0
5
316
35
24
11
5
0
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeInType #-} -- TODO -- Updater -- easier -- this one's probably not needed -- NullMaker -- easier -- Constant -- harder -- Quer...
WraithM/haskell-opaleye
src/Opaleye/Internal/TypeFamilies.hs
bsd-3-clause
1,937
0
11
488
1,049
598
451
-1
-1
module Bluetooth.Internal.Lenses where import Lens.Micro class HasPath s a | s -> a where -- | Returns the `ObjectPath` of an entity. path :: Lens' s a class HasValue s a | s -> a where -- | Returns the actual value of an entity that is wrapped in an value :: Lens' s a class HasOffset s a | s -> a where -- ...
plow-technologies/ble
src/Bluetooth/Internal/Lenses.hs
bsd-3-clause
1,862
0
7
431
434
235
199
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Cauterize.DynamicSpec ( spec ) where import Cauterize.Dynamic import Test.Hspec import TestSupport import Control.Exception import Data.Word import qualified Cauterize.Specification as Spec import qualified Data.ByteString as B import qualified Data.Map as M import quali...
reiddraper/cauterize
tests/Cauterize/DynamicSpec.hs
bsd-3-clause
9,610
0
24
3,348
2,452
1,315
1,137
157
2
module Lava.Error ( Error(..) , wrong ) where ---------------------------------------------------------------- -- Error data Error = DelayEval | VarEval | CombinationalLoop | BadCombinationalLoop | UndefinedWire | IncompatibleStructures | NoEquality | NoArithmetic | EnumOnSymbols | Interna...
dfordivam/lava
Lava/Error.hs
bsd-3-clause
1,309
0
9
352
189
105
84
33
11
module WriteFiles where import Control.Monad.RWS.Strict import AI.UASI.Utils.StringTools import Data.List import Types import Logging l = "tundra.writefiles" saveExtractedFs :: [TExtracted] -> Tundra [TExtracted] saveExtractedFs xs = do info l "Saving extracted features to files" mapM_ saveExtracted xs i...
deggis/guesswork
src/Guesswork/Export/WriteFiles.hs
bsd-3-clause
1,530
0
14
405
494
241
253
-1
-1
module Actor.ConstantTypes where data Constants = Constants { boostCount :: Int , boostStrength :: Double , boostTime :: Double , boostUpPenalty :: Double , doubleTapTime :: Double , firstLevel :: String , gameHeight :: Int , gameWidth :: Int , gravityStrength ...
isovector/iwmag
src/Actor/ConstantTypes.hs
bsd-3-clause
626
0
8
200
126
83
43
21
0
module Data.Char.Properties.BidiCategory ( module Data.Char.Properties.BidiCategoryTypes, module Data.Char.Properties.BidiCategoryData ) where { import Data.Char.Properties.BidiCategoryData; import Data.Char.Properties.BidiCategoryTypes; }
seereason/unicode-properties
Data/Char/Properties/BidiCategory.hs
bsd-3-clause
272
0
5
47
44
33
11
6
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-| Module : Network.Spotify.Api.Types.Track Description : Information about a track. Stability : experimental -} module Network.Spotify.Api.Types.Track where import Data.Aeson (FromJSON (parseJSON),...
chances/servant-spotify
src/Network/Spotify/Api/Types/Track.hs
bsd-3-clause
6,822
0
15
3,451
532
349
183
59
0
module Reverse where -- revers words in a sentence rvrs :: String -> String rvrs "" = "" rvrs x = if second == "" then first else second ++ " " ++ first where notSpace = (/=) ' ' first = takeWhile notSpace x left = dropWhile notSpace x rest "" = "" rest (z:zs) = zs second = rvrs (rest left)
chengzh2008/hpffp
src/ch03-Strings/reverseWithTakeDrop.hs
bsd-3-clause
319
0
9
90
119
64
55
10
3
import Text.XML.YJSVG main = putStrLn $ showSVG 600 550 $ Group [ Translate 0 100 ] weatherGraph : [ Text 20 20 15 (ColorName "black") "[ 1897-2009 ]" ] weatherGraph :: [ SVG ] weatherGraph = mkGraphSVG 8 30 [ 12, 17 ] [ ( "green", [ 12.5, 13.3, 13.0, ...
YoshikuniJujo/yjsvg_haskell
tests/graph.hs
bsd-3-clause
3,367
16
12
1,025
1,503
936
567
59
1
module Obsidian.MonadObsidian.Printing where import Obsidian.MonadObsidian.Exp import Obsidian.MonadObsidian.AbsC import Control.Monad.State {- PRINTING OF DEXPS -} pprint (LitInt a) = show a pprint (LitFloat a) = show a pprint (LitBool a) = show a --pprint (Op2 Rem b c) = "remainderf(" ++ pprint b ++ "," ++ ...
svenssonjoel/MonadObsidian
Obsidian/MonadObsidian/Printing.hs
bsd-3-clause
3,494
0
14
1,031
1,255
616
639
67
2
{-# LANGUAGE OverloadedStrings #-} module Elos.DB ( DB(..), Query(..), Change(..), ) where import Data.Aeson.Types import Data.ByteString as B import Data.Text as T data DB = DB { host :: String, username :: B.ByteString, password :: B.ByteString } data Query a = Query { kind :: T.Te...
elos/hs
src/Elos/DB.hs
bsd-3-clause
973
0
16
285
279
161
118
30
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | Extra data types (mostly wrappers around existing types) module Graphics.UI.Cocos2d.Extra ( Size(..) , size_width , size_height , Rect(..)...
lynnard/cocos2d-hs
src/Graphics/UI/Cocos2d/Extra.hs
bsd-3-clause
1,509
0
11
314
598
322
276
44
1
{-# LANGUAGE CPP #-} module HsColour(hsColourHTML, hsColourConsole) where #ifdef GPL_SCARES_ME hsColourConsole :: String -> String hsColourConsole = id hsColourHTML :: String -> String hsColourHTML = id #else import Prelude import Language.Haskell.HsColour.TTY as TTY import Language.Haskell.HsColour.Colourise imp...
ndmitchell/hlint
src/HsColour.hs
bsd-3-clause
526
0
5
68
44
28
16
10
1
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.SGIX.TextureAddEnv -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabili...
haskell-opengl/OpenGLRaw
src/Graphics/GL/SGIX/TextureAddEnv.hs
bsd-3-clause
660
0
5
91
47
36
11
7
0
module Servant.FileUpload.Internal where primaryBodyKey :: String primaryBodyKey = "_servant_primary_body"
rimmington/servant-file-upload
servant-file-upload/src/Servant/FileUpload/Internal.hs
bsd-3-clause
108
0
4
10
17
11
6
3
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} {- This file is part of the Haskell package cassava-streams. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at git://pmade.com/cassava-streams/LICENSE. No part of cassava-streams...
pjones/cassava-streams
src/System/IO/Streams/Csv/Decode.hs
bsd-3-clause
6,607
0
20
1,632
1,158
599
559
85
6
#if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-} #endif {-# LANGUAGE PatternGuards #-} -- This template expects CPP definitions for: -- MODULE_NAME = Posix | Windows -- IS_WINDOWS = False | True -- | -- Module : System.FilePath.MODULE_NAME -- Copyright : (c) Neil Mitchell 2005-2014 -- License ...
DavidAlphaFox/ghc
libraries/filepath/System/FilePath/Internal.hs
bsd-3-clause
35,577
0
18
6,872
4,846
2,786
2,060
286
6
-- | Code generation for ImpCode with CUDA kernels. module Futhark.CodeGen.ImpGen.CUDA ( compileProg, Warnings, ) where import Data.Bifunctor (second) import Futhark.CodeGen.ImpCode.OpenCL import Futhark.CodeGen.ImpGen.GPU import Futhark.CodeGen.ImpGen.GPU.ToOpenCL import Futhark.IR.GPUMem import Futhark.Monad...
HIPERFIT/futhark
src/Futhark/CodeGen/ImpGen/CUDA.hs
isc
525
0
8
68
108
65
43
11
1
module Fmod4 where import Data.List import Prelude -- Edited in emacs isNotInt :: (Integral a, RealFrac b) => b -> a -> Bool isNotInt x n = (round $ 10^(fromIntegral n)*(x-(fromIntegral $ round x)))/=0 cat :: (RealFrac a, RealFrac a1) => a -> a1 -> Double cat l m | m < 0 = 55555 | isNotInt l 3 = 565656 ...
dschalk/score
Haskell/old_stuff/Fmod4.hs
mit
5,275
0
18
2,065
2,805
1,550
1,255
86
1
-- | This module is testing the server api. {-# LANGUAGE TypeFamilies #-} module Test.Pos.Explorer.Web.ServerSpec ( spec ) where import Universum import Test.Hspec (Spec, describe, shouldBe) import Test.Hspec.QuickCheck (modifyMaxSuccess, prop) import Test.Quick...
input-output-hk/pos-haskell-prototype
explorer/test/Test/Pos/Explorer/Web/ServerSpec.hs
mit
16,388
0
22
6,024
2,011
1,057
954
-1
-1
module Matrix ( Matrix, row, column, rows, cols, shape, transpose, reshape, flatten, fromString, fromList ) where import Data.Vector (Vector) import qualified Data.Vector as V import Data.List.Split (chunksOf) data Matrix a = Matrix (Vector (Vector a)) deriving (Eq, Show) fromString :: Read a...
Bugfry/exercism
exercism/haskell/matrix/src/Matrix.hs
mit
1,203
0
11
288
599
313
286
40
2
module Main where import System.Environment import System.Directory import System.FilePath import qualified Control.Exception as Exc import EvaluationMonad import GenStrat import SolutionContext import NormalizationStrategies import CoreS.AST import qualified CoreS.ASTUnitype as AST import CoreS.ASTUnitypeUtils impor...
Centril/DATX02-17-26
execsrc/Eval.hs
gpl-2.0
2,322
0
20
617
685
351
334
54
2
-- $Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp $ #ifdef HAPPY_GHC #undef __GLASGOW_HASKELL__ #define HAPPY_IF_GHC_GT_500 #if __GLASGOW_HASKELL__ > 500 #define HAPPY_IF_GHC_GE_503 #if __GLASGOW_HASKELL__ >= 503 #define HAPPY_ELIF_GHC_500 #elif __GLASGOW_HASKELL__ == 500 #define HAPPY_IF_GHC_GT_706 #...
PhilThomas/happy
templates/GenericTemplate.hs
bsd-2-clause
12,841
38
19
2,909
2,743
1,507
1,236
-1
-1
module Main where import qualified System.IO.Streams.Network.HAProxy.Tests as HAProxy import Test.Framework (defaultMain, testGroup) ------------------------------------------------------------------------------ main :: IO () main = defaultMain tests where tests = [ testGroup...
snapframework/io-streams-haproxy
test/TestSuite.hs
bsd-3-clause
353
0
9
73
65
40
25
6
1
{-# LANGUAGE PackageImports #-} module Number.F2m (benchF2m) where import Criterion.Main import System.Random import Crypto.Number.Basic (log2) import Crypto.Number.F2m genInteger :: Int -> Int -> Integer genInteger salt bits = head . dropWhile ((< bits) . log2) . scanl (\a r -> a * 2^(31 :: Int) + abs ...
tekul/cryptonite
benchs/Number/F2m.hs
bsd-3-clause
1,271
0
15
331
503
261
242
38
1
{- -*- Mode: haskell; -*- Haskell LDAP Interface Copyright (C) 2005 John Goerzen <jgoerzen@complete.org> This code is under a 3-clause BSD license; see COPYING for details. -} import Data.Char import Data.List const2HS (x:xs) = x : c2hs xs where c2hs [] = [] c2hs ('_':x:xs) = x : c2hs xs ...
ezyang/ldap-haskell
utils/genconsts.hs
bsd-3-clause
4,437
11
34
847
778
424
354
89
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} -- Tests for creating and initializing a @SmallArray#@ including the -- optimiziation where GHC inlines the code instead of calling the -- @newSmallArray#@ primop if the length is small enough and known at compile -- time. module M...
sdiehl/ghc
testsuite/tests/codeGen/should_run/NewSmallArray.hs
bsd-3-clause
3,285
0
14
923
979
473
506
76
1
{-# LANGUAGE OverloadedStrings #-} module Response.NotFound (notFoundResponse) where import Text.Blaze ((!)) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Happstack.Server import Util.Blaze notFoundResponse :: ServerPart Response notFoundResponse = no...
Ian-Stewart-Binks/courseography
hs/Response/NotFound.hs
gpl-3.0
1,223
0
14
335
247
124
123
30
1
import Network.Wai.Application.Static import Network.Wai.Handler.Warp (run) main :: IO () main = run 3000 $ staticApp defaultStaticSettings { ssFolder = fileSystemLookup "." , ssMaxAge = MaxAgeForever , ssIndices = [] }
MaxGabriel/yesod
yesod-static/test/unicode/sample.hs
mit
237
1
7
47
76
41
35
7
1
{-# LANGUAGE BangPatterns, MultiWayIf #-} --TODO: This code could use some separation between the mainloop code and the rendering code. It's "good enough" for now, but growing this code is quite cumbersome module Play (GetMove, play) where import System.IO (stdout) import System.Console.ANSI ( hSupportsANSI, ...
sunjay/reversi
app/Play.hs
mit
5,574
0
14
1,521
1,681
848
833
134
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Data.HighJson.THSpec ( spec ) where import Data.HighJson import Data.HighJson.TH import Control.Lens.TH import Data.Swagger import Test.Hspec import Test.QuickCheck hiding (Su...
agrafix/highjson
highjson-th/test/Data/HighJson/THSpec.hs
mit
901
0
9
190
220
123
97
32
1
module Irg.Lab4.Fractal.Callbacks where import Control.Monad import Control.Arrow import Data.IORef import qualified Control.Concurrent.Thread.Delay as CC import qualified Graphics.GL.Compatibility33 as GL import qualified Graphics.UI.GLUT as GLUT import qualified Data.Vector as V import Linear import Irg.Lab4.Fractal...
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab4/Fractal/Callbacks.hs
mit
1,966
0
12
326
678
342
336
48
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.ValidityState (js_getValueMissing, getValueMissing, js_getTypeMismatch, getTypeMismatch, js_getPatternMismatch, getPatternMismatch, js_getTooLong, getTooLong, js_getRangeUnderflow, getRangeU...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/ValidityState.hs
mit
5,229
60
9
684
1,033
579
454
71
1
module Main where -- Making head function more rock-solid -- λ> Main.head example -- [] -- λ> Prelude.head example -- *** Exception: Prelude.head: empty list head :: Monoid a => [a] -> a head (x:xs) = x head [] = mempty example :: [[Int]] example = [] main :: IO () main = undefined
raventid/coursera_learning
haskell/will_kurt/unit6/36_main_module.hs
mit
288
0
7
57
86
50
36
8
1
module Main ( main, test ) where import Test_Support import qualified Linalg_Test import qualified Ext_Test import qualified Data_Test main :: IO () main = defaultMain test test :: Test test = do Linalg_Test.test Ext_Test.test Data_Test.test
emma-borhanian/hs_linalg_practice
test/Main.hs
mit
252
0
7
45
70
40
30
12
1
module Philed.Data.Maybe (module Data.Maybe, plusMaybe) where import Data.Maybe plusMaybe :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a plusMaybe f (Just x) (Just y) = Just (f x y) plusMaybe _ Nothing y = y plusMaybe _ x Nothing = x
Chattered/PhilEdCommon
Philed/Data/Maybe.hs
mit
239
0
8
49
119
62
57
6
1
-- | -- Module : Data.Edison.Seq.RandList -- Copyright : Copyright (c) 1998-1999, 2008 Chris Okasaki -- License : MIT; see COPYRIGHT file for terms and conditions -- -- Maintainer : robdockins AT fastmail DOT fm -- Stability : stable -- Portability : GHC, Hugs (MPTC and FD) -- -- Rando...
robdockins/edison
edison-core/src/Data/Edison/Seq/RandList.hs
mit
16,632
0
14
5,186
7,403
3,848
3,555
382
5
#!/usr/bin/env runhaskell {-# LANGUAGE GeneralizedNewtypeDeriving #-} import Numeric (showFFloat) import Control.Exception (catch) import Data.Maybe (listToMaybe) import Data.Char (isSpace) newtype DollarAmount = DollarAmount Float deriving (Eq, Ord, Num) instance Show DollarAmount where show (DollarAmount f) = ...
benekastah/phone-bill-calculator
other/phone.hs
mit
3,331
2
19
970
1,076
536
540
79
4
module Game where import System.IO import Board import Input _makeMove :: Board -> IO Move _makeMove (_, (w, h)) = do x <- getX w y <- getY h dir <- getDirection return ((x, y), dir) start :: IO Int start = loop trunkBoard end :: IO Int end = return 0 loop :: Board -> IO Int loop board = do if getNumBa...
crockeo/ballgame
src/Game.hs
mit
605
0
12
184
231
112
119
28
3
import IntCode -- 15097178 part_1 :: String -> IO () part_1 prog = print $ runForOutput prog [1] -- 1558663 part_2 :: String -> IO () part_2 prog = print $ runForOutput prog [5] main :: IO () main = do prog <- getLine part_1 prog part_2 prog
wizzup/advent_of_code
2019/haskell/exe/Day05.hs
mit
252
1
7
58
117
55
62
10
1
{-# htermination signum :: Num a => a -> a #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_signum_1.hs
mit
47
0
2
11
3
2
1
1
0
module Data.RPN.Evaluator (evaluateCodes,loadCodes) where import Control.Monad.State import Data.Fixed import qualified Data.Map as DM import Data.RPN.Internal.Types import qualified Data.Sequence as DS type SymbolTab = DM.Map String (Maybe Double) type Stack = ...
danplubell/yarpn
yarpn-lib/src/Data/RPN/Evaluator.hs
mit
3,173
1
14
835
1,072
525
547
87
17
module CFDI.Types.PropertyAccountNumber where import CFDI.Chainable import CFDI.Types.Type import Data.Text (Text, pack, unpack) import Text.Regex (mkRegex) import Text.Regex.Posix (matchTest) newtype PropertyAccountNumber = PropertyAccountNumber Text deriving (Eq, Show) instance Chainable PropertyAccou...
yusent/cfdis
src/CFDI/Types/PropertyAccountNumber.hs
mit
656
0
9
112
177
94
83
15
0
module Handler.Delete where import Assets (getAllExams, checkTitleField) import Import import Widgets (titleWidget, iconWidget, publicExamWidget, postWidget, privateExamWidget) -- | Checks for login -- Logged in -> Asks for exam title -- otherwise -> Prompts to login getDeleteR :: ExamId -> Handle...
cirquit/quizlearner
quizlearner/Handler/Delete.hs
mit
2,559
0
17
950
446
229
217
-1
-1
module Party where import Employee import Data.Tree -- Exercise-1 -- 1) adds and Employee to the GuestList Naively glCons :: Employee -> GuestList -> GuestList glCons emp@(Emp name fun) (GL gList funScore) = GL (emp:gList) (fun + funScore) -- 2) Monoid instance for GuestList with max operation instance Monoid Guest...
dinnu93/CIS194
Lecture-08/Party.hs
cc0-1.0
726
0
11
148
244
131
113
12
1
-- udisksevt source file -- Copyright (C) Vladimir Matveev, 2010 -- Logging routines module UDisksEvt.Log where import DBus.Message import DBus.Types (ObjectPath) import System.IO import Control.Concurrent.MVar import qualified Data.Text as B -- Print simple log message; now using only stdout logOk :: String -> IO...
netvl/udisksevt
UDisksEvt/Log.hs
gpl-2.0
1,941
0
12
372
413
213
200
31
1
{-| Utility functions. -} {- 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 License, or (at your option) any later ve...
narurien/ganeti-ceph
src/Ganeti/Utils.hs
gpl-2.0
16,535
0
20
4,213
3,652
1,963
1,689
254
4
{-# OPTIONS_GHC -fno-warn-orphans #-} module Darcs.Patch.V1.Apply () where import Darcs.Patch.Apply ( ApplyState, Apply, apply ) import Darcs.Patch.Prim ( PrimPatch, applyPrimFL ) import Darcs.Patch.Repair ( RepairToFL, applyAndTryToFixFL, mapMaybeSnd ) import Darcs.Patch.Effect ( effect ) ...
DavidAlphaFox/darcs
src/Darcs/Patch/V1/Apply.hs
gpl-2.0
786
0
9
144
237
134
103
-1
-1
{- Copyright (C) 2007-8 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 dis...
kowey/pandoc-old
src/Text/Pandoc/Writers/ConTeXt.hs
gpl-2.0
12,114
0
20
3,282
3,196
1,561
1,635
224
20
{- | Module : $Header$ Description : Some basic types for simple boolean representations Copyright : (c) Ewaryst Schulz, DFKI Bremen 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : ewaryst.schulz@dfki.de Stability : experimental Portability : portable This module defines some basic t...
nevrenato/Hets_Fork
CSL/BoolBasic.hs
gpl-2.0
1,847
0
13
514
431
217
214
26
6
--------------------------------------------------------------------------- -- This file is part of grammata. -- -- grammata 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...
SRechenberger/grammata
src/Grammata/Machine/Core/Logical.hs
gpl-3.0
15,172
21
30
4,995
3,960
2,073
1,887
233
6
module SpacialGameEnv.RunSGEnv where import SpacialGameEnv.SGModelEnv import qualified PureAgents2DDiscrete as Front import qualified Graphics.Gloss as GLO import Graphics.Gloss.Interface.IO.Simulate import qualified PureAgentsPar as PA import System.Random import Data.Maybe import Data.List winTitle = "Spacial Gam...
thalerjonathan/phd
public/ArtIterating/code/haskell/PureAgentsPar/src/SpacialGameEnv/RunSGEnv.hs
gpl-3.0
4,366
0
12
1,564
1,185
623
562
85
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- Module : Data.SemVer.Internal -- Copyright : (c) 2014-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy...
brendanhay/semver
src/Data/SemVer/Internal.hs
mpl-2.0
5,159
0
12
1,486
1,197
650
547
127
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/MobileCarriers/List.hs
mpl-2.0
3,021
0
13
675
320
194
126
52
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-books/gen/Network/Google/Resource/Books/MyLibrary/Bookshelves/MoveVolume.hs
mpl-2.0
6,562
0
22
1,566
974
562
412
144
1
{-# LANGUAGE OverloadedStrings #-} module Core.Component where import qualified Data.ByteString.Char8 as BS import qualified Core.Database as DB import qualified Core.Request as Req import qualified Core.Response as Res import qualified Database.MongoDB as Mongo import qualified Database.Redis as R import qualified Da...
inq/manicure
src/Core/Component.hs
agpl-3.0
2,403
0
14
483
788
421
367
55
2
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas lakjsdlajsdljas lakjsdlajsdljas
lspitzner/brittany
data/Test433.hs
agpl-3.0
221
0
5
23
14
7
7
4
1
-------------------------------------------------------------------------------- -- $Id: Parse.hs,v 1.1 2004/01/13 12:31:24 graham Exp $ -- -- Copyright (c) 2003, G. KLYNE. All rights reserved. -- See end of this file for licence information. --------------------------------------------------------------------...
amccausl/Swish
Swish/HaskellUtils/Parse.hs
lgpl-2.1
8,451
0
11
1,843
1,543
886
657
81
1
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveFunctor, FlexibleContexts #-} module Control.Monad.Trans.FreeList where import Prelude hiding (foldl, foldr, Fix) import Control.Monad.Logic import Control.Monad.Cont.Class import Control.Monad.Trans.Class import Control.Applicative import Control.Monad.Free.Cla...
tapuu/FreeList
src/Control/Monad/Trans/FreeList.hs
lgpl-3.0
2,915
8
26
661
1,202
630
572
-1
-1
{-# LANGUAGE FlexibleContexts #-} import Data.Functor import Control.Monad import Data.List import qualified Data.Map as M import Text.Parsec import Text.Parsec.Token import Control.Monad.Random type Id = String data SKI = SSmth String | S | K | I | SKIW | App SKI SKI | Var Id deriving (Show, Eq) data Lambda = LSmth ...
k32/QFL
tools/Lam2W.hs
unlicense
3,917
0
17
1,050
1,878
949
929
121
2
-- Copyright (c) 2014-2015 Jonathan M. Lange <jml@mumak.net> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by ...
jml/haverer
tests/Round.hs
apache-2.0
6,041
0
15
1,071
1,167
614
553
99
2
module KthDifferences.A999999 (a999999_list, a999999) where import External.A174344 (a174344) import Miscellaneous.A268038 (a268038) import Data.Set (Set) import qualified Data.Set as Set import Data.Maybe (Maybe, mapMaybe) type KthDifferences = [((Integer, Integer), Set (Integer, Integer))] -- Starting at (0,0) and ...
peterokagey/haskellOEIS
src/Sandbox/GreedySpiralSequences/KthDifferences.hs
apache-2.0
1,535
1
14
249
488
283
205
22
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Parse.Haskell.Layout ( -- * Before removing layout Laid(..) , prepare -- * Removing layout , unlayout ) where import qualified Control.Applicative as A import qualified Control.Monad as M import qualified Data.Lis...
edom/ptt
src/Parse/Haskell/Layout.hs
apache-2.0
5,194
0
13
1,189
2,089
1,046
1,043
121
1
{-# LANGUAGE TemplateHaskell, UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Type.Hex -- Copyright : (C) 2006 Edward Kmett -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gm...
ekmett/type-int
Data/Type/Hex.hs
bsd-2-clause
1,542
0
5
293
165
122
43
21
0
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QStyleOptionFrame.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:35 Warning : this file is machine generated ...
uduki/hsQt
Qtc/Enums/Gui/QStyleOptionFrame.hs
bsd-2-clause
4,581
0
18
919
1,074
528
546
89
1
{- | Routines for examining moves and board positions in western-style chess. -} module ChessTools.Board.Western ( algebraicToIndex , indexToAlgebraic , westernBoardSize ) where import Data.Char (ord, chr) import ChessTools.Board -- | The 'BoardSize' for a western-style chessboard. westernBoardSize...
malcolmt/chess-tools
src/ChessTools/Board/Western.hs
bsd-3-clause
1,588
0
13
320
262
146
116
18
2
module Reflex.Stripe ( module Reflex.Stripe.Elements.Object , module Reflex.Stripe.Elements.Types , module Reflex.Stripe.Elements.Card , module Reflex.Stripe.Elements.CardCvc , module Reflex.Stripe.Elements.CardExpiry , module Reflex.Stripe.Elements.CardNumber , module Reflex.Stripe.Elements.PostalCode ...
ConferHealth/reflex-stripe
src/Reflex/Stripe.hs
bsd-3-clause
717
0
5
71
139
100
39
19
0
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -fno-warn-unused-do-bind #-} module Blaze.Html5 ( -- * Re-exports module Text.Blaze ,module Text.Blaze.Html5 ,module Text.Blaze.Html5.Attributes -- * Attribute combinators ,Attributable ,(!.) ,(!#) -- * Common operations ,linesToHtml ,htmlIntercal...
chrisdone/blaze
src/Blaze/Html5.hs
bsd-3-clause
1,536
0
7
299
431
252
179
37
1