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 Control.Concurrent.Async.Lifted (async) import Control.Exception (SomeException) import Control.Monad (void, when) import Control.Monad.Catch (catchAll) import Data.List (intercalate, isPrefixOf) import System.Environment (getEnv) import Web.HZulip main :: IO () main = withZulipEnv $ do ...
yamadapc/hzulip
examples/src/ZulipEchoBot.hs
gpl-2.0
1,670
11
27
459
497
240
257
42
3
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} module Network ( Layer(..) , layer , Network , randomizeNetwork , runNetwork , trainN )where import Control.Monad.Random hiding (fromList) import Numeric.LinearAlgebra import ActFun import Mux data Layer = Layer { numNeurons :: Int ...
morae/SortNet
Network.hs
gpl-2.0
6,261
0
16
2,002
1,818
985
833
122
2
{-# LANGUAGE CPP #-} -- notmuch-haskell: notmuch MUA Haskell binding -- test / demo program -- Copyright © 2010 Bart Massey -- Licensed LGPL v3: please see the file COPYING in this -- source distribution for licensing information. -- This program has two modes. When invoked with no -- arguments, it creates a new not...
bgamari/notmuch-haskell
NotmuchTest.hs
gpl-3.0
2,236
0
15
516
531
239
292
51
3
maybeTail :: List a -> Maybe (List a) maybeTail Nil = Nothing maybeTail (Cons _ t) = Just t
hmemcpy/milewski-ctfp-pdf
src/content/1.6/code/haskell/snippet31.hs
gpl-3.0
91
0
8
18
49
23
26
3
1
{-# OPTIONS_HADDOCK not-home #-} {-| A bridge between evaluated Tidal patterns and MIDI events. This module contains functions necessary to mediate between 'Sound.Tidal.Time.Event's generated from a Tidal 'Sound.Tidal.Pattern.Pattern' and plain MIDI events sent through 'Sound.PortMidi.PMStream'. -} module Sound.Tidal....
tidalcycles/tidal-midi
Sound/Tidal/MIDI/Output.hs
gpl-3.0
21,918
362
22
5,365
5,280
2,996
2,284
338
4
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, UndecidableInstances, IncoherentInstances #-} module StackManip(ToStack(..), TwoStack(..), (<|>)) where import Control.Monad.Except import Data.Char import Environment import Object data TwoStack a b = TwoStack a b class ToObject a where toObject :: a -> FOb...
kavigupta/N-programming-language
src/StackManip.hs
gpl-3.0
2,712
32
15
655
922
487
435
74
2
{-# LANGUAGE OverloadedStrings #-} module Html.Cloudfront where import Prelude import Types import Control.Monad import Html.Url import Text.Blaze.Html5 import qualified Data.Map.Strict as M import qualified Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes import qualified Text.Blaze.Html5.Attributes as A clo...
schell/pusher
src/Html/Cloudfront.hs
gpl-3.0
872
0
20
183
256
133
123
21
1
module Database.Abstract.Types where data QuoteStyle = PgSQLStyle | MySQLStyle | SQLiteStyle type TableName = String type ColumnName = String data SQL = NULL | TRUE | FALSE | Literal String | Everything | Column ColumnName | Table TableName | Q...
jkramer/database-abstract
Database/Abstract/Types.hs
gpl-3.0
1,309
0
8
456
353
203
150
35
1
import Control.Monad (replicateM) import Data.Maybe (fromMaybe) import Options.Applicative ((<>)) import KeygenOptions as Opts import RSCoin.Core (derivePublicKey, keyGen, readPublicKey, readSecretKey, ...
input-output-hk/rscoin-haskell
src/Keygen/Main.hs
gpl-3.0
1,675
0
16
633
425
208
217
38
4
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Sheets.Types.Sum -- Copyright : (c) 2015-2016 Brendan ...
rueshyna/gogol
gogol-sheets/gen/Network/Google/Sheets/Types/Sum.hs
mpl-2.0
74,088
0
11
17,344
9,399
5,073
4,326
1,142
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Spanner.Types.Sum -- Copyright : (c) 2015-2016 Brendan...
brendanhay/gogol
gogol-spanner/gen/Network/Google/Spanner/Types/Sum.hs
mpl-2.0
30,700
0
11
6,949
4,042
2,181
1,861
473
0
module Opaleye.X ( module Opaleye.X.Aggregate , module Opaleye.X.Array , module Opaleye.X.Join , module Opaleye.X.Maybe , module Opaleye.X.Order , module Opaleye.X.Optional , module Opaleye.X.Table , module Opaleye.X.TF , module Opaleye.X.Transaction ) where -- opaleye-x -------...
duairc/opaleye-x
src/Opaleye/X.hs
mpl-2.0
685
0
5
183
126
87
39
19
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-translate/gen/Network/Google/Resource/Translate/Projects/TranslateText.hs
mpl-2.0
5,673
0
16
1,226
787
462
325
114
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-searchconsole/gen/Network/Google/Resource/Webmasters/Sitemaps/Delete.hs
mpl-2.0
4,889
0
19
1,190
787
458
329
113
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/Locations/DeidentifyTemplates/Get.hs
mpl-2.0
5,809
0
15
1,195
703
414
289
110
1
module Main (module Main) where
lspitzner/brittany
data/Test136.hs
agpl-3.0
32
0
4
5
10
7
3
1
0
module Listener( -- * Functions listener ) where import Control.Concurrent(forkIO) import Network(PortNumber,PortID(PortNumber),withSocketsDo,listenOn) import Network.Socket(Socket,accept) -- | listener listens on the given port, accepting connections -- to be handled by the given handler. listener :: Por...
qpliu/lecache
hs/Listener.hs
lgpl-3.0
510
0
11
89
145
80
65
9
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QStyleOptionTabV2.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:16 Warning : this file is machine generated ...
uduki/hsQt
Qtc/Gui/QStyleOptionTabV2.hs
bsd-2-clause
3,299
0
12
472
768
401
367
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} -- | -- Module : Documentation.Haddock.Parser -- Copyright : (c) Mateusz Kowalczyk 2013-2014, -- Simon Hengel 2013 -- License : BSD-like -- -- Maintainer : haddock@projects.haskell.org -- Stability : experim...
haskell/haddock
haddock-library/src/Documentation/Haddock/Parser.hs
bsd-2-clause
30,937
0
20
8,714
8,398
4,376
4,022
509
25
-- http://www.codewars.com/kata/54554846126a002d5b000854 module Gift where buy :: (Num a, Eq a) => a -> [a] -> Maybe (Int, Int) buy c is = if null os then Nothing else Just (head os) where is' = zip [0..] is os = [(fst a, fst b) | a<-is', b<-is', snd a + snd b == c, fst a /= fst b]
Bodigrim/katas
src/haskell/7-A-Gift-Well-Spent.hs
bsd-2-clause
287
0
11
63
158
82
76
5
2
{- Copyright (c) 2014. Robert Dockins. -} -- | This module defines the set of tokens produced by the lexer -- and consumed by the parser. module Orlin.Tokens where -- | A 'Pn' indicates a position in a source file. -- It contains the name of the source file, the line number and column number. data Pn = Pn FilePat...
robdockins/orlin
src/Orlin/Tokens.hs
bsd-2-clause
3,021
0
9
748
704
394
310
105
1
module Acme.OmittedOrUndefinedSpec where import Acme.OmittedOrUndefined import Acme.Omitted import Acme.Undefined import Prelude hiding (undefined) import qualified Prelude import Test.Hspec spec = do describe "isOmitted" $ do it "isOmitted 0 = False" $ do isOmitted zero `shouldReturn` False ...
joachifm/acme-omitted
tests/Acme/OmittedOrUndefinedSpec.hs
bsd-2-clause
1,400
0
15
313
330
158
172
35
1
{-# LANGUAGE OverloadedStrings #-} import qualified Data.Text as T import Data.Time (UTCTime (..), fromGregorian) import Text.XML.Light import qualified Web.Atom as Atom xmlgen :: Atom.XMLGen Element Content QName Attr xmlgen = Atom.XMLGen { Atom.xmlElem = \n as ns -> El...
cbaatz/atom-basic
examples/atom-xml/Main.hs
bsd-3-clause
887
0
12
259
278
152
126
19
1
{-# LANGUAGE RankNTypes, DeriveDataTypeable, StandaloneDeriving, KindSignatures #-} module Pathfinder.Race ( Race , raceSize , raceAdjust ) where import Pathfinder.Misc import Pathfinder.Character import qualified Control.Monad.Random as Rand import Control.Arrow import Data.Data import Data.Dynamic type Ran...
Elarnon/npc-gen
Pathfinder/Race.hs
bsd-3-clause
1,503
0
13
310
110
66
44
16
0
module Test.Themis.Provider.TestFramework ( buildTestSet , runTFTests , module Test.Themis.Test ) where import Control.Exception (SomeException, catch) import qualified Test.Framework as TF import qualified Test.Framework.Providers.HUnit as TFH import qualified Test.Framework.Providers.QuickCheck2 as TFQ impor...
andorp/themis
src/Test/Themis/Provider/TestFramework.hs
bsd-3-clause
1,724
0
14
434
509
267
242
37
3
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies, LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} module Futhark.CodeGen.ImpGen.Kernels ( compileProg ) where import Control.Monad.Except import Control.Monad.Reader import Control.Applicative import Data.Maybe import Data.Monoid import qualified Dat...
CulpaBS/wbBach
src/Futhark/CodeGen/ImpGen/Kernels.hs
bsd-3-clause
47,960
2
28
13,492
12,182
5,964
6,218
957
9
-- |Module to parse the command line module Commandline ( TestMode(..) , DataType(..) , Options(..) , parseCommandLineOptions , checkOptionsConsistency ) where import Control.Monad import Data.Char import Data.List import Error import System.Console.GetOpt import System.IO import Text.Read -- |Supporte...
m-schmidt/fuzzer
src/Commandline.hs
bsd-3-clause
5,669
0
17
1,486
1,418
770
648
122
4
module Wyas.Parser where import Data.Char import Text.ParserCombinators.Parsec hiding (string) import Data.List (foldl') import Numeric import Wyas.LispVal -- $setup -- >>> import Data.Either (isLeft) parseFile :: FilePath -> IO (Either ParseError LispVal) parseFile f = do str <- readFile f case runParser l...
parsonsmatt/wyas
src/Wyas/Parser.hs
bsd-3-clause
4,469
7
20
1,174
1,320
650
670
106
9
module MPS.Light where import Control.Arrow ((&&&), (>>>), (<<<)) import Control.Category (Category) import Data.Char import Data.Foldable (elem, foldl, foldl', toList, Foldable) import Data.Function (on) import Debug.Trace import Prelude hiding ((.), (^), (>), (<), (/), (-), elem, foldl, foldl1) import qualified Prel...
nfjinjing/mps
src/MPS/Light.hs
bsd-3-clause
7,411
5
12
1,842
4,263
2,393
1,870
-1
-1
module T492 where import Data.Functor.Const import Data.Functor.Const.Singletons import Data.Proxy import Data.Proxy.Singletons import Prelude.Singletons hiding (Const, ConstSym0, ConstSym1) f :: Const Bool Ordering f = Const @Bool @Ordering True sF1 :: SConst ('Const @Bool @Ordering True) sF1 = SConst @Bool @Orderi...
goldfirere/singletons
singletons-base/tests/compile-and-dump/Singletons/T492.hs
bsd-3-clause
624
7
7
96
176
110
66
-1
-1
{-# LANGUAGE PackageImports #-} module GHC.IO.Buffer (module M) where import "base" GHC.IO.Buffer as M
silkapp/base-noprelude
src/GHC/IO/Buffer.hs
bsd-3-clause
108
0
4
18
23
17
6
3
0
-- | -- Module : $Header$ -- Copyright : (c) 2013-2014 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE Safe #-} {-# LANGUAGE PatternGuards #-} module Cryptol.Eval ( moduleEnv , EvalEnv() , emptyEnv , eval...
TomMD/cryptol
src/Cryptol/Eval.hs
bsd-3-clause
6,621
0
17
1,770
1,889
951
938
120
19
module Core.FreeVars where import Core.Syntax import Utilities import qualified Data.Set as S type FreeVars = S.Set Var type BoundVars = S.Set Var deleteList :: Ord a => [a] -> S.Set a -> S.Set a deleteList = flip $ foldr S.delete termFreeVars :: Term -> FreeVars termFreeVars (Term e) = termFreeVars' termFreeVar...
batterseapower/supercompilation-by-evaluation
Core/FreeVars.hs
bsd-3-clause
2,331
0
9
396
866
447
419
46
1
module Graphics.Ascii.Haha.Bitmap where import qualified Data.Map as M import Prelude hiding (filter) import Graphics.Ascii.Haha.Geometry --------[ image data type ]---------------------------------------------------- data Bitmap u p = Bitmap { bits :: M.Map (Point u) p } deriving (Show, Eq) withBits :: (M.Map (...
sebastiaanvisser/haha
src/Graphics/Ascii/Haha/Bitmap.hs
bsd-3-clause
3,583
0
15
848
1,515
763
752
53
2
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE Templa...
dmjio/hadron
src/Hadron/Run/Local.hs
bsd-3-clause
11,452
0
22
2,894
2,525
1,270
1,255
-1
-1
{-| Module : $HEADER$ Description : Extra functions on List. Copyright : (c) Justus Adam, 2015 License : BDS3 Maintainer : dev@justus.science Stability : experimental Portability : POSIX, Windows -} {-# LANGUAGE UnicodeSyntax #-} module Data.List.JAExtra ( -- * Reading values get -- * Modifyin...
JustusAdam/ja-base-extra
src/Data/List/JAExtra.hs
bsd-3-clause
10,433
0
13
2,428
3,987
2,171
1,816
168
3
-- !!! Conflicting re-exportation of dcon module M (module Mod143_A,module M) where import Mod143_A -- yes, this is intentionally Mod143_A data Foo1 = Bar
FranklinChen/Hugs
tests/static/mod144.hs
bsd-3-clause
158
0
5
27
26
18
8
3
0
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Uninterpreted.Sort -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Test suite for uninterpreted sorts -------------------------...
Copilot-Language/sbv-for-copilot
SBVUnitTest/TestSuite/Uninterpreted/Sort.hs
bsd-3-clause
1,265
0
13
243
314
171
143
-1
-1
module Common (assert, datadir, getTestContext, KeyDirections(..), testKeySeq, ks) where import Data.Maybe import Control.Monad import Text.XkbCommon assert :: Bool -> String -> IO () assert False str = ioError (userError str) assert _ _ = return () datadir = "data/" getTestContext :: IO Context getTestContext = d...
abooij/haskell-xkbcommon
tests/Common.hs
mit
1,633
0
18
475
534
267
267
31
1
module Network.Slack.User ( User(..), users, userFromId, userFromName ) where import Network.Slack.Types (User(..), Slack(..), users) import Data.List (find) import Text.Printf (printf) import Control.Applicative ((<$>)) import Control.Monad.Trans.Either (hois...
BeautifulDestinations/slack
Network/Slack/User.hs
mit
1,109
0
13
260
322
172
150
23
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- | -- Module: Aws.Sns.Commands.SetTopicAttributes -- Copyright: Copyright © 2014 AlephCloud Systems, Inc. -- ...
ababkin/hs-aws-sns
src/Aws/Sns/Commands/SetTopicAttributes.hs
mit
4,336
1
12
677
654
391
263
74
1
{-# LANGUAGE OverloadedStrings, PatternGuards #-} {- Copyright (C) 2006-2015 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...
infotroph/pandoc
src/Text/Pandoc/Writers/Docbook.hs
gpl-2.0
17,215
0
21
5,025
4,486
2,301
2,185
309
16
module Buildsome.Db ( Db, with , registeredOutputsRef, leakedOutputsRef , InputDesc(..), FileDesc(..) , OutputDesc(..) , ExecutionLog(..), executionLog , FileContentDescCache(..), fileContentDescCache , Reason(..) , IRef(..) , MFileContentDesc, MakefileParseCache(..), makefileParseCache ) where imp...
buildsome/buildsome
src/Buildsome/Db.hs
gpl-2.0
5,837
0
16
1,132
1,709
951
758
143
1
{-# OPTIONS_GHC -Wall -Wno-orphans -Wno-unticked-promoted-constructors #-} module Graphics.Cairo ( Cairo(..), cairoCreate, cairoDestroy , runCairo , cairoToGICairo -- Temporary: until https://github.com/haskell-gi/haskell-gi/issues/188 is fixed , pangoCairoCreateContext , pangoLayoutNew -- , crColo...
deepfire/mood
src/Graphics/Cairo.hs
agpl-3.0
25,605
41
32
6,168
6,575
3,442
3,133
-1
-1
{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE JavaScriptFFI #-} {- Copyright 2019 The CodeWorld Authors. All Rights Reserved. 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 ...
alphalambda/codeworld
funblocks-client/src/Blockly/Event.hs
apache-2.0
3,031
15
11
773
507
273
234
54
6
module Reddit.Routes.Search where import Reddit.Types.Options import Reddit.Types.Post import Reddit.Types.Subreddit import qualified Reddit.Types.SearchOptions as Search import Data.Maybe import Data.Text (Text) import Network.API.Builder.Routes searchRoute :: Maybe SubredditName -> Options PostID -> Search.Order -...
FranklinChen/reddit
src/Reddit/Routes/Search.hs
bsd-2-clause
685
0
11
164
214
119
95
20
2
-- Run tests using the TCP transport. -- module Main where import TEST_SUITE_MODULE (tests) import Network.Transport.Test (TestTransport(..)) import Network.Socket (sClose) import Network.Transport.TCP ( createTransportExposeInternals , TransportInternals(socketBetween) , defaultTCPParameters ) import Test.Fr...
haskell-distributed/distributed-process-tests
tests/runTCP.hs
bsd-3-clause
1,367
0
15
280
220
125
95
23
1
module Fir where import Language.StreamIt fir :: Var Int -> Var (Array Float) -> Filter Float Float () fir n weights = work Rate{pushRate=1, popRate=1, peekRate=ref n} $ do result <- float' 0 for (0, ref n) $ \i -> do let i' = ref i result += ref (weights ! i') * peek i' -- Looks pretty ...
adk9/haskell-streamit
Examples/fir/Fir.hs
bsd-3-clause
529
0
16
157
230
114
116
14
1
module A (a) where a :: Char a = 'z'
gridaphobe/hpc
tests/ghc_ghci/A.hs
bsd-3-clause
39
0
4
12
19
12
7
3
1
-- Simple data type to keep track of character positions -- within a text file or other text stream. module Text.Packrat.Pos where data Pos = Pos { posFile :: !String , posLine :: !Int , posCol :: !Int } nextPos :: Pos -> Char -> Pos nextPos (Pos file line col) c ...
beni55/HaskellNet
src/Text/Packrat/Pos.hs
bsd-3-clause
1,047
0
14
345
444
221
223
30
2
module TH_repPatSig_asserts where import Language.Haskell.TH assertFoo :: Q [Dec] -> Q [Dec] assertFoo decsQ = do decs <- decsQ case decs of [ SigD _ (AppT (AppT ArrowT (ConT t1)) (ConT t2)), FunD _ [Clause [SigP (VarP _) (ConT t3)] (NormalB (VarE _)) []] ] | t1 == ''Int && t2 == ''Int && t3 == ''...
ezyang/ghc
testsuite/tests/th/TH_repPatSig_asserts.hs
bsd-3-clause
1,502
0
22
594
662
319
343
-1
-1
module T5281A where {-# DEPRECATED deprec "This is deprecated" #-} deprec :: Int deprec = 5
urbanslug/ghc
testsuite/tests/rename/should_fail/T5281A.hs
bsd-3-clause
95
0
4
19
15
10
5
4
1
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE ScopedTypeVariables #-} module Options (injectDefaults) where import Control.Applicative import qualified Control.Exception as E import Control.Monad import Data.Char (isAlphaNum, isSpace, toLower) import ...
piyush-kurur/yesod
yesod/Options.hs
mit
4,306
0
18
1,218
1,282
679
603
64
2
import qualified Data.Map as Map -- In hindsight, this problem is equivalent to counting the permutations of a -- list containing 20 'down's and 20 'right's, which can be computed with a -- single equation. latticePaths :: Int -> Int latticePaths n = fst $ f Map.empty n n where f m 0 _ = (1,m) f m _ 0 = (1,...
pshendry/project-euler-solutions
0015/solution.hs
mit
683
0
18
222
290
152
138
16
4
{-# LANGUAGE OverloadedStrings #-} {- Limits for memory, cpu time, etc. under a "sandbox" -} module Codex.Tester.Limits ( Limits(..), lookupLimits, ) where import Data.Configurator.Types(Config) import qualified Data.Configurator as Configurator import Control.Monad (mplus) -- | SafeEx...
pbv/codex
src/Codex/Tester/Limits.hs
mit
2,384
0
11
863
548
306
242
64
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.TextTrackList (js_item, item, js_getTrackById, getTrackById, js_getLength, getLength, addTrack, change, removeTrack, TextTrackList, castToTextTrackList, gTypeTextTrackList) where impo...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/TextTrackList.hs
mit
2,990
22
11
389
666
389
277
44
1
-- Head, Tail, Init and Last -- http://www.codewars.com/kata/54592a5052756d5c5d0009c3 module ListOps where import Prelude hiding (head, tail, init, last) head (x:_) = x tail (_:xs) = xs init [x] = [] init (x:xs) = x : init xs last [x] = x last (...
gafiatulin/codewars
src/7 kyu/ListOps.hs
mit
349
0
7
134
118
66
52
8
1
module Drawhub.Region ( Size ( .. ), scaleFixedWidth, scaleFixedHeight, Point ( .. ), pointX, pointY, pointBimap, add, Region ( .. ), regionTopLeft, regionBottomRight, regionWidth, regionHeight, regionSize, isInclude ) where data Size a = Size a a deriving ...
TurpIF/Drawhub
src/main/Drawhub/Region.hs
mit
2,443
0
11
565
1,078
537
541
60
1
module Rebase.Data.Semigroupoid.Static ( module Data.Semigroupoid.Static ) where import Data.Semigroupoid.Static
nikita-volkov/rebase
library/Rebase/Data/Semigroupoid/Static.hs
mit
116
0
5
12
23
16
7
4
0
module L.L3.L3AST ( L3Func ,L3(..) ,D(..) ,V(..) ,E(..) ,foldV ,module L.Primitives ) where import Control.Applicative import Control.Monad import Data.Int import Data.Monoid import qualified Data.Set as Set import Data.Traversable hiding (sequence) import L.Primitives import L.Parser.SExpr import L.Variable i...
joshcough/L5-Haskell
src/L/L3/L3AST.hs
mit
5,477
0
15
1,601
2,358
1,209
1,149
102
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module ZoomHub.Worker ( processExistingContent, processExpiredActiveContent, ) where import Control.Concurrent (threadDelay) import Control.Exception.Enclosed (catchAny) i...
zoomhub/zoomhub
src/ZoomHub/Worker.hs
mit
3,322
0
26
703
779
441
338
69
1
import Data.List (foldl') import Data.Numbers.Primes (primes) sieve :: Int -> [Int] -> [Int] sieve p = filter (\x -> x `mod` p /= 0) phi :: Int -> Int -> Int phi x a = length $ foldl' (flip sieve) [1..x] (take a primes) isqrt :: Int -> Int isqrt = floor . sqrt . fromIntegral primePi :: Int -> Int primePi 1 = 0 prim...
genos/online_problems
prog_praxis/legendre_primes.hs
mit
417
0
9
96
219
116
103
13
1
{-# LANGUAGE DeriveDataTypeable, RecordWildCards, FlexibleContexts #-} -------------------------------------------------------------------------------- {- | Module : Data.Acid.CenteredSlave.hs Copyright : MIT Maintainer : max.voit+hdv@with-eyes.net Portability : non-portable (uses GHC extensions) ...
sdx23/acid-state-dist
src/Data/Acid/Centered/Slave.hs
mit
21,264
0
23
6,599
4,515
2,252
2,263
351
11
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module DBus.Reactive ( Network (..) , newNet , listen , listen' , sync , signalEvent , behaviourToProperty , propertyBehaviour' , propertyBehaviour , eventMethod , eventSignal ) where import Control.Concurrent imp...
Philonous/d-bus-reactive
src/DBus/Reactive.hs
mit
5,066
0
19
1,872
1,416
687
729
136
5
import Data.Char (digitToInt) import Data.List (intercalate) main = do b <- readLn :: IO Integer n <- readLn :: IO Integer let cycle = sadCycle b n putStrLn $ intercalate ", " $ map show cycle sadCycle b n = runCycle b n [] runCycle b n l | next `elem` l = reverse $ next : takeWhile (/=next) l ...
devonhollowood/dailyprog
2015-05-18/sad_cycles.hs
mit
477
0
10
127
222
110
112
14
1
{-# LANGUAGE OverloadedStrings #-} module Unit.Validators.PasswordValidatorSpec (spec) where import Test.Hspec import Control.Exception (evaluate) import Validators.PasswordValidator import qualified Models.Errors.Code as EC spec :: Spec spec = do describe "isValid" $ do describe "the password is less than 8 c...
bocuma/users-service
test/Unit/Validators/PasswordValidatorSpec.hs
mit
986
0
19
206
224
111
113
21
1
import Data.List import Data.Maybe primes :: [Integer] primes = [2] ++ unfoldr ( \primes -> let newPrime = fromJust $ find (\candidate -> all (\x -> candidate `mod` x /= 0 ) primes ) [last primes + 1 ..] in Just(newPrime, primes++[newPrime]) ) [2] factors :: Integer -> [Integer] facto...
nbartlomiej/haskeuler
003/problem-003.hs
mit
557
0
21
131
244
133
111
17
1
{-# LANGUAGE OverloadedStrings, QuasiQuotes, BangPatterns, ScopedTypeVariables #-} module Main where import Data.Text (Text) import Control.Applicative import Control.Monad.Reader import qualified Data.Map.Strict as M import qualified Data.ByteString.Lazy as L import Data.ByteString.Lazy as BL hiding (map, intersperse,...
danchoi/jsonconvhtml
Main.hs
mit
4,142
0
18
971
1,270
689
581
97
6
module Parser where import Text.Parsec import Text.Parsec.String import qualified Text.Parsec.Expr as Expr import qualified Text.Parsec.Token as Token import Lexer import Syntax -- Helper function to build the association table binary sym func = Expr.Infix (reservedOperators sym >> return (BinOp func)) associati...
iankronquist/riemann
src/Parser.hs
mit
4,154
0
22
823
1,282
610
672
141
1
module Graphics.Object (makeObject, Object) where import Graphics.Rendering.OpenGL import Control.Monad.Trans.Maybe (MaybeT) import Control.Monad.IO.Class (liftIO) import Data.Word (Word16) import Graphics.Shaders (makeProgram) import Graphics.Buffers (makeBufferWithData, ptrOffset) import Graphics.ArrayObjects (make...
sgillis/HOpenGL
src/Graphics/Object.hs
gpl-2.0
1,756
0
12
348
489
245
244
38
1
fmap f [] = [] fmap f (x:xs) = f x : fmap f xs
hmemcpy/milewski-ctfp-pdf
src/content/1.10/code/haskell/snippet10.hs
gpl-3.0
46
0
7
14
44
21
23
2
1
fibs :: [Integer] fibs = base ++ (next base) where base = [0, 1] {-| `f`is the (n+1)-th Fibonacci's number. Starting from a list containing n Fibonacci's numbers, `next` computes the next number in a lazy way. `uncurry (+)` gives as a result something like [(\(a, b) -> a + b)] `last` takes the last pair of th...
mdipirro/functional-languages-homeworks
Christmas/Exercise4.hs
gpl-3.0
677
0
10
146
108
59
49
6
1
module SizeTreap where import Data.Tree.Treap testData :: [(Int, Int, Int)] testData = [(1, 2, 1), (3, 6, 1), (6, 44, 1), (7, 0, 1), (2, 85, 1), (4, -2, 1), (5, 4, 1), (8, 21, 1)] sizeOf :: (Ord a, Enum a, Ord b) => Treap a b Int -> Int sizeOf Leaf = 0 sizeOf (Branch _ _ v _ _) = v recalcSize ::...
graninas/Haskell-Algorithms
Tests/SizeTreap.hs
gpl-3.0
848
0
9
240
488
268
220
17
1
(=>=) :: (Product e a -> b) -> (Product e b -> c) -> (Product e a -> c) f =>= g = \(Prod e a) -> let b = f (Prod e a) c = g (Prod e b) in c
hmemcpy/milewski-ctfp-pdf
src/content/3.7/code/haskell/snippet09.hs
gpl-3.0
188
0
12
90
114
57
57
-1
-1
module Graphics.UI.SDL.Extra.Keys where import Graphics.UI.SDL hiding (init) import Data.Char (isAlphaNum, isSpace) keyToChar :: SDLKey -> Maybe Char keyToChar SDLK_a = Just 'a' keyToChar SDLK_b = Just 'b' keyToChar SDLK_c = Just 'c' keyToChar SDLK_d = Just 'd' keyToChar SDLK_e = Just 'e' keyToChar SDLK_f = Just 'f' k...
mikeplus64/Level-0
src/Graphics/UI/SDL/Extra/Keys.hs
gpl-3.0
2,015
0
17
553
769
372
397
53
9
module Classwork where data Tree a = Leaf a | Branch (Tree a) a (Tree a) instance (Eq a) => Eq (Tree a) where (==) (Leaf x) (Leaf y) = x == y (==) (Branch l1 v1 r1) (Branch l2 v2 r2) = v1 == v2 && l1 == l2 && r1 == r2 (==) _ _ = False tr1 = Branch (Leaf 42) 15 (Branch (Leaf 0) 5 (Leaf 0)) tr2 = Branch (...
ItsLastDay/academic_university_2016-2018
subjects/Haskell/6/classwork.hs
gpl-3.0
2,104
2
13
708
1,067
551
516
45
3
module Typedrat.Templates.PostList (postListTemplate) where import Data.Int import qualified Data.Text as T import Data.Time import Lucid import Typedrat.DB import Typedrat.DB.Post import Typedrat.Routes import Typedrat.Templates.Types postListTemplate :: TVContains a "posts" [(BlogPost Hask, Int64)] xs => RatTempla...
typedrat/typedrat-site
app/Typedrat/Templates/PostList.hs
gpl-3.0
1,025
0
20
264
320
161
159
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Printer.SPEC (printProperty) where import qualified Data.ByteString.Lazy as L import Data.ByteString.Builder import Data.Monoid import Property renderOp :: Op -> Builder renderOp Ge = ">=" renderOp op = error $ "operand not supported for spec: " <> show op renderConjun...
cryptica/slapnet
src/Printer/SPEC.hs
gpl-3.0
1,713
0
9
292
508
258
250
36
1
{-# LANGUAGE FlexibleContexts, NoMonomorphismRestriction, GADTs, ScopedTypeVariables, TemplateHaskell, StandaloneDeriving, ExtendedDefaultRules #-} import Blender import Data.Function import Data.Vect.Double import ExampleTriangulations import Control.Monad import StandardCoordinates import Tetrahedron.NormalDisc im...
DanielSchuessler/hstri
bin/output_DiscTypes.hs
gpl-3.0
1,056
0
18
240
264
140
124
27
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.AdSense.Types.Sum -- Copyright : (c) 2015-2016 Brendan...
rueshyna/gogol
gogol-adsense/gen/Network/Google/AdSense/Types/Sum.hs
mpl-2.0
598
0
4
109
29
25
4
8
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/AddWorkingStorage.hs
mpl-2.0
4,587
0
10
941
524
319
205
61
1
{- Habit of Fate, a game to incentivize habit formation. Copyright (C) 2017 Gregory Crosswhite This program is free software: you can redistribute it and/or modify it under version 3 of the terms of the GNU Affero General Public License. This program is distributed in the hope that it will be usef...
gcross/habit-of-fate
sources/library/HabitOfFate/Server/Requests/Web/ChangeTimeZone.hs
agpl-3.0
3,628
0
28
903
785
401
384
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Motivators where import Control.Concurrent (threadDelay) import Control.Distributed.Process import Control.Monad (forever) import Data.Binary import Data.Typeable import GHC.Generics (Generic) data Action = ShareState deriving (Generic, Ty...
mreluzeon/block-monad
src/Motivators.hs
lgpl-3.0
517
0
9
77
122
67
55
18
1
module Interface.Board where type Cell = (Int, Int) class BoardState b where getLiving :: b -> [Cell] isLiving :: Cell -> b -> Bool alter :: Cell -> b -> b next :: b -> b previous :: b -> b translate :: Cell -> Cell -> Cell translate (x, y) (xVect, yVect) = (x + xVect, y + yVect)
Sventimir/game-of-life
Interface/Board.hs
apache-2.0
305
0
8
84
132
75
57
10
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} module Lycopene.Core.Project ( Project(..) , ProjectStatus(..) , ProjectId , ProjectF(..) , ProjectM , newProject , addProject , removeProject , updateProject , fetchByNameProject , fetchAllProject , activateProject , deactivateProject ) ...
utky/lycopene
src/Lycopene/Core/Project.hs
apache-2.0
3,831
0
11
771
986
553
433
98
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( makeApplication , getApplicationDev , makeFoundation ) where import Import import Settings import Yesod.Auth import Yesod.Default.Config import Yesod.Default.Main import Yesod.Default.Handlers import Network.Wa...
hirokai/PaperServer
Application.hs
bsd-2-clause
2,588
0
12
504
436
238
198
52
2
-- base import Control.Concurrent (threadDelay) import Data.Char (isAscii) import Data.List (intercalate, isPrefixOf) -- HUnit import Test.HUnit ((@?=), assertBool, assertFailure) -- test-framework import Test.Framework (Test, defaultMain, testGroup) -- test-framework-hunit import Test.Framework.Pr...
phaazon/GLFW-b
Test.hs
bsd-2-clause
15,828
0
17
3,809
4,050
1,993
2,057
373
2
{-# LANGUAGE ExistentialQuantification, TemplateHaskell, StandaloneDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans -O0 #-} -- We have to disable optimisation here, as some versions of ghc otherwise -- fail to compile this code, at least within reasonable memory limits (40g). {-| Implementation of the opcodes. -} {- ...
ganeti/ganeti
src/Ganeti/OpCodes.hs
bsd-2-clause
30,079
0
12
7,728
5,906
3,620
2,286
955
2
module Test.Haddock.Xhtml ( Xml , parseXml, dumpXml , stripLinks, stripLinksWhen, stripAnchorsWhen, stripIdsWhen, stripFooter ) where {- This module used to actually parse the HTML (using the `xml` parsing library) which made it was possible to do more proper normalization of things like ids or names. ...
haskell/haddock
haddock-test/src/Test/Haddock/Xhtml.hs
bsd-2-clause
3,856
0
12
869
852
451
401
69
3
{-# LANGUAGE UndecidableInstances #-} module Feldspar.Multicore.Channel.Representation where import Control.Monad.Operational.Higher import Control.Monad.Trans import Data.Ix import Data.Proxy import Data.Typeable import Data.TypedStruct import GHC.Exts (Constraint) import Feldspar import Feldspar.Multicore.CoreId im...
kmate/raw-feldspar-mcs
src/Feldspar/Multicore/Channel/Representation.hs
bsd-3-clause
3,339
0
12
695
1,168
606
562
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} module Acc.Stencil where import Data.Array.Accelerate as A import Acc.Types import Prelude as P yxStencil3x3 :: forall a. Elt a => (Stencil3x3 a -> Exp a) -> Acc (Cube a) -> Acc (Cube a) yxStencil3x3 s = stencil f A.Clamp where f ...
cpdurham/accelerate-camera-sandbox
src/Acc/Stencil.hs
bsd-3-clause
961
0
11
266
488
276
212
41
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/TimeGrain/GA/Rules.hs
bsd-3-clause
1,380
0
11
277
272
173
99
25
1
import Types import Graphics.GL.Pal sphere :: Float -> [Cube] sphere t = [ newCube { cubeColor = colorHSL (x*0.1+t*0.5) 0.8 0.6 , cubeRotation = axisAngle (V3 0 0 1) t , cubePosition = rotate (axisAngle (V3 0 1 0) (x*0.2)) . rotate (axisAngle (V3 1 0 0) (x...
lukexi/cubensis
defs/Sphere.hs
bsd-3-clause
697
0
14
281
330
175
155
17
1
module Data.Geo.GPX.Lens.RtesL where import Data.Geo.GPX.Type.Rte import Data.Lens.Common class RtesL a where rtesL :: Lens a [Rte]
tonymorris/geo-gpx
src/Data/Geo/GPX/Lens/RtesL.hs
bsd-3-clause
137
0
8
21
45
28
17
5
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} module QueryTariff where import Control.Lens import Control.Monad.Trans.Except (ExceptT (..), throwE) import qualified Data.ByteString.Lazy.Char8 as ...
section77/datenverbrauch
src/QueryTariff.hs
bsd-3-clause
6,813
0
17
1,982
1,526
819
707
82
2
{-# LANGUAGE FlexibleInstances #-} -- ghc options {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -- {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- {-#...
reuleaux/pire
src/Pire/Pretty/Decl.hs
bsd-3-clause
5,470
0
16
1,109
1,012
534
478
67
1
{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs, DataKinds, FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes ...
paul-rouse/persistent
persistent-postgresql/test/CustomConstraintTest.hs
mit
3,160
0
17
990
278
148
130
46
1
{- DATX02-17-26, automated assessment of imperative programs. - Copyright, 2017, see AUTHORS.md. - - 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...
DATX02-17-26/DATX02-17-26
libsrc/Class/Product/Uncons.hs
gpl-2.0
3,063
0
10
541
506
286
220
-1
-1
{-| Description : Data structures that represent models of temporal logic. Maintainer : Guilherme G. Azzi <ggazzi@inf.ufrgs.br> Stability : provisional -} {-# LANGUAGE TypeFamilies #-} module Logic.Model ( -- * Kripke structures KripkeStructure(..) , State(..) , Transition(..) -- ** Looking up states...
rodrigo-machado/verigraph
src/library/Logic/Model.hs
gpl-3.0
4,417
0
10
954
857
473
384
77
1
module Minimal00001 where class HasFoo a where {-# MINIMAL foo #-} foo :: a -> String bar :: a -> String class HasFoo' a where foo' :: a -> String {-# MINIMAL foo' #-} bar' :: a -> String class HasFoo'' a where foo'' :: a -> String bar'' :: a -> String {-# MINIMAL foo'' #-}
carymrobbins/intellij-haskforce
tests/gold/parser/Minimal00001.hs
apache-2.0
314
0
7
96
88
48
40
13
0