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
-- The definition of Maybe is a mapping from type a to type Maybe a: data Maybe a = Nothing | Just a -- Here’s an important subtlety: Maybe itself is not a type, it’s a type constructor. -- You have to give it a type argument, like Int or Bool, in order to turn it into a type. -- Maybe without any argument represents ...
sujeet4github/MyLangUtils
CategoryTheory_BartoszMilewsky/PI_07_Functors/Maybe_Functor.hs
gpl-3.0
1,712
0
8
386
226
128
98
13
1
-- | Utility functions for working with tuples. module Util.Tuple (fst3, snd3, trd3, pair) where -- | Look-up the first item in a 3-tuple. fst3 :: (a, b, c) -> a fst3 (a, _, _) = a -- | Look-up the second item in a 3-tuple. snd3 :: (a, b, c) -> b snd3 (_, b, _)...
dwdyer/anorak
src/haskell/Util/Tuple.hs
gpl-3.0
568
0
8
182
191
114
77
12
1
import HMeans import Debug.Trace import Data.Foldable import System.Random import Algorithms.Hungarian import qualified Data.Vector.Unboxed as UV ---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------...
ehlemur/HMeans
Test/ALOI/test.hs
gpl-3.0
4,159
0
13
668
1,003
499
504
62
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-games/gen/Network/Google/Resource/Games/Rooms/ReportStatus.hs
mpl-2.0
3,828
0
15
919
473
283
190
75
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/List.hs
mpl-2.0
6,112
0
19
1,439
962
556
406
133
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/Resource/SQL/Databases/Delete.hs
mpl-2.0
5,323
0
20
1,364
859
499
360
126
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-ml/gen/Network/Google/Resource/Ml/Projects/Operations/Delete.hs
mpl-2.0
5,810
0
17
1,375
855
499
356
121
1
module Main where import Control.Monad import qualified System.Environment as SystemEnvironment import System.IO (stdout) import System.Console.Haskeline (runInputT) import System.Directory (doesPathExist, getHomeDirectory) import ColorText import Obj import Types import Repl import StartingEnv import Eval import Uti...
eriksvedang/Carp
app/Main.hs
mpl-2.0
6,573
0
16
2,384
1,232
658
574
122
11
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/DicomStores/Patch.hs
mpl-2.0
6,646
0
17
1,394
860
502
358
133
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/CreateGroup.hs
mpl-2.0
4,453
0
14
958
632
382
250
80
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-binaryauthorization/gen/Network/Google/Resource/BinaryAuthorization/Projects/UpdatePolicy.hs
mpl-2.0
5,555
0
16
1,226
783
460
323
111
1
module Network.Crazyflie.CRTP.Constants ( CRTPPort (..) , LogChannel (..) , AllChannel (..) , ConsoleChannel (..) , ParamChannel (..) , CommanderChannel (..) , DebugdriverChannel (..) , LinkctrlChannel (..) ) where import ClassyPrelude import Data.Word import Data.Binary import Data...
orclev/crazyflie-haskell
src/Network/Crazyflie/CRTP/Constants.hs
lgpl-3.0
2,608
0
16
707
775
410
365
58
1
module Strava (repl, initialStravaContext, getToken) where import System.Exit import System.Directory import System.Locale import System.IO.Error import System.IO import Network.Curl import Text.JSON import Control.Monad() import Control.Monad.State import Data.Functor import Control.Applicative import Data.Foldable ...
bputigny/strava-cli
src/Strava.hs
lgpl-3.0
8,041
0
16
2,478
2,095
1,028
1,067
194
7
module Miscellaneous.A259439 (a259439) where import HelperSequences.A143482 (a143482) a259439 :: Integral a => a -> a a259439 n = a143482 n `div` n
peterokagey/haskellOEIS
src/Miscellaneous/A259439.hs
apache-2.0
149
0
6
23
54
30
24
4
1
{-# LANGUAGE TemplateHaskell, NoMonomorphismRestriction, FlexibleContexts, RankNTypes #-} {-| The WConfd functions for direct configuration manipulation This module contains the client functions exported by WConfD for specific configuration manipulation. -} {- Copyright (C) 2014 Google Inc. All rights reserve...
bitemyapp/ganeti
src/Ganeti/WConfd/ConfigModifications.hs
bsd-2-clause
30,541
0
27
8,269
7,383
3,828
3,555
-1
-1
module Exercises181 where import Control.Monad (join) bind :: Monad m => (a -> m b) -> m a -> m b bind f x = join $ fmap f x
pdmurray/haskell-book-ex
src/ch18/Exercises181.hs
bsd-3-clause
126
0
9
31
69
35
34
4
1
module Module5.Task18 where import Data.Monoid (Sum(..)) import Control.Monad.Writer (Writer, execWriter, writer) -- system code type Shopping = Writer (Sum Integer) () shopping1 :: Shopping shopping1 = do purchase "Jeans" 19200 purchase "Water" 180 purchase "Lettuce" 328 -- solution code purchase :: S...
dstarcev/stepic-haskell
src/Module5/Task18.hs
bsd-3-clause
447
0
7
82
147
80
67
13
1
module Exercises.FindMissingNumbers (findMissingPair) where findMissingPair :: [Integer] -> Maybe (Integer, Integer) findMissingPair [] = Nothing findMissingPair s = findMP (1, []) s where findMP (_, [a,b]) _ = Just (a,b) findMP _ [] = Nothing findMP (i, missings...
WarKnife/exercises
src/Exercises/FindMissingNumbers.hs
bsd-3-clause
629
0
12
257
213
115
98
13
4
{-# LANGUAGE OverloadedStrings #-} -- | Bindings to the Docker Remote API. -- TODO Should be Network.Docker.Remote. module Network.Docker.Remote where import Control.Applicative ((<$>), (<*>)) import Control.Monad (mzero) import Data.Aeson (object, FromJSON(..), ToJSON(..), Value(..), (.=), (.:), (.:?)) import Data.By...
noteed/rescoyl-checks
Network/Docker/Remote.hs
bsd-3-clause
2,502
0
21
482
523
306
217
49
6
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module Web.ISO.Murv where import Control.Concurrent.STM (atomically) import Control.Concurrent.STM.TQueue (TQueue, newTQueue, readTQueue, writeTQueue) import Control.Monad.Trans (MonadIO(..)) import Data.Text (Text) import Data.JSString.Text (text...
stepcut/isomaniac
Web/ISO/Murv.hs
bsd-3-clause
5,917
0
17
1,857
888
456
432
66
3
{-# LANGUAGE BangPatterns, OverloadedStrings, ScopedTypeVariables, CPP #-} {-# LANGUAGE NamedFieldPuns #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} -- | Utilities for reading PBBS data files, etc. -- TODO: -- * It is probably a better strategy to shift the slices around to match number -- boundaries than it...
adk9/pbbs-haskell
PBBS/FileReader.hs
bsd-3-clause
16,918
0
21
4,091
4,428
2,253
2,175
274
10
{-# LANGUAGE OverloadedStrings #-} module Buildsome.Print ( posText ) where import Data.String (IsString(..)) import Text.Parsec (SourcePos) posText :: (Monoid s, IsString s) => SourcePos -> s posText _ = ""
da-x/buildsome-tst
app/Buildsome/Print.hs
bsd-3-clause
242
0
6
64
68
40
28
7
1
{-# LANGUAGE PackageImports #-} module System.Exit (module M) where import "base" System.Exit as M
silkapp/base-noprelude
src/System/Exit.hs
bsd-3-clause
104
0
4
18
21
15
6
3
0
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.NV.ShaderBufferLoad -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabil...
haskell-opengl/OpenGLRaw
src/Graphics/GL/NV/ShaderBufferLoad.hs
bsd-3-clause
1,160
0
5
148
106
75
31
24
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoRebindableSyntax #-} module Duckling.Nu...
facebookincubator/duckling
Duckling/Numeral/Rules.hs
bsd-3-clause
1,227
0
18
271
280
159
121
34
2
{-# LANGUAGE ScopedTypeVariables #-} -- | This module provides convenience functions for interfacing @io-streams@ -- with @HsOpenSSL@. It is intended to be imported @qualified@, e.g.: -- -- @ -- import qualified "OpenSSL" as SSL -- import qualified "OpenSSL.Session" as SSL -- import qualified "System.IO.Streams.SSL" a...
snapframework/openssl-streams
src/System/IO/Streams/SSL.hs
bsd-3-clause
6,187
0
16
1,801
1,084
587
497
78
3
module Snap.Snaplet.Environments ( module Data.Configurator , lookupConfig , lookupConfigDefault , lookupEnv , lookupEnvDefault , module Snap.Snaplet.Environments.Instances ) where import Control.Monad.Reader import Data.Maybe (fromMaybe) import Data.Configura...
kamilc/Snaplet-Environments
src/Snap/Snaplet/Environments.hs
bsd-3-clause
3,002
0
24
789
932
486
446
52
4
{- - Claq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Claq. - Claq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} module Compile (prepareExprCoherent, p...
ti1024/claq
src/Compile.hs
bsd-3-clause
2,573
0
12
613
929
454
475
56
13
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Test.Unit where import Prelude (($), (.)) import Data.Foldable (mapM_) import Data.Text hiding (toTitle) import Data.Text.Titlecase import ...
nkaretnikov/titlecase
tests/Test/Unit.hs
bsd-3-clause
2,760
0
10
529
683
376
307
45
3
{-# LANGUAGE TemplateHaskell #-} module NotCPP.Utils where import Control.Applicative ((<$>)) import Language.Haskell.TH -- | Turns 'Nothing' into an expression representing 'Nothing', and -- @'Just' x@ into an expression representing 'Just' applied to the -- expression in @x@. liftMaybe :: Maybe Exp -> Exp liftMaybe...
bmillwood/notcpp
NotCPP/Utils.hs
bsd-3-clause
1,046
0
9
185
229
124
105
14
1
import Data.STM.LinkedList (LinkedList) import qualified Data.STM.LinkedList as LinkedList import Control.Concurrent import Control.Concurrent.STM import Control.Exception import Control.Monad (forM_, forever) import Foreign.Marshal.Error (void) type Event = String type EventHandler = (Event -> IO ()) withEventHandl...
joeyadams/haskell-stm-linkedlist
testing/event-handler.hs
bsd-3-clause
1,705
0
21
597
442
216
226
47
3
module Lucid.Foundation.Typography ( module Lucid.Foundation.Typography.Types , module Lucid.Foundation.Typography.InlineList , module Lucid.Foundation.Typography.Labels ) where import Lucid.Foundation.Typography.Types import Lucid.Foundation.Typography.InlineList import Lucid.Foundation.Typography.Labels
athanclark/lucid-foundation
src/Lucid/Foundation/Typography.hs
bsd-3-clause
316
0
5
28
54
39
15
7
0
module Database.Hitcask( get , put , delete , Hitcask() , connect , connectWith , close , compact , listKeys , standardSettings ) where import Control.Concurrent.STM import System.IO import System.Directory import Database.Hitcask.Types import Database.Hitcask.Restore import Database.Hitcask.Get i...
tcrayford/hitcask
Database/Hitcask.hs
bsd-3-clause
1,366
0
13
236
450
234
216
47
2
module Internal.BitOps ( fixedXOR , repeatingKeyXOR , hamming ) where import qualified Data.ByteString as BS import Data.Bits import Internal.Uncons import Data.Monoid import Data.Word import Debug.Trace fixedXOR :: BS.ByteString -> BS.ByteString -> Maybe BS.ByteString fixedXOR bs1 bs2 | BS.length bs1 /= BS.lengt...
caneroj1/Crypto-hs
src/Internal/BitOps.hs
bsd-3-clause
775
0
11
159
268
138
130
23
1
{-# LANGUAGE OverloadedStrings #-} module Network.YAML.Snap (handleApi, handleApiPost) where import qualified Data.ByteString as B import qualified Data.Text.Encoding as TE import Network.YAML import qualified Data.Aeson as Json import Snap errorMsg :: Int -> B.ByteString -> Snap () errorMsg status msg = do modify...
portnov/yaml-rpc
yaml-rpc-snap/Network/YAML/Snap.hs
bsd-3-clause
1,280
0
22
396
306
151
155
28
4
module Options.Nested.Types where import Options.Nested.Types.Parser import Control.Applicative import Data.Maybe (isJust) import Data.Monoid import Data.Tree -- | A command tree is a rose tree of the command label and it's optional flag -- parser. type CommandTree ...
athanclark/optparse-nested
src/Options/Nested/Types.hs
bsd-3-clause
804
0
10
200
195
112
83
18
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Lambdasim.Time where import Data.Time hiding (utc) import Data.Ratio ((%)) import Control.Monad (liftM) import Control.Parallel.Strategies import Prelude () import Lambdasim.Prelude addTime :: Time -> UTCTime -> UTCTime addTime x = addUTCTime (toNominalDiffTime x) toNo...
jystic/lambdasim
src/Lambdasim/Time.hs
bsd-3-clause
911
0
10
155
275
149
126
24
1
module Ling.Rename where import qualified Data.Map as Map import Data.Map (Map) import Data.Maybe (fromMaybe) import Control.Applicative import Control.Lens import Ling.Abs (Name) import Ling.Utils import Ling.Norm -- import Ling.Print.Instances () type Ren = Map Name Name type E a = a -> a class Rename a where ...
jyp/ling
Ling/Rename.hs
bsd-3-clause
2,485
0
13
681
1,244
611
633
65
1
-- various desugaring routines -- -- The general desugaring routine creates selectors for data -- constructors with named fields, changes all pattern bindings -- into 'simple' pattern bindings, and adds failure cases to lambda -- expressions which have failable patterns module FrontEnd.Desugar (doToExp, listCompTo...
dec9ue/jhc_copygc
src/FrontEnd/Desugar.hs
gpl-2.0
12,538
0
20
3,093
4,637
2,276
2,361
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-| Unittests for the KVM daemon. -} {- Copyright (C) 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...
ribag/ganeti-experiments
test/hs/Test/Ganeti/Kvmd.hs
gpl-2.0
3,682
0
14
780
639
324
315
67
2
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : $Header$ Description : injective maps Copyright : (c) Uni Bremen 2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable Injective maps -} module Common.InjMap ( Inj...
keithodulaigh/Hets
Common/InjMap.hs
gpl-2.0
3,487
0
16
885
1,140
579
561
63
4
import Control.Monad.ST (runST) import Criterion.Main import Data.Complex import Statistics.Sample import Statistics.Transform import Statistics.Correlation.Pearson import System.Random.MWC import qualified Data.Vector.Unboxed as U -- Test sample sample :: U.Vector Double sample = runST $ flip uniformVector 10000 =<<...
bos/statistics
benchmark/bench.hs
bsd-2-clause
2,701
0
16
814
1,013
521
492
51
1
{-# LANGUAGE OverloadedStrings #-} module Distribution.Nixpkgs.Haskell.FromCabal.Name ( toNixName, libNixName, buildToolNixName ) where import Data.String import Distribution.Package import Language.Nix -- | Map Cabal names to Nix attribute names. toNixName :: PackageName -> Identifier toNixName (PackageName "") = e...
psibi/cabal2nix
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs
bsd-3-clause
10,974
0
7
4,759
1,803
849
954
162
1
{-# LANGUAGE ForeignFunctionInterface, EmptyDataDecls, LambdaCase, TupleSections, GeneralizedNewtypeDeriving #-} module Sound.Pd.Internal where import Foreign.C import Foreign.Ptr import Foreign.StablePtr import Control.Concurrent import Control.Monad import Sound.Pd.OpenAL data FileOpaque type File = Ptr FileOpaque ...
lukexi/pd-hs
src/Sound/Pd/Internal.hs
bsd-3-clause
5,558
0
11
903
1,585
801
784
-1
-1
import Data.List isPossible :: [String] -> String -> (Int, Int) -> (Int, Int) -> Bool isPossible _ [] _ _ = True isPossible grid (w:ws) (x, y) (dx, dy) | x < 10 && y < 10 && (grid !! x !! y == w || grid !! x !! y == '-') = isPossible grid ws (x + dx, y + dy) (dx, dy) | otherwise = False putWords :: [String] -...
EdisonAlgorithms/HackerRank
practice/fp/recursion/crosswords-101/crosswords-101.hs
mit
1,691
0
16
503
912
483
429
35
2
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Code generator utilities; mostly monadic -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmUtils ( cgLit, mkSimpleL...
oldmanmike/ghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
23,049
0
15
5,437
4,903
2,607
2,296
-1
-1
module C where -- Test file baz = 13
RefactoringTools/HaRe
test/testdata/C.hs
bsd-3-clause
39
0
4
11
10
7
3
2
1
module Meas () where import Language.Haskell.Liquid.Prelude mylen :: [a] -> Int mylen [] = 0 mylen (_:xs) = 1 + mylen xs mymap f [] = [] mymap f (x:xs) = (f x) : (mymap f xs) zs :: [Int] zs = [1..100] prop2 = liquidAssertB (n1 == n2) where n1 = mylen zs n2 = mylen $ mymap (+ 1) zs
mightymoose/liquidhaskell
tests/pos/meas3.hs
bsd-3-clause
320
0
9
100
168
92
76
12
1
{-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.ST -- Copyright : (c) The University of Glasgow, 1992-2002 -- License : see libr...
tolysz/prepare-ghcjs
spec-lts8/base/GHC/ST.hs
bsd-3-clause
3,357
0
16
826
736
414
322
50
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- | Generate HPC (Haskell Program Coverage) reports module Stack.Build.Coverage ( generateHpcReport , generateHpcMar...
akhileshs/stack
src/Stack/Build/Coverage.hs
bsd-3-clause
6,914
0
22
2,288
1,332
711
621
121
3
{-# LANGUAGE CPP, RecordWildCards #-} ----------------------------------------------------------------------------- -- -- Stg to C-- code generation: -- -- The types LambdaFormInfo -- ClosureInfo -- -- Nothing monadic in here! -- ---------------------------------------------------------------------------...
green-haskell/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
37,881
0
12
10,224
4,625
2,511
2,114
433
7
module Kinding where import qualified Data.Set as Set import qualified Data.Map as Map import Core type KindSubst = Map.Map LowerName Kind class Kinded
robertkleffner/gruit
src/Kinding.hs
mit
158
0
6
29
41
26
15
-1
-1
module Display (showColumns) where import Data.List(intercalate) showColumns :: Int -> Int -> ([String], [String]) -> String showColumns wrapOne wrapTwo (as', bs') = intercalate "\n" $ map joinRow $ zip (map (pad wrapOne) colOneRows) (map (pad wrapTwo) colTwoRows) where as = map (rmLineBreaks . rmLeadingWhit...
MichaelBaker/zgy-cli
src/Display.hs
mit
1,215
0
12
299
533
270
263
21
1
module SFML.SFResource where class SFResource a where -- | Destroy the given SFML resource. destroy :: a -> IO ()
SFML-haskell/SFML
src/SFML/SFResource.hs
mit
130
0
9
36
30
16
14
3
0
module Y2016.M11.D08.Exercise where import Data.Aeson {-- So, last week we looked at a graph of twitter-users. NOICE! If you look at the source code that generated the graph, it's a python script that makes a request to the twitter API to get a list of the followers of the graphed account. Well. I happen to have a ...
geophf/1HaskellADay
exercises/HAD/Y2016/M11/D08/Exercise.hs
mit
1,902
0
9
325
80
50
30
8
1
{-# LANGUAGE OverloadedStrings #-} module Lib ( withAuth ) where import Snap.Snaplet import Snap.Core import qualified Data.ByteString.Base64 as D import qualified Data.ByteString.Char8 as B import Control.Monad.Trans (liftIO) import Data.Maybe import Database.MongoDB (MongoContext(..), Database, connect, hos...
cackharot/heub
src/Lib.hs
mit
2,410
0
16
512
756
388
368
67
4
module Main where import Lang.Cmn.Dict main :: IO () main = do dictEntries <- loadDict let wdToEntry = dictToWdDict dictEntries print $ length dictEntries
dancor/melang
src/Main/optimize-wubi.hs
mit
169
0
10
38
54
27
27
7
1
----------------------------------------------------------------------------- -- | -- Module : Arguments -- License : MIT (see the LICENSE file) -- Maintainer : Felix Klein (klein@react.uni-saarland.de) -- -- Argument parser. -- ----------------------------------------------------------------------------- ...
reactive-systems/syfco
src/syfco/Arguments.hs
mit
12,225
0
20
4,523
3,001
1,524
1,477
242
124
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} module BT.Polling where import BT.ZMQ import BT.Types import Data.Pool (Pool) import qualified System.ZMQ3 as ZMQ import Data.IORef (IORef, writeIORef) import Network.Bitcoin (BTC) import Data.ByteString as B import Data.ByteString.Char8 as BC im...
c00w/BitToll
haskell/BT/Polling.hs
mit
1,097
0
12
206
378
193
185
30
1
{-| Module: Y2015.Util Description: Shared functions for Advent of Code Solutions. License: MIT Maintainer: @tylerjl Shared functions that support solutions to problems for the <adventofcode.com> challenges. -} module Y2015.Util ( (<&&>) , regularParse , intParser ) where import Cont...
tylerjl/adventofcode
src/Y2015/Util.hs
mit
942
0
8
235
173
104
69
17
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE...
mgsloan/ghcjs-typescript
examples/highcharts/Raw.hs
mit
68,354
0
20
11,775
18,674
10,368
8,306
-1
-1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.XMLHttpRequestUpload (abort, error, load, loadEnd, loadStart, progress, XMLHttpRequestUpload, castToXMLHttpRequestUpload, gTypeXMLHttpRequestUpload) where import Prelude ((.), (==), (...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/XMLHttpRequestUpload.hs
mit
2,568
0
7
234
450
279
171
32
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeOperators #-} module Api (app) where import Control.Monad.Except (ExceptT) import Control.Monad.Reader (ReaderT, runReaderT) -- import Control.Monad.Reader....
tdox/aircraft-service
src/Api.hs
mit
2,746
0
8
782
318
191
127
28
1
{-# LANGUAGE ScopedTypeVariables #-} -------------------------------------------------- -------------------------------------------------- {-| Define (non-deriveable) 'Ix' instances via a (deriveable) 'Enumerate' instance. == Usage @ data A = ... instance 'Bounded' A where minBound = 'minBound_Enumerable' array_...
sboosali/enumerate
enumerate/sources/Enumerate/Ix.hs
mit
7,847
0
13
1,522
405
255
150
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafregional-webacl-action.html module Stratosphere.ResourceProperties.WAFRegionalWebACLAction where import S...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/WAFRegionalWebACLAction.hs
mit
1,379
0
13
164
174
100
74
23
1
--file ch6/TypeClass.hs module TypeClass where class BasicEq a where isEqual :: a -> a -> Bool isEqual x y = not (isNotEqual x y) isNotEqual :: a -> a -> Bool isNotEqual x y = not (isEqual x y) data Color = Red | Blue | Green deriving (Show, Read, Eq, Ord) instance BasicEq Color where isEqu...
Numberartificial/workflow
haskell-first-principles/src/RW/CH6/TypeClass.hs
mit
610
0
9
166
218
114
104
20
0
module Specify.Eval where import Specify.Expression import Specify.Definition import Autolib.Set import Autolib.ToDoc import Autolib.Reporter eval :: ToDoc a => Program -> Expression a -> Reporter ( Maybe a ) eval p x = case x of Constant c -> return $ Just c Undefined -> return...
florianpilz/autotool
src/Specify/Eval.hs
gpl-2.0
2,526
27
16
1,052
1,047
524
523
73
22
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PatternGuards #-} -- | -- Copyright : (c) 2010-2012 Simon Meier, Benedikt Schmidt -- contributing in 2019: Robert Künnemann, Johannes Wocker -- License : GPL v3 (see LICENSE) -- -- Maintaine...
tamarin-prover/tamarin-prover
lib/theory/src/Theory/Text/Parser.hs
gpl-3.0
20,623
0
21
7,012
4,653
2,261
2,392
337
18
import Pf.Crafting import Test.QuickCheck import Test.Hspec main :: IO () main = hspec $ do describe "Crafting" $ do it "should result in success if the roll is greater than the craft dc of the item." $ property craftingSuccessGreater it "should result in success if the roll is equal to the craft dc of...
nickolasacosta/pf-tools
test/Spec.hs
gpl-3.0
2,563
0
16
529
769
370
399
47
1
{---------------------------------------------------------------------} {- Copyright 2015, 2016 Nathan Bloomfield -} {- -} {- This file is part of Carl. -} {- ...
nbloomf/carl
test/Tests/Lib/Data/Integer.hs
gpl-3.0
2,318
0
9
765
292
170
122
26
1
import Data.List -- data Node = Node Road Road | EndNode Road data Node = Node Road (Maybe Road) data Road = Road Int Node data Section = Section { getA :: Int, getB :: Int, getC :: Int } type RoadSystem = [Section] heathrowToLondon :: RoadSystem heathrowToLondon = [Section 50 10 30, Section 5 90 20, Section 40 2 25...
lamontu/learning_haskell
heathrow.hs
gpl-3.0
1,833
0
13
550
696
375
321
44
3
-- file: ch04/SplitLines.hs splitLines :: String -> [String] splitLines [] = [] splitLines cs = let (pre, suf) = break isLineTerminator cs in pre : case suf of ('\r':'\n':rest) -> splitLines rest ('\r':rest) -> splitLines rest ('\n':rest) -> splitLin...
dkensinger/haskell
SplitLines.hs
gpl-3.0
412
0
12
155
141
71
70
10
4
module PropT28 where import Prelude(Bool(..)) import Zeno -- Definitions True && x = x _ && _ = False False || x = x _ || _ = True not True = False not False = True -- Nats data Nat = S Nat | Z (+) :: Nat -> Nat -> Nat Z + y = y (S x) + y = S (x + y) (*) :: Nat -> Nat -> Nat Z * _ = Z (S x) * y = y + (x...
danr/hipspec
testsuite/prod/zeno_version/PropT28.hs
gpl-3.0
2,969
0
10
914
1,993
1,037
956
114
2
module Model.Id ( module Model.Id.Types ) where import Model.Id.Types
databrary/databrary
src/Model/Id.hs
agpl-3.0
75
0
5
14
21
14
7
3
0
{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances, EmptyDataDecls, OverlappingInstances, IncoherentInstances #-} module HEP.Jet.FastJet.Class.TNamed.Implementation where import HEP.Jet.FastJet.TypeCast import HEP.Jet.FastJ...
wavewave/HFastJet
oldsrc/HEP/Jet/FastJet/Class/TNamed/Implementation.hs
lgpl-2.1
2,425
0
10
373
628
351
277
57
1
import Hastistics import Hastistics.Distributions import Hastistics.Types hiding ((-)) import Hastistics.Data.CSV notenFormat = csvTable [toHSString, toHSDouble] studentsFormat = csvTable (repeat (toHSString)) averages :: (HSTable a) => a -> HSReport averages tbl = select $ valueOf "Matri...
fluescher/hastistics
tests/profil.hs
lgpl-3.0
2,128
0
13
978
435
202
233
43
1
-- A solution to Rosalind Problem: DNA by SavinaRoja -- http://rosalind.info/problems/dna/ -- Uses Data.ByteString to remove unnecessary overhead of string or Text -- representation, and Data.ByteString.Lazy in particular for safety in -- handling sequence files of arbitrary length. -- -- The countMap function expresse...
SavinaRoja/challenges
Rosalind/String_Algorithms/dna.hs
unlicense
1,273
0
13
222
229
127
102
16
1
module HepMC.Barcoded where import Control.Lens import Data.IntMap (IntMap) import qualified Data.IntMap as IM type BC = Int class Barcoded b where bc :: Lens' b BC instance (Barcoded a, Barcoded b) => Barcoded (Either a b) where bc = choosing bc bc liftBC :: Barcoded a => (BC -> b) -> ...
cspollard/HHepMC
src/HepMC/Barcoded.hs
apache-2.0
780
0
9
199
377
194
183
21
1
{-# LANGUAGE ExistentialQuantification #-} ----------------------------------------------------------------------------- -- Copyright 2019, Ideas project team. This file is distributed under the -- terms of the Apache License 2.0. For more information, see the files -- "LICENSE.txt" and "NOTICE.txt", which are incl...
ideas-edu/ideas
src/Ideas/Common/Environment.hs
apache-2.0
6,216
0
15
1,548
1,915
1,007
908
122
1
sm y = y + 1 biggestInt,smallestInt :: Int biggestInt = maxBound smallestInt = minBound reallyBig::Integer reallyBig = 2^(2^(2^(2^2))) numDigits :: Int numDigits = length(show reallyBig) ex11 = True && False ex12 = not(False || True) ex13 = ('a' == 'a') ex14 = (16 /= 3) ex15 = (5>3) && ('p' <= 'q') ex16 = "Ha...
hungaikev/learning-haskell
cis194/week1/intro.hs
apache-2.0
1,695
0
11
461
820
438
382
59
1
module HSRT.Test where import HSRT import HSRT.Types import Test.QuickCheck --------------------------------------------------- -- QuickCheck testing --------------------------------------------------- -- Generate random Rays instance Arbitrary Ray where arbitrary = do p1 <- vectorOf 3 (arbitrary::Gen D...
brailsmt/hsrt
src/hsrt/test.hs
apache-2.0
1,279
0
13
270
265
146
119
-1
-1
module Geometry where import System.Random import qualified Data.Map.Strict as M data Point = Point { pointX :: Int, pointY :: Int } deriving (Eq, Ord) type Angle = Float instance Show Point where show point = "(" ++ (show $ pointX point) ++ "," ++ (show $ pointY point) ++ ")" randomPoint width hei...
ftomassetti/hplatetectonics
src/Geometry.hs
apache-2.0
2,293
0
12
813
712
375
337
34
2
{-# LANGUAGE PackageImports, TypeFamilies, DataKinds, PolyKinds #-} module Propellor.Info ( osDebian, osBuntish, osArchLinux, osFreeBSD, setInfoProperty, addInfoProperty, pureInfoProperty, pureInfoProperty', askInfo, getOS, ipv4, ipv6, alias, addDNS, hostMap, aliasMap, findHost, findHostNoAlias, get...
ArchiveTeam/glowing-computing-machine
src/Propellor/Info.hs
bsd-2-clause
6,537
67
15
1,149
1,760
948
812
-1
-1
module Handler.AdminBlog ( getAdminBlogR , getAdminBlogNewR , postAdminBlogNewR , getAdminBlogPostR , postAdminBlogPostR , postAdminBlogDeleteR ) where import Import import Yesod.Auth import Data.Time import System.Locale (defaultTimeLocale) -- The view showing the list of articles ge...
BeerAndProgramming/BeerAndProgrammingSite
Handler/AdminBlog.hs
bsd-2-clause
2,678
0
12
548
610
288
322
59
1
-- -- Copyright 2014, General Dynamics C4 Systems -- -- This software may be distributed and modified according to the terms of -- the GNU General Public License version 2. Note that NO WARRANTY is provided. -- See "LICENSE_GPLv2.txt" for details. -- -- @TAG(GD_GPL) -- {-# LANGUAGE EmptyDataDecls, ForeignFunctionInter...
NICTA/seL4
haskell/src/SEL4/Machine/Hardware/ARM/Lyrebird.hs
bsd-2-clause
3,656
0
12
642
1,083
545
538
-1
-1
module Main (main) where import Test.DocTest (doctest) main :: IO () main = doctest ["-isrc","src/Hangman.hs"]
stackbuilders/hangman-off
tests/DocTests.hs
bsd-3-clause
113
0
6
17
43
25
18
4
1
import Test.Tasty import qualified Admin import qualified Check main :: IO () main = defaultMain $ testGroup "ghc-server" [ Admin.tests , Check.tests ]
bennofs/ghc-server
tests/Main.hs
bsd-3-clause
159
0
8
30
48
27
21
7
1
{-# LANGUAGE MultiParamTypeClasses #-} module Test.Framework.Providers.Program( Checker , testProgramRuns , testProgramOutput ) where import Data.Typeable import System.Directory import System.Exit import System.IO hiding (stdout, stderr) import System.Process hiding (runProcess) import...
acw/test-framework-program
Test/Framework/Providers/Program.hs
bsd-3-clause
3,747
0
15
1,016
885
450
435
81
3
-- 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. ------------------...
rfranek/duckling
Duckling/Ranking/Classifiers/PL.hs
bsd-3-clause
144,652
0
15
71,224
24,067
15,028
9,039
2,270
1
module TestUtil where import Test.Hspec import Util spec :: Spec spec = it "size2humanSize" $ size2humanSize . fst <$> sizeHumanSizes `shouldBe` snd <$> sizeHumanSizes where sizeHumanSizes = [ ( 0, "0B") , ( ...
oshyshko/adventofcode
test/TestUtil.hs
bsd-3-clause
1,165
0
10
642
261
169
92
32
1
{-# LANGUAGE OverloadedStrings #-} module IptAdmin.EditPolicyForm.Render where import Data.Monoid import Data.String import Iptables.Types import Text.Blaze import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A editPolicyForm :: (String, String) -> Policy -> Markup editPolicyForm (...
etarasov/iptadmin
src/IptAdmin/EditPolicyForm/Render.hs
bsd-3-clause
1,476
0
23
568
418
206
212
33
5
{- OPTIONS_GHC -fplugin Brisk.Plugin #-} {- OPTIONS_GHC -fplugin-opt Brisk.Plugin:main #-} {-# LANGUAGE TemplateHaskell #-} module SpawnSym (main) where import Control.Monad (forM, foldM) import Control.Distributed.Process import Control.Distributed.BriskStatic import Control.Distributed.Process.Closure import Control...
abakst/brisk-prelude
examples/SpawnSym.hs
bsd-3-clause
902
0
12
223
263
135
128
24
1
{-# LANGUAGE OverloadedStrings #-} import Network.NetSpec import Network.NetSpec.Text main :: IO () main = runSpec ServerSpec { _ports = [PortNumber 5001] , _begin = (! "I'll echo anything you say.") , _loop = \[h] () -> receive h >>= \line -> case line of "bye" -> stop_ _ -> h ! line >> conti...
DanBurton/netspec
examples/Echo.hs
bsd-3-clause
368
0
14
96
131
73
58
11
2
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Sky.Parsing.Invertible3.PartialType ( PartialType , PartialType' , basicType , fullAlgebraicType , partialAlgebraicType ...
xicesky/sky-haskell-playground
src/Sky/Parsing/Invertible3/PartialType.hs
bsd-3-clause
2,503
0
10
511
391
231
160
32
1
{-# language CPP #-} -- No documentation found for Chapter "PipelineShaderStageCreateFlagBits" module Vulkan.Core10.Enums.PipelineShaderStageCreateFlagBits ( PipelineShaderStageCreateFlags , PipelineShaderStageCreateFlagBits( PIPELINE_SHADER_STAGE_CREATE_RE...
expipiplus1/vulkan
src/Vulkan/Core10/Enums/PipelineShaderStageCreateFlagBits.hs
bsd-3-clause
4,741
1
10
930
380
238
142
-1
-1
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances #-} -- | Complex Type: @extensionsType@ <http://www.topografix.com/GPX/1/1/#type_extensionsType> module Data.Geo.GPX.Type.Extensions( Extensions , extensions , runExtensions ) where import Text.XML.HXT.Arrow.Pickle import Text.XML.HXT.DOM.T...
tonymorris/geo-gpx
src/Data/Geo/GPX/Type/Extensions.hs
bsd-3-clause
770
0
10
123
163
96
67
28
1
{-# LANGUAGE OverloadedStrings #-} module Skywalker.RestServer (RestAPI, restOr, buildRest) where import Data.Text hiding (tail) import Data.ByteString.Lazy hiding (tail) import Network.Wai import Network.HTTP.Types.Status safeHead [] = Nothing safeHead (a:_) = Just a restOr :: Text -> Application -> Application...
manyoo/skywalker
src/Skywalker/RestServer.hs
bsd-3-clause
897
0
14
182
288
150
138
21
2
import Control.Applicative import Control.Monad.Reader import Control.Monad.State import Data.List import Data.Map (Map) import qualified Data.Map as M import System.Directory import System.FilePath import System.Environment import System.Exit import System.IO import AST import CppLexer (lexCpp) import CodeGen impor...
olsner/m3
Main.hs
bsd-3-clause
3,898
23
21
851
1,315
667
648
89
4
module Cipher where import Data.Char import Data.List letterIndex :: Char -> Int letterIndex = (+ (-(ord 'a'))) . ord . toLower offsettedChar :: Int -> Char -> Char offsettedChar offset c = toOriginalCharCase . chr . (+ firstLetterOrd) . (`mod` numLetters) . (+ offset) . (+ (-firstLetterOrd)) . ord . toLower $...
abhean/phffp-examples
src/Cipher.hs
bsd-3-clause
1,795
0
17
328
608
330
278
34
2
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Concurrent (ThreadId, forkIO, myThreadId) import Control.Concurrent.MVar (newEmptyMVar, putMVar, takeMVar, readMVar) import qualified Control.Exception as E import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as C import Ne...
jspahrsummers/network
tests/Simple.hs
bsd-3-clause
8,034
0
14
1,875
2,009
996
1,013
160
3