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 Main where import Test.Tasty ( defaultMain , testGroup ) import HFlint.Test.FMPQ as FMPQ import HFlint.Test.FMPZ as FMPZ import HFlint.Test.FMPQPoly as FMPQPoly import HFlint.Test.FMPZPoly as FMPZPoly import HFlint.Test.Primes as Primes main = defaultMain $ testG...
martinra/hflint
test/HFlint/Test.hs
gpl-3.0
459
0
8
140
96
63
33
14
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleContexts #-} -- | -- Copyright : (c) 2010-2012 Benedikt Schmidt -- License : GPL v3 (see LICENSE) -- -- Maintainer : Benedikt Schmidt <[email protected]> -- -- Standard and fresh substitutions. module Term.Substitution ( -- ** Composition of fresh and free ...
ekr/tamarin-prover
lib/term/src/Term/Substitution.hs
gpl-3.0
3,395
0
14
657
623
340
283
40
2
module XMonad.Prompt.VpnPrompt ( vpnPrompt ) where import Data.List import XMonad import XMonad.Prompt hiding ( pasteString ) import XMonad.Prompt.Common import System.FilePath import System.Directory import Control.Monad data Vpn = Vpn data StopVpn = StopVpn instance XPrompt Vpn where showXPrompt Vpn = ...
akermu/akermu-xmonad
src/XMonad/Prompt/VpnPrompt.hs
gpl-3.0
2,147
0
14
514
631
317
314
62
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Jobs.Types.Sum -- Copyright : (c) 2015-2016 Brendan Ha...
brendanhay/gogol
gogol-jobs/gen/Network/Google/Jobs/Types/Sum.hs
mpl-2.0
84,641
0
11
19,256
9,076
4,904
4,172
1,118
0
module Test.Compiler (iotests) where import Test.HUnit hiding (test) import System.Directory import Control.Monad import System.IO import CPP.CompileTools import FFI.TypeParser (importHni) windowsLineMode = NewlineMode { inputNL = CRLF, outputNL = CRLF } readFileCRLF name = do h <- openFile name ReadMode hSetNewli...
ingvar-lynn/HNC
Test/Compiler.hs
lgpl-3.0
701
10
14
118
270
142
128
19
1
{- Created : 2013 Sep 27 (Sat) 09:01:51 by carr. Last Modified : 2014 Mar 05 (Wed) 12:53:51 by Harold Carr. -} module FP00Lists where {-# ANN sum' "HLint: ignore Use sum" #-} sum' :: [Int] -> Int sum' = foldr (+) 0 {- sum' [] = 0 sum' (x:xs) = x + sum' xs -} max' :: [Int] -> Int max' [] = error "NoSuch...
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2013-11-coursera-fp-odersky-but-in-haskell/FP00Lists.hs
unlicense
513
0
9
146
102
59
43
7
2
import Data.Map (singleton, findMin, deleteMin, insert) a239870 n = a239870_list !! (n-1) a239870_list = f 9 (3, 2) (singleton 4 (2, 2)) where f zz (bz, ez) m | xx < zz = if ex `mod` 3 > 0 then xx : f zz (bz, ez+1) (insert (bx*xx) (bx, ex+1) $ deleteMin m) else f zz (bz, ez+1) (insert (bx*xx) (bx...
peterokagey/haskellOEIS
src/Sandbox/OEIS/A239870.hs
apache-2.0
592
0
15
165
430
233
197
12
3
-- Copyright 2019-2021 Google LLC -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed t...
google/hs-fin-vec
finite-table/src/Data/Finite.hs
apache-2.0
12,344
2
13
2,368
2,892
1,576
1,316
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-| Snap-agnostic low-level CRUD operations. No model definitions are used on this level. Instead, objects must be This module may be used for batch uploading of database data. -} module Snap.Snaplet.Redson.Snapless.CRUD ( -- * CRUD operations create , read , up...
dzhus/snaplet-redson
src/Snap/Snaplet/Redson/Snapless/CRUD.hs
bsd-3-clause
6,854
0
15
1,690
1,388
739
649
124
2
-- | -- This module contians the main nobs to control the game play. -- -- All length data is relative to the screen width. module Lseed.Constants where groundLevel :: Double groundLevel = 0.03 budSize :: Double budSize = 0.01 stipeLength :: Double stipeLength = 0.05 blossomSize :: Double blossomSize = 0.03 stipe...
nomeata/L-seed
src/Lseed/Constants.hs
bsd-3-clause
1,567
0
6
272
185
117
68
31
1
module Kata.Monad where import Data.Rope data QEnv = QEnv data DiagnosticState = DiagnosticState { stateDiagnosticMapping :: Map ByteString Severity , warningsAsErrors :: Bool, , errorsAsFatal :: Bool, , ignoreAllWarnings :: Bool , stateErrorHasOccurred :: Bool , stateFatalErrorHasOccurred ...
ekmett/kata
Kata/Monad.hs
bsd-3-clause
3,413
20
11
927
880
475
405
-1
-1
module Language.RTL.Code ( verilog ) where import Data.List import Text.Printf import Language.RTL.Core verilog :: Name -> Module -> IO () verilog name m = writeFile (name ++ ".v") $ unlines [ "module " ++ name , "( input reset" , ", input clock" , unlines [ printf ", input %-5s %s" (widthDecl w) name...
tomahawkins/rtl
Language/RTL/Code.hs
bsd-3-clause
1,531
0
16
480
744
361
383
45
19
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} module ExampleDataSource ( -- * initi...
xich/Haxl-1
tests/ExampleDataSource.hs
bsd-3-clause
5,357
1
10
1,180
784
441
343
68
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Rel.Github where import Data.ByteString.Lazy (ByteString) import qualified Data.Text as Text import Data.Aeson (FromJSON(parseJSON), eit...
shmookey/pure
src/Rel/Github.hs
bsd-3-clause
2,120
58
19
553
647
359
288
56
1
module Lets.StoreLens ( Store(..) , setS , getS , mapS , duplicateS , extendS , extractS , Lens(..) , getsetLaw , setgetLaw , setsetLaw , get , set , modify , (%~) , fmodify , (|=) , fstL , sndL , mapL , setL , compose , (|.) , identity , product , (***) , choice , (|||) , cityL , countryL , streetL , suburbL , local...
newmana/lets-lens
src/Lets/StoreLens.hs
bsd-3-clause
11,080
0
11
2,548
2,327
1,353
974
319
1
module Surreals ( Surreal(Surreal) ) where data Surreal = Surreal [Surreal] [Surreal] deriving Show leftSet (Surreal ls _) = ls rightSet (Surreal _ rs) = rs -- x >= y iff no Xᴿ <= y and x <= no yᴸ x `gte` y = not $ or $ (map (\xr -> xr `lte` y) (rightSet x)) ++ (map (\yl -> x `lte` yl) (leftSet y)) x `lte` y = ...
fonse/surreal-numbers
src/Surreals.hs
bsd-3-clause
1,365
0
13
396
775
399
376
33
1
{-# LANGUAGE DataKinds #-} module LDrive.Calibration where import Ivory.Language import Ivory.Stdlib import Ivory.Tower import Ivory.BSP.STM32.ClockConfig import LDrive.Platforms (currentMeasPeriod, currentMeasHz) import LDrive.Types import LDrive.Calibration.Inductance import LDrive.Calibration.Encoder import LDri...
sorki/odrive
src/LDrive/Calibration.hs
bsd-3-clause
4,134
0
23
1,101
1,242
571
671
105
1
-- 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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE Over...
rfranek/duckling
Duckling/Ordinal/UK/Corpus.hs
bsd-3-clause
1,885
0
9
742
287
174
113
53
1
-- 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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Volume/FR/Rules.hs
bsd-3-clause
2,107
0
13
516
519
293
226
63
2
----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Trans.List -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2001 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : ross...
ekmett/transformers
Control/Monad/Trans/List.hs
bsd-3-clause
2,666
0
14
666
860
454
406
48
1
module Main where import Funpaala main :: IO () main = funpaala
YoshikuniJujo/funpaala
app/Main.hs
bsd-3-clause
66
0
6
14
22
13
9
4
1
{-# LANGUAGE OverloadedStrings #-} module Language.Hakaru.Util.Visual where import System.IO import Control.Monad import Data.Aeson import Data.List import qualified Data.Text as T import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.ByteString.Char8 as BS plot :: Show a => [a] -> String -> IO () ...
zaxtax/hakaru-old
Language/Hakaru/Util/Visual.hs
bsd-3-clause
1,222
0
14
353
489
253
236
35
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} module Data.Foscam.File.ImageId( ImageId(..) , AsImageId(..) , imageId ) where import Control.Applicative(Applicative((<*>)), (<$>)) import Control.Category(id) import Control.Lens(Con...
tonymorris/foscam-filename
src/Data/Foscam/File/ImageId.hs
bsd-3-clause
2,723
0
16
719
878
500
378
81
1
module Chp4 where -- | pattern matching for functions -- | very similar as you define function with values as input, instead of type variables -- | the output type should be consistent. Type inference will check for it pm 3 4 = "7" pm 1 2 = "3" pm x y = "Other then else" -- | for triplet tuple, we can wild card fir...
jamesyang124/haskell-playground
src/Chp4.hs
bsd-3-clause
5,219
0
11
1,240
801
433
368
46
3
{-# LANGUAGE CPP #-} module Main where import qualified Ros.Test_srvs.AddTwoIntsRequest as Req import qualified Ros.Test_srvs.AddTwoIntsResponse as Res import Ros.Test_srvs.EmptyRequest import Ros.Test_srvs.EmptyResponse import Ros.Service (callService) import Ros.Service.ServiceTypes import Test.Tasty import Test.Tast...
akru/roshask
Tests/ServiceClientTests/ServiceClientTest.hs
bsd-3-clause
5,054
0
15
1,079
1,108
583
525
91
3
{-# LANGUAGE TypeFamilies, TemplateHaskell, MultiParamTypeClasses, OverloadedLists,RecordWildCards #-} -- | Anything that isn't a standard class like Eq, Show, or Ord goes in this module. module Network.AuthorizeNet.Instances where import Network.AuthorizeNet.Request import Network.AuthorizeNet.Response import Networ...
MichaelBurge/haskell-authorize-net
src/Network/AuthorizeNet/Instances.hs
bsd-3-clause
10,998
0
13
856
2,291
1,069
1,222
189
0
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts #-} module Opaleye.Binary where import Opaleye.QueryArr (Query) import qualified Opaleye.Internal.Binary as B import qualified Opaleye.Internal.PrimQuery as PQ import Data.Profunctor.Product.Default (Default, def) -- | Example type specializat...
silkapp/haskell-opaleye
src/Opaleye/Binary.hs
bsd-3-clause
2,923
0
8
617
599
302
297
42
1
-- | See <https://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFPropertyListRef/Reference/reference.html> module CoreFoundation.Types.PropertyList( -- * Basic interface Plist, CFPropertyList, PlistClass, toPlist, fromPlist, PlistView(..), viewPlist, -- * "Data.PropertyList"...
reinerp/CoreFoundation
CoreFoundation/Types/PropertyList.hs
bsd-3-clause
4,823
0
14
900
1,444
750
694
-1
-1
{-# LANGUAGE TypeFamilies, FlexibleContexts, UndecidableInstances #-} module Data.Graph.Interface ( Vertex, Edge(..), Graph(..), Adj, Context(..), InspectableGraph(..), DecomposableGraph(..), IncidenceGraph(..), BidirectionalGraph(..), AdjacencyGraph(..), BidirectionalAdjacencyGraph(..), Adjacen...
travitch/hbgl-experimental
src/Data/Graph/Interface.hs
bsd-3-clause
10,092
0
12
2,436
2,988
1,598
1,390
175
1
-- 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. module Duckling.AmountOfMoney.TR.Tests ( tests ) where import Data.String import Prelude import Test.Tasty im...
facebookincubator/duckling
tests/Duckling/AmountOfMoney/TR/Tests.hs
bsd-3-clause
522
0
9
78
79
50
29
11
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Types.Check where import qualified Data.HashMap.Strict as HM import Data.Map.Strict (Map, keys, singleton, empty) import Data.Maybe import Data.Monoid ((<>)) impor...
chemist/fixmon
src/Types/Check.hs
bsd-3-clause
3,049
0
19
1,041
889
492
397
57
6
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} ----------------------------------------------------------------------------- -- -- Machine-dependent assembly language -- -- (c) The University of Glasgow 1993-2004 -- ----------------------------------------------------------------------------- ...
sdiehl/ghc
compiler/nativeGen/PPC/Instr.hs
bsd-3-clause
28,364
0
18
9,807
7,773
4,011
3,762
496
69
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} module Network.AIS.Vocabulary ( -- * Identifiers MMSI(..), MMSIType(..), mmsiType, MID(..), extractMID, toMid, EmergencyDeviceType(..), IMONumber(.....
dmcclean/ais
src/Network/AIS/Vocabulary.hs
bsd-3-clause
34,249
1
13
10,761
5,132
2,893
2,239
-1
-1
data X = X { foo :: Int, bar :: String, } deriving (Eq, Show, Ord) f x = x
itchyny/vim-haskell-indent
test/recordtype/after_deriving_parenthesis.in.hs
mit
75
1
8
20
47
26
21
-1
-1
module Fuml.Optimisation.SGD where import Numeric.LinearAlgebra import Data.Random data SGDOpts = SGDOpts { learning_rate :: Double , batch_size :: Int , epochs :: Int } sgdBatch :: SGDOpts -> (Vector Double -> Vector Double) -> Vector Double -> Vector Double sgdBatch opts grad p = p - scale (learning_rate o...
diffusionkinetics/open
fuml/lib/Fuml/Optimisation/SGD.hs
mit
794
0
11
185
348
177
171
19
2
{- | Module : ./CASL/CompositionTable/ToXml.hs Description : XML output for composition tables of qualitative calculi Copyright : (c) Uni Bremen 2005 License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : provisional Portability : non-portable (FlexibleIn...
spechub/Hets
CASL/CompositionTable/ToXml.hs
gpl-2.0
3,401
0
18
585
813
419
394
65
2
{-#LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} module Carnap.Languages.ModalFirstOrder.Logic.Hardegree (hardegreeMPLCalc,parseHardegreeMPL) where import Text.Parsec import qualified Data.Map as M import Carnap.Core.Data.Types (Form) import Carnap.Languages.PurePropositional.Syntax i...
opentower/carnap
Carnap/src/Carnap/Languages/ModalFirstOrder/Logic/Hardegree.hs
gpl-3.0
6,233
0
16
1,749
1,735
929
806
93
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} -- Module : Khan.Model.Ansible -- Copyright : (c) 2013 Brendan Hay <[email protected]...
zinfra/khan
khan/src/Khan/Model/Ansible.hs
mpl-2.0
3,487
0
16
1,093
904
496
408
76
6
<?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="el-GR"> <title>Forced Browse Add-On</title> <maps> <homeID>top</homeID> <mapref locati...
veggiespam/zap-extensions
addOns/bruteforce/src/main/javahelp/org/zaproxy/zap/extension/bruteforce/resources/help_el_GR/helpset_el_GR.hs
apache-2.0
991
79
67
158
449
226
223
-1
-1
{- | Module : Data.DRS.Input Copyright : (c) Harm Brouwer and Noortje Venhuizen License : Apache-2.0 Maintainer : [email protected], [email protected] Stability : provisional Portability : portable DRS input -} module Data.DRS.Input ( module Input ) where import Data.DRS.Input.Boxer as Input i...
hbrouwer/pdrt-sandbox
src/Data/DRS/Input.hs
apache-2.0
357
0
4
70
32
24
8
5
0
module BrowseSpec where import Control.Applicative import Language.Haskell.GhcMod import Test.Hspec import TestUtils import Dir spec :: Spec spec = do describe "browse Data.Map" $ do it "contains at least `differenceWithKey'" $ do syms <- runD $ lines <$> browse "Data.Map" syms `s...
cabrera/ghc-mod
test/BrowseSpec.hs
bsd-3-clause
1,218
0
18
366
258
127
131
26
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Reflex.Plan.Pure where import Reflex import Reflex.Pure import Reflex.T...
ryantrinkle/reflex
test/Reflex/Plan/Pure.hs
bsd-3-clause
2,018
0
12
333
637
338
299
51
1
module IHaskell.Publish (publishResult) where import IHaskellPrelude import qualified Data.Text as T import qualified Data.Text.Encoding as E import IHaskell.Display import IHaskell.Types import IHaskell.CSS (ihaskellCSS) -- | Publish evaluation results, ignore any CommMsgs. ...
thomasjm/IHaskell
src/IHaskell/Publish.hs
mit
3,217
0
15
909
585
298
287
51
6
{-| Module : Idris.Info Description : Get information about Idris. Copyright : 2016 The Idris Community License : BSD3 Maintainer : The Idris Community. -} module Idris.Info ( getIdrisDataDir , getIdrisCRTSDir , getIdrisJSRTSDir , getIdrisLibDir , getIdrisDocDir , getIdrisFlagsLib , getIdrisFl...
Heather/Idris-dev
src/Idris/Info.hs
bsd-3-clause
2,294
0
10
337
450
252
198
63
2
module Turbinado.Utility.General where import Data.List import Data.Maybe -- -- * Utility.General -- -- | Replaces all instances of a value in a list by another value. replace :: Eq a => a -- ^ Value to look for -> a -- ^ Value to replace it with -> [a] -- ^ Input list -> [a] -...
abuiles/turbinado-blog
Turbinado/Utility/General.hs
bsd-3-clause
714
0
9
187
206
115
91
15
2
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, MultiParamTypeClasses, OverloadedStrings #-} module YesodCoreTest.Redirect ( specs , Widget , resourcesY ) where import YesodCoreTest.YesodTest import Yesod.Core.Handler (redirectWith, setEtag, setWeakEtag) import qualified Network.HTTP.Types as ...
psibi/yesod
yesod-core/test/YesodCoreTest/Redirect.hs
mit
4,468
0
19
1,288
1,114
564
550
100
1
module Stackage.Types ( module X , module Stackage.Types ) where import Data.Map as X (Map) import Data.Map (unionWith) import Data.Monoid (Monoid (..)) import Data.Set as X (Set...
feuerbach/stackage
Stackage/Types.hs
mit
6,754
0
12
1,945
1,127
662
465
102
0
module MonadIn1 where f :: Monad m => m Int f = do let x@(y:ys) = [1,2] case x of (z:zs) -> return z
kmate/HaRe
old/testing/simplifyExpr/MonadIn1.hs
bsd-3-clause
126
0
12
49
73
38
35
6
1
{-# LANGUAGE ForeignFunctionInterface #-} ----------------------------------------------------------------------------- {- | Module : Numeric.GSL.Minimization Copyright : (c) Alberto Ruiz 2006-9 License : GPL-style Maintainer : Alberto Ruiz (aruiz at um dot es) Stability : provisional Portability : ...
mightymoose/liquidhaskell
benchmarks/hmatrix-0.15.0.1/lib/Numeric/GSL/Minimization.hs
bsd-3-clause
8,297
0
19
2,158
1,408
745
663
-1
-1
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses, PatternGuards #-} ---------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.BorderResize -- Copyright : (c) Jan Vornberger 2009 -- License : BSD3-style (see LICENSE) -- -- Maintainer : jan.vornber...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Layout/BorderResize.hs
bsd-2-clause
9,955
2
22
2,827
2,686
1,410
1,276
154
4
-- !!! Test monomorphism + RULES module ShouldCompile where -- This example crashed GHC 4.08.1. -- The reason was that foobar is monomorphic, so the RULE -- should not generalise over it. {-# NOINLINE [1] foo #-} foo 1 = 2 bar 0 = 1 foobar = 2 {-# RULES "foo/bar" foo bar = foobar #-}
green-haskell/ghc
testsuite/tests/typecheck/should_compile/tc111.hs
bsd-3-clause
297
0
5
67
31
20
11
7
1
module Converter (rationalToGray, grayToSignIO, signToGray, Gray, startF, startC) where import Stream import Data.Ratio import Control.Concurrent import Control.Concurrent.MVar import System.IO.Unsafe type Gray = [Integer] type State = (Integer, Integer) -- Convert a rational number (in (-1,1)) to its Gray repres...
hferreiro/replay
testsuite/tests/concurrent/prog001/Converter.hs
bsd-3-clause
3,559
71
20
937
1,503
779
724
79
3
module Main (main) where import Simpl021A main :: IO () main = do print i print j
urbanslug/ghc
testsuite/tests/simplCore/should_compile/Simpl021B.hs
bsd-3-clause
96
0
7
31
39
20
19
5
1
module TyMsgTest where unboundE = \ x. f x main = 1
pxqr/algorithm-wm
test/ty-error.hs
mit
54
3
4
14
21
13
8
-1
-1
{-| Module : Test.Data.Instances.Common.Sign Description : The Sign tests Copyright : (c) Andrew Burnett 2014-2015 Maintainer : [email protected] Stability : experimental Portability : Unknown Contains the Test Tree Node for the Sign module, as well as associated Generator functions -} module Test.Pro...
aburnett88/HSat
tests-src/Test/Problem/Instances/Common/Sign.hs
mit
3,842
0
16
810
838
458
380
108
1
import Data.List (maximum, tails, transpose) input :: String input = "08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08\n\ \49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00\n\ \81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65\n\ \52 70 95 23 04 60 11 42 69 24 68...
mohsen3/crispy-goggles
ProjectEuler/problem11/A.hs
mit
2,261
0
14
735
269
142
127
17
1
module Main where import Control.Applicative ans :: Maybe Integer ans = (+) <$> Just 4 <*> Just 6 main :: IO () main = print ans
calvinchengx/learnhaskell
applicatives/applicativefunctors.hs
mit
134
0
7
31
56
30
26
6
1
{-# LANGUAGE FlexibleContexts, Rank2Types #-} module TestFramework where import Rules import Control.Monad.State import Control.Monad.Except import Test.QuickCheck import Test.QuickCheck.Monadic import Generators import Text.Show.Pretty import Data.Maybe import Data.Map (empty, insert) import Data.Either (isLeft) t...
martin-kolinek/some-board-game-rules
test/TestFramework.hs
mit
4,947
0
14
823
1,131
583
548
80
2
{-# LANGUAGE GADTs #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TemplateHaskell, QuasiQuotes #-} module Main where import Yesod import Data.Text as T hiding (zip) import Control.Applicative import Co...
cirquit/quizlearner
resources/form/n_app_forms.hs
mit
5,130
0
14
1,945
556
341
215
39
1
module Logic.Validation where import Logic.Types import Control.Lens import Data.Maybe import qualified Data.Map as Map validateCommand :: GameState -> Command -> Bool validateCommand gs (MoveCommand us target) = all id [allUnitsExist, targetOk target] where allUnitsExist = all id . map doesExist $ u...
HarvestGame/logic-prototype
src/Logic/Validation.hs
mit
470
0
10
107
152
80
72
12
2
{------------------------------------------------- Exercise: implement the "nim" game 1: * * * * * 2: * * * * 3: * * * 4: * * 5: * players take turn removing one or more stars from the end of a row the winner is the player who removes the last star or stars from the board ------------------------------------------...
feliposz/learning-stuff
haskell/c9lectures-ch9-nim.hs
mit
2,137
0
13
744
657
322
335
51
3
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Language.LSP.Types.CodeAction where import Data.Aeson.TH import Data.Aeson.Types import Data.Default import Data.String import Dat...
wz1000/haskell-lsp
lsp-types/src/Language/LSP/Types/CodeAction.hs
mit
10,168
0
11
2,171
1,167
695
472
131
9
module Main where import Data.Maybe import Control.Applicative import Options.Applicative as Opts import Text.Blaze.Html.Renderer.String import ParseMd data Params = Params { inputPath :: String , outputPath :: String , headerPath :: Maybe String , footerPath :: Maybe String } defaultHeaderPath :: String defau...
archaeron/MarkdownToReveal
src/Main.hs
mit
1,695
111
9
299
494
263
231
58
1
module Compiler.Syntax.Type.Token where import Compiler.Serializable import Compiler.Syntax.Type.Position import Compiler.PreAST.Type.Symbol data Tok = TokID String -- identifiers | TokLParen -- ( | TokRParen -- ) | TokSemicolon -- ; ...
banacorn/mini-pascal
src/Compiler/Syntax/Type/Token.hs
mit
4,522
0
10
2,100
812
472
340
95
1
{-# LANGUAGE GADTs, OverloadedStrings, ImplicitParams, FlexibleContexts #-} module Tweets where import Control.Lens import Data.Aeson (FromJSON) import Data.Conduit (ResumableSource) import Web.Twitter.Conduit import Web.Twitter.Conduit import Web.Twitter.Types.Lens import Control.Monad.Reader import Control.Monad.Tra...
myuon/bwitterkuchen
src/Tweets.hs
mit
2,102
0
14
409
743
387
356
60
2
{-# LANGUAGE OverloadedStrings #-} import qualified Data.Text as T import IRC.Types import System.Environment main = do [channel] <- getArgs (_, send) <- connectToBot "127.0.0.1" 27315 send $ Join $ T.pack channel
UnNetHack/pinobot
commands/Join.hs
mit
222
0
9
39
69
37
32
8
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TupleSections #-} ----------------------------------------------------------------------------- -- | -- Maintainer : [email protected] -- Stability : experimental -- Portability : portable -- -- Concurrent state mo...
pikajude/concurrent-state
src/Control/Monad/State/Concurrent/Strict.hs
mit
7,870
0
17
1,978
2,408
1,270
1,138
135
1
import Paths_report_comparator import Graphics.UI.Gtk import Graphics.UI.Gtk.Builder import Control.Monad (forM_) import Main.Header import Main.Body import Main.EditAll import Data.Types -- Настройки, которые не удаётся сделать через glade prepareGUI :: Builder -> IO () prepareGUI b = do -- Цвет фона для вклад...
kahless/report-comparator
src/Main/Main.hs
mit
2,557
0
13
484
443
212
231
41
1
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} import Data.Foldable (for_) import Data.String (fromString) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Pangram (isPangram) main :: IO () main = hspecWi...
exercism/xhaskell
exercises/practice/pangram/test/Tests.hs
mit
3,253
0
11
1,317
473
294
179
52
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module Database.Neo4j.Batch ( -- * Usage -- $use -- * General Batch, runBatch, BatchFuture(..), NodeBatchIdentifier, RelBatchIdentifier, BatchEntity, -- * Nodes createNode, createNamedNode, getNode, getNamedNode, delet...
asilvestre/haskell-neo4j-rest-client
src/Database/Neo4j/Batch.hs
mit
1,675
0
5
295
157
115
42
14
0
{-# LANGUAGE ForeignFunctionInterface, DeriveDataTypeable, DoAndIfThenElse #-} module System.USB.HID ( hidInit , hidOpen , hidClose , hidRead , hidWrite , HidDevice ) where import Foreign...
gaeldeest/himinn
System/USB/HID.hs
mit
2,213
0
13
719
563
296
267
47
2
module Main where import Protolude import Grafs.Cli import Grafs.Webserver main :: IO () main = do (CLIOptions p) <- getOpts runWebserver p
uwap/Grafs
src/Main.hs
mit
150
0
9
32
51
27
24
8
1
{-# LANGUAGE ScopedTypeVariables, MultiWayIf, TupleSections #-} {- The GHCJS-specific parts of the frontend (ghcjs program) Our main frontend is copied from GHC, Compiler.Program -} module Compiler.GhcjsProgram where import GHC import GhcMonad import DynFlags import ErrUt...
ghcjs/ghcjs
src/Compiler/GhcjsProgram.hs
mit
16,084
0
24
4,890
3,851
1,948
1,903
-1
-1
module MonadicMICL where import Control.Monad import Control.Monad.State import MICL -- | stateful operators and combinators -- movement: takes a signal, and updates the state status. -- switchAgent: takes a signal, and updates the state status. -- switchMode: takes a signal, and updates the state status. -- ...
abbottk/MICL
DSL/MonadicMICL.hs
cc0-1.0
5,314
0
14
1,820
1,885
1,040
845
126
4
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Glance.Model.Image where import Common (skipUnderscoreOptions, capitalize, underscoreOptions, (<.>)) import Control.Monad.Catch (MonadCatch(catch), MonadThrow(throwM)) import Control.Monad.Trans.Maybe (MaybeT...
VictorDenisov/keystone
src/Glance/Model/Image.hs
gpl-2.0
3,838
0
17
1,021
1,277
683
594
100
2
module Types ( Phocid(..) , Photo(..) ) where data Phocid = Phocid { inputDir :: FilePath , outputPath :: FilePath , verbose :: Bool , title :: String } deriving (Show) data Photo = Photo { getPath :: FilePath } deriving (Show, Eq) instance Ord Photo where p1 `compare` p2 ...
mjhoy/phocid
src/Types.hs
gpl-2.0
359
0
8
104
125
75
50
13
0
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module TAP ( planTests, planNoPlan, planSkipAll, is, isnt, like, unlike, pass, fail, ok, skip, skipIf, toDo, diag, bailOut, runTests ) where import Prelude hiding (fail) import System.IO import System.Exit import Control.Monad.State hiding (fail) import...
epsilonhalbe/TAP
TAP.hs
gpl-2.0
7,430
0
21
2,418
2,858
1,424
1,434
206
5
module HLinear.Matrix.Invertible where import HLinear.Utility.Prelude import qualified Data.Vector as V import HLinear.Matrix.Algebra () import HLinear.Matrix.Definition import HLinear.Hook.PLEHook.Definition ( PLEHook(..), PLUEHook(..) ) import HLinear.Hook.EchelonForm.PivotStructure ( hasUnitDiagonal, pivotEntryVe...
martinra/hlinear
src/HLinear/Matrix/Invertible.hs
gpl-3.0
1,256
0
16
249
481
257
224
-1
-1
{-# LANGUAGE TemplateHaskell #-} module Lamdu.CodeEdit.Settings ( Settings(..), sInfoMode, InfoMode(..), defaultInfoMode ) where import qualified Control.Lens as Lens data InfoMode = None | Types | Examples deriving (Show) defaultInfoMode :: InfoMode defaultInfoMode = None newtype Settings = Settings { _sIn...
Mathnerd314/lamdu
src/Lamdu/CodeEdit/Settings.hs
gpl-3.0
370
0
6
59
91
58
33
11
1
module Main where import Ampersand import Data.List import qualified Data.List.NonEmpty as NEL (toList) main :: IO () main = do opts <- getOptions sequence_ . map snd . filter fst $ actionsWithoutScript opts -- There are commands that do not need a single filename to be speciied case file...
AmpersandTarski/ampersand
app/Main.hs
gpl-3.0
2,065
0
25
761
444
222
222
37
6
module Vector where type Vec2D = (Int, Int) vecAdd :: Vec2D -> Vec2D -> Vec2D vecAdd (x1, y1) (x2, y2) = (x1 + x2, y1 + y2) vecSub a (x, y) = vecAdd a (-x, -y) -- get a unit vector (rounded heavily into Ints) vecUnit :: Vec2D -> Vec2D vecUnit (ix, iy) = (newX, newY) where x = fromIntegral ix :: Float y =...
lordcirth/haskell-rogue
src/Vector.hs
gpl-3.0
455
0
11
116
205
117
88
12
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-latencytest/gen/Network/Google/Resource/Cloudlatencytest/Statscollection/Updatestats.hs
mpl-2.0
2,983
0
12
624
304
187
117
48
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.StorageTran...
brendanhay/gogol
gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types/Product.hs
mpl-2.0
88,646
0
26
19,772
13,652
7,907
5,745
1,537
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE KindSignatures #-} module Spark.MapRDDIO ( -- * Map RDD MapRDDIO (), mapRDDIO, -- * Remote Table __remoteTable ) where import Spark.Co...
yogeshsajanikar/hspark
src/Spark/MapRDDIO.hs
apache-2.0
3,371
0
17
1,070
945
502
443
77
2
module Miscellaneous.A261863Spec (main, spec) where import Test.Hspec import Miscellaneous.A261863 (a261863) main :: IO () main = hspec spec spec :: Spec spec = describe "A261863" $ it "correctly computes the first 20 elements" $ take 20 (map a261863 [1..]) `shouldBe` expectedValue where expectedValue = [...
peterokagey/haskellOEIS
test/Miscellaneous/A261863Spec.hs
apache-2.0
374
0
10
59
160
95
65
10
1
{-# LANGUAGE NoImplicitPrelude, FlexibleContexts, NoMonomorphismRestriction, FlexibleInstances, MultiParamTypeClasses #-} module DDF.IO (module DDF.IO, module DDF.List, module DDF.Char, module DDF.Unit) where import DDF.List import DDF.Char import DDF.Unit import qualified Prelude as M string [] = nil str...
ThoughtWorksInc/DeepDarkFantasy
DDF/IO.hs
apache-2.0
1,029
0
14
240
468
244
224
32
1
{-# LANGUAGE OverloadedStrings #-} module Marvin.API.Table.ParseSpec where import Test.Hspec import Marvin.API as Marvin import Marvin.API.Table.Parse spec :: Spec spec = do readDesc parseDesc readDesc = describe "reading" $ do it "handles empty" $ bsToRawTable "" ',' NoHeader `shouldSatisfy` \x -> ...
gaborhermann/marvin
test-suite/Marvin/API/Table/ParseSpec.hs
apache-2.0
2,215
0
15
559
711
383
328
53
5
import Prelude import System.Random -- when selecting a generator, choose newStdGen instead of genStdGen in order -- for the generator to be initialized with a different seed every time randomSelect :: [a] -> Int -> IO [a] randomSelect [] _ = return [] randomSelect xs n | n < 0 = error "n must be non-negative." ...
2dor/99-problems-Haskell
21-28-lists-again/problem-23.hs
bsd-2-clause
446
0
18
105
139
69
70
9
1
{-# LANGUAGE TypeFamilies, KindSignatures, MultiParamTypeClasses, DataKinds, FlexibleContexts, GADTs, TypeOperators, PolyKinds, UndecidableInstances, FlexibleInstances, DefaultSignatures, ScopedTypeVariables, ConstraintKinds, TemplateHaskell, OverloadedStrings, DeriveGeneric #-} module Main where import qualified Netw...
byteally/webapi
webapi/tests/main.hs
bsd-3-clause
8,760
0
22
2,869
2,234
1,175
1,059
183
1
module Main where import System.Environment (getProgName) import qualified Kiwi.API as API import qualified Kiwi.Config as Config import qualified Kiwi.Generate as Generate import qualified Kiwi.Server as Server import qualified Kiwi.ServerAndAPI as ServerAndAPI import Kiwi.Data import qualified Kiwi.Storage as Stora...
acieroid/kiwi
Main.hs
bsd-3-clause
599
0
10
94
151
91
60
19
4
-- |Generate Haskell source files for ROS .msg types. {-# LANGUAGE OverloadedStrings #-} module Gen (generateMsgType, generateSrvTypes) where import Control.Applicative ((<$>), (<*>)) import Data.ByteString.Char8 (pack, ByteString) import qualified Data.ByteString.Char8 as B import Data.Char (toUpper) import Analysis (...
rgleichman/roshask
src/executable/Gen.hs
bsd-3-clause
6,562
0
14
2,567
1,372
749
623
117
2
-- © 2002 Peter Thiemann module Main where import WASH.CGI.CGI hiding (head, div, span, map) import qualified WASH.CGI.CGI as CGI import System.Random import qualified WASH.CGI.Persistent2 as P import qualified WASH.CGI.Cookie as C import WASH.CGI.Types -- for nhc98 main = run helo0 -- helo0 = standardQuery ...
nh2/WashNGo
Examples/old/Tutorial.hs
bsd-3-clause
7,067
68
18
1,801
2,286
1,105
1,181
177
4
import Prelude hiding (FilePath) import Data.Maybe import Control.Monad import Data.Monoid import Shelly import System.Exit import Text.Regex import Data.Text (Text) import qualified Data.Text as T default(Text) main :: IO () main = do results <- forM tests id if and results then exitSuccess else exitFailur...
Zankoku-Okuno/redo
test/test.hs
bsd-3-clause
2,672
0
13
730
879
423
456
82
2
{-# LANGUAGE KindSignatures, TypeFamilies, UndecidableInstances, GADTs, MultiParamTypeClasses, FunctionalDependencies , TypeOperators, EmptyDataDecls, Rank2Types , FlexibleInstances #-} module Basil.Data.HList where import Basil.Data.TBoole...
chriseidhof/Basil
src/Basil/Data/HList.hs
bsd-3-clause
3,821
0
10
1,086
1,424
739
685
-1
-1
{-# OPTIONS_HADDOCK hide #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.Functions.F17 -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <[email protected]> -- Stability : stable -- Portability : por...
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F17.hs
bsd-3-clause
71,974
0
15
9,484
10,945
5,649
5,296
1,113
1
{-# LANGUAGE OverloadedStrings #-} -- | Celebrating the release of the 4chan API at https://github.com/4chan/4chan-API -- One bug in the API documentation is that 'tim' is optional. module FourChan ( thread , threadT , threadV , threadP , Post(..) ) where -- Imports: import Data.Aeson as A import ...
sordina/fourchan
FourChan.hs
bsd-3-clause
3,799
0
56
1,680
883
476
407
85
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Shlurp.Config ( Config(..), loadSettings, GitHub, executeGitHub ) where import Control.Monad.State import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as S import Data.Text (Text) import qualified Data.Text as T import GitHub.D...
afcowie/shlurp
lib/Shlurp/Config.hs
bsd-3-clause
1,219
0
14
285
317
175
142
35
2
{-# LANGUAGE FlexibleContexts #-} -- -- Fluid simulation -- module Fluid.Fluid ( fluid ) where import Fluid.Type import Prelude as P import Data.Array.Accelerate as A fluid :: Int -> Timestep -> Viscosity -> Diffusion -> (Acc DensityField, Acc VelocityField) -> (Acc DensityField, Ac...
cpdurham/accelerate-camera-sandbox
src/Fluid/Fluid.hs
bsd-3-clause
4,344
0
17
1,317
1,686
896
790
97
1
-- | -- Module : Text.Eros.Phrase -- Description : Pure interface for 'Phrase's and 'PhraseTree's. -- Copyright : 2014, Peter Harpending. -- License : BSD3 -- Maintainer : Peter Harpending <[email protected]> -- Stability : experimental -- Portability : archlinux -- module Text.Eros.Phrase wher...
pharpend/eros
src/Text/Eros/Phrase.hs
bsd-3-clause
1,773
0
9
390
320
183
137
25
1
{------------------------------------------------------------------------------- DerivBase.LemmaItem (c) 2014 Jan Snajder <[email protected]> -------------------------------------------------------------------------------} {-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, OverloadedStrings #-} module Der...
jsnajder/derivbase
src/DerivBase/LemmaItem.hs
bsd-3-clause
1,832
0
13
460
591
313
278
44
1