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 GenTerm () where foo :: Int -> Int -> Int {-@ foo :: n:Nat -> m:Nat -> Nat /[n+m] @-} foo n m | cond 1 = 0 | cond 2 && n > 1 = foo (n-1) m | cond 3 && m > 2 = foo (n+10) (m-2) {-@ cond :: Int -> Bool @-} cond :: Int -> Bool cond _ = undefined
mightymoose/liquidhaskell
tests/neg/GeneralizedTermination.hs
bsd-3-clause
261
0
10
78
129
65
64
8
1
{-# LANGUAGE StrictData, TemplateHaskell #-} module T10697_sourceUtil where import Language.Haskell.TH makeSimpleDatatype :: Name -> Name -> SourceUnpackednessQ -> SourceStrictnessQ -> Q Dec makeSimpleDatatype tyName conName srcUpk srcStr = ...
tjakway/ghcjvm
testsuite/tests/th/T10697_sourceUtil.hs
bsd-3-clause
1,301
0
15
385
337
182
155
39
2
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fdefer-type-errors #-} module T15039d where import Data.Coerce import Data.Kind import Data.Type.Coercion import...
sdiehl/ghc
testsuite/tests/partial-sigs/should_compile/T15039d.hs
bsd-3-clause
986
0
10
195
298
175
123
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE QuasiQuotes, TemplateHaskell, CPP, GADTs, TypeFamilies, OverloadedStrings, FlexibleContexts, EmptyDataDecls #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module MigrationTest where import Database.Persist.TH import qualified Data...
pseudonom/persistent
persistent-test/src/MigrationTest.hs
mit
997
0
12
182
137
72
65
18
1
{-# LANGUAGE TypeFamilies #-} module T8227 ( absoluteToParam ) where import T8227a type family Scalar a :: * type instance Scalar (a -> v) = a -> Scalar v arcLengthToParam :: Scalar (V p) -> p -> Scalar (V p) -> Scalar (V p) arcLengthToParam = undefined absoluteToParam :: Scalar (V a) -> a -> Scalar (V a) ...
siddhanathan/ghc
testsuite/tests/indexed-types/should_fail/T8227.hs
bsd-3-clause
702
0
10
171
142
75
67
11
1
module Hasql.Private.Settings where import Hasql.Private.Prelude import qualified Data.ByteString as B import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Lazy as BL -- | -- All settings encoded in a single byte-string according to -- <http://www.postgresql.org/docs/9.4/static/libpq-co...
nikita-volkov/hasql
library/Hasql/Private/Settings.hs
mit
1,256
0
12
240
342
185
157
22
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} module ZoomHub.Types.DeepZoomImage.TileSize ( TileSize (..), fromString, fromInteger, ) where import Data.Aeson (ToJSON, Value (Number), toJSON) imp...
zoomhub/zoomhub
src/ZoomHub/Types/DeepZoomImage/TileSize.hs
mit
1,921
0
10
337
522
284
238
50
1
{-# LANGUAGE RecordWildCards, OverloadedStrings, TupleSections #-} -- | Implements HTTP Basic Authentication. -- -- This module may add digest authentication in the future. module Network.Wai.Middleware.HttpAuth ( -- * Middleware basicAuth , CheckCreds , AuthSettings , authRealm , authOnNoAuth...
jberryman/wai
wai-extra/Network/Wai/Middleware/HttpAuth.hs
mit
3,714
0
14
977
678
384
294
74
4
module Arithmetik where -- Aufgabe 1.1 -- Berechnung der Potenz durch e-faches multiplizieren von b -- Benötigt e Rekursionsschritte pow1 :: Double -> Int -> Double pow1 b 0 = 1 pow1 b e = b * (pow1 b (e-1)) -- Aufgabe 1.2 -- Berechnung der Potenz pow2(b,e) = b^e -- Benötigt O(log_...
MartinThoma/LaTeX-examples
source-code/Minted-Haskell/Arithmetik.hs
mit
1,761
0
19
674
550
276
274
31
2
module SSH.Key.Derived (deriveKey) where import Argh (seed_keypair) import qualified Crypto.Hash.SHA256 as SHA256 import Data.ByteString (ByteString) import Data.Monoid ((<>)) import SSH.Key (PrivateKey(Ed25519PrivateKey), PublicKey(Ed25519PublicKey)) deriveKey :: ByteString ->...
mithrandi/ssh-key-generator
SSH/Key/Derived.hs
mit
623
0
9
126
161
96
65
12
1
module TutorialTest ( tutorialSpecs ) where import Import.Tutorial import Prelude import Test.Hspec tutorialSpecs :: Spec tutorialSpecs = do describe "Tutorial" $ do it "nests" $ do let nodes = [ TocNode "foo" "" 1 , TocNode "bar" "" 2 ...
fpco/schoolofhaskell.com
tests/TutorialTest.hs
mit
823
0
22
457
184
94
90
22
1
module SEP.Parser (parseUnstampedOrder) where import Text.ParserCombinators.Parsec import SEP.Data import Data.DateTime import Data.Text.Lazy (Text) import Text.Parsec.Prim type UnstampedOrder = DateTime -> ClientIdentifier -> Order unstampedOrderParser :: Parsec Text () UnstampedOrder unstampedOrderParser = do ...
mcapodici/haskelllearn
stockexchangeprototype/src/SEP/Parser.hs
mit
836
0
11
158
239
120
119
23
2
module Wobsurv.Util.WorkerThread where import BasePrelude hiding (fork) import Wobsurv.Util.MasterThread import Control.Concurrent.STM.TBQueue import Control.Monad.Trans.Class type WorkerThread = TBQueue (MT ()) new :: Int -> MT WorkerThread new size = do queue <- lift $ atomically $ newTBQueue size for...
nikita-volkov/wobsurv
library/Wobsurv/Util/WorkerThread.hs
mit
518
0
13
102
172
89
83
17
1
module Sampling where import Data.List import Data.Vector (Vector, (!)) import qualified Data.Vector as V import qualified Data.Vector.Mutable as M import qualified Data.Vector.Storable as SV import System.Random import Point maxSamples :: Int maxSamples =...
rabipelais/cloudpoint
src/Sampling.hs
mit
3,097
0
20
779
1,112
595
517
56
2
{-# LANGUAGE BlockArguments #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} module ZoomHub.Web.Page ( Page (..), layout, Title (..), Path (..), title, analyticsScript, ) where import Control.Monad (forM_) import Data.Text (Text) import quali...
zoomhub/zoomhub
src/ZoomHub/Web/Page.hs
mit
3,225
0
19
649
822
414
408
-1
-1
module Game.Moves where import Control.Lens ((%~), (&), (-~), (.~)) import Game.Types (Agent, BetState (..), Card (..), CardFace (..), CardKind (..), aBetState, aHand, aStack, hHasSkull, hNumPlains, stCards) playPlain :: Agent -> Age...
rubenmoor/skull
skull-server/src/Game/Moves.hs
mit
742
0
10
236
243
142
101
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} module NLP.Punkt.Match ( re_split_impl, re_split_pos, re_split, re_compile, word_seps, intrasep ) where import Data.Text (Text) import Data.Array ((!)) import "regex-tdfa-text" Text.Regex.TDFA.Text (compile) import "regex-t...
bryant/punkt
lib/NLP/Punkt/Match.hs
mit
1,695
0
15
412
610
332
278
37
4
import Control.Arrow main :: IO () main = interact $ lines >>> tail >>> head >>> words >>> reverse >>> unwords
Dobiasd/HackerRank-solutions
Data_Structures/Arrays/Arrays_DS/Main.hs
mit
111
0
10
21
45
23
22
3
1
-- Copyright (c) 2016-present, SoundCloud Ltd. -- All rights reserved. -- -- This source code is distributed under the terms of a MIT license, -- found in the LICENSE file. {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} module Kubern...
soundcloud/haskell-kubernetes
lib/Kubernetes/Model/V1/PodTemplateList.hs
mit
2,085
0
14
743
351
210
141
43
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Graphics.Urho3D.Core.Object( Object , SharedObject , objectContext , getSubsystem , Subsystem(..) , Event(..) , subscribeToEvent , subscribeToEventSpecific , unsubscribeFromEvent , unsubscribeFromEventSpecific , getContext ) where import qualified ...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Core/Object.hs
mit
6,881
0
14
1,233
1,534
806
728
-1
-1
import Control.Applicative((<*)) import Text.Parsec import Text.Parsec.String import Text.Parsec.Expr import Text.Parsec.Token import Text.Parsec.Language import Control.Applicative ((<$>)) data Expr = Var String | Con Bool | Uno Unop Expr | Duo Duop Expr Expr deriving Show data Unop = Not deriving Show data Duop =...
write-you-a-scheme-v2/scheme
archive/Parse2.hs
mit
5,039
0
14
1,932
1,595
795
800
136
2
-- making string literals polymorphic over the 'IsString' type class {-# LANGUAGE OverloadedStrings #-} module IG.LightstreamerApi where import Data.List (intercalate) import Lightstreamer -- To handle child threads import GHC.Conc.Sync (ThreadId) -- For creat...
peteryhwong/ig-haskell-client
src/IG/LightstreamerApi.hs
mit
6,423
0
11
1,390
1,241
677
564
103
1
module ARD.Vector where import Prelude hiding (length) class Vector a where -- | Multiply Vector by Scalar. mul :: a -> Double -> a -- | Divide Vector by Scalar. div :: a -> Double -> a -- | Length of Vector. length :: a -> Double -- | Squared length of Vector. lengthSquared :: a -> Double -- | Norm...
crazymaik/ard-haskell
lib/ARD/Vector.hs
mit
2,555
0
10
629
1,324
694
630
69
0
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI, CPP, EmptyDataDecls #-} module JavaScript.JQuery.Internal where import GHCJS.Types import GHCJS.DOM.Types (Element(..)) import GHCJS.Foreign import Control.Concurrent.MVar data JQuery_ data Event_ type JQuery = JSRef JQuery_ type Event = JSRef Event_ #ifdef gh...
adarqui/ghcjs-jquery
JavaScript/JQuery/Internal.hs
mit
15,518
65
9
6,026
2,770
1,488
1,282
-1
-1
module PuzzleSpec where import Parser import Puzzle import Test.Hspec {- make sure this works for: - square of size 3, mod 4 - square of size 4, mod 4 - hexagon of side length 4, mod 2 - hexagon of side length 6, mod 6 -} spec :: Spec spec = do describe "hexSplit" $ do specify "size = 4" $ ...
Javran/misc
gaussian-elim/test/PuzzleSpec.hs
mit
1,639
0
18
784
464
285
179
42
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- | -- Module: Network.Nats.Message.Writer -- Copyright: (c) 2016 Patrik Sandahl -- License: MIT -- Maintainer: Patrik Sandahl <patrik.sandahl@gmail.com> -- Stability: experime...
kosmoskatten/hats
src/Network/Nats/Message/Writer.hs
mit
7,078
0
15
1,843
1,534
796
738
106
1
-- Copyright (c) 2012, Diego Souza -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of condit...
dgvncsz0f/sssfs
src/SSSFS/Filesystem/Path.hs
gpl-3.0
1,943
0
6
355
112
75
37
11
1
module Bamboo.Theme.MiniHTML5 where import Bamboo.Type.ThemeInterface import Bamboo.Theme.MiniHTML5.Env hiding (Search) import Prelude () import qualified Bamboo.Theme.MiniHTML5.Control.Post as PostV import qualified Bamboo.Theme.MiniHTML5.Control.Search as SearchV import qualified Bamboo.Theme.MiniHTML5.Control.Stat...
nfjinjing/bamboo-theme-mini-html5
src/Bamboo/Theme/MiniHTML5.hs
gpl-3.0
918
6
10
172
267
157
110
19
7
module Main where import System.IO (hPutStrLn, stderr) import System.Environment (getArgs) import System.Exit (exitFailure) import Language.Whenever main :: IO () main = getArgs >>= \argv -> case argv of ["-?"] -> printUsage [f] -> runFile f [] -> getContents >>= runProgramIO . fromString _ -> pr...
mtolly/whenever
whenever.hs
gpl-3.0
622
0
11
133
155
86
69
17
4
#!/usr/bin/env runhaskell -- Jeffrey Lau -- 2011-08-18 {- - URL: http://www.pythonchallenge.com/pc/def/0.html -} main = do print $ pow 2 38 print $ 2 ^ 38 -- defining my own function since I didn't know about (^). -- ghci> :t (^) -- (^) :: (Num a, Integral b) => a -> b -> a) pow :: (Num a) => a -> a -> a pow n m...
zoonfafer/python-challenge-with-haskell
jlau/0.hs
gpl-3.0
407
0
9
106
122
64
58
7
2
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {- Copyright (C) 2009 Ivan Lazar Miljenovic <Ivan.Miljenovic@gmail.com> This file is part of SourceGraph. SourceGraph 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; ...
Baranowski/SourceGraph
Parsing/State.hs
gpl-3.0
2,683
0
9
631
331
186
145
39
1
module Amoeba.GameLogic.GameLogicAccessor where import Amoeba.GameLogic.Data.Facade as GL import Amoeba.GameLogic.Interpreter.Language as I import Amoeba.GameLogic.Runtime as Rt import qualified Amoeba.Middleware.Tracing.Log as Log import qualified Control.Concurrent.STM.TVar as STM import qualified Control.Concurren...
graninas/The-Amoeba-World
src/Amoeba/GameLogic/GameLogicAccessor.hs
gpl-3.0
1,893
0
14
319
454
243
211
31
1
{-# OPTIONS -fno-warn-incomplete-patterns #-} module Dict.Print where -- pretty-printer generated by the BNF converter import Dict.Abs import Char -- the top-level printing method printTree :: Print a => a -> String printTree = render . prt 0 type Doc = [ShowS] -> [ShowS] doc :: ShowS -> Doc doc = (:) render :: D...
isido/functional-morphology-for-koine-greek
lib/Dict/Print.hs
gpl-3.0
3,325
0
16
907
1,735
856
879
83
12
module Data.UUID.Utils ( fromSBS16, toSBS16 , combine, augment ) where import Control.Lens.Operators import Data.ByteString (ByteString) import qualified Data.ByteString as SBS import Data.ByteString.Utils (lazifyBS, strictifyBS) import Data.Maybe (fromMaybe) import ...
da-x/lamdu
bottlelib/Data/UUID/Utils.hs
gpl-3.0
830
0
11
189
226
130
96
22
1
{-# LANGUAGE FlexibleInstances #-} module Common where import qualified Data.Set as Set import Control.Concurrent import System.IO.Unsafe import System.IO import System.Environment type Pred = IO Bool type Act = IO () type Func = IO Value type Id = String type Var = String ...
frossi933/CSPi
haskell/Common.hs
gpl-3.0
3,316
0
13
1,287
1,236
654
582
77
1
{-# LANGUAGE OverloadedStrings #-} import Network.DNS import Network import Control.Monad import qualified Data.ByteString.Char8 as B import Control.Concurrent import Foreign.Marshal.Alloc import GHC.IO.Handle import System.Environment -- For ross's shitty non-pipelining server main = do [host, port] <- getArgs r...
robgssp/uvb
basic1.hs
gpl-3.0
883
0
15
147
296
146
150
26
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Monitoring.Types -- Copyright : (c) 2015-2016 Brendan ...
rueshyna/gogol
gogol-monitoring/gen/Network/Google/Monitoring/Types.hs
mpl-2.0
7,325
0
7
1,945
867
597
270
232
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 #-} -- ...
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListGroups.hs
mpl-2.0
6,927
0
14
1,547
1,000
594
406
111
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.CloudKMS -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Pub...
brendanhay/gogol
gogol-cloudkms/gen/Network/Google/CloudKMS.hs
mpl-2.0
20,101
0
37
3,173
1,922
1,454
468
369
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.DoubleClickSearch.Types -- Copyright : (c) 2015-2016 B...
brendanhay/gogol
gogol-doubleclick-search/gen/Network/Google/DoubleClickSearch/Types.hs
mpl-2.0
4,846
0
7
1,210
541
370
171
160
1
module SnowdriftEventHandler ( snowdriftEventHandlers ) where import Import import Model.Comment import Model.Discussion import Model.Notification import Model.Project import Model.User import Model.Utils import Data.Maybe (fromJust) import qualified Database.Persist import Yeso...
Happy0/snowdrift
SnowdriftEventHandler.hs
agpl-3.0
6,010
0
19
1,475
1,215
602
613
-1
-1
{-# LANGUAGE BangPatterns, InstanceSigs #-} module Data.Wavelet.Matrix where import Data.Wavelet import Data.Wavelet.Bulk import Data.Wavelet.Storage import Data.Wavelet.Auxiliary.RankBlocks (RankBlocks (..), createRankBlocks, loadRankBlocks) import qualified Data.Wa...
jahaynes/waveletto
src/Data/Wavelet/Matrix.hs
lgpl-3.0
13,208
0
20
4,533
3,392
1,753
1,639
233
4
module Main where import Graphics.UI.Gtk import Graphics.UI.Gtk.Builder import Control.Monad.IO.Class import Control.Concurrent import Control.Concurrent.MVar import System.Random (randomRIO) import Othello (startBoard, GameState (GS), Color (X,O), Move (Pass, Put), Board (Bo), winner, bestMoves, valOthello, prun...
santifa/haskellstuff
Stuff/Othello/OthelloGUI.hs
unlicense
9,060
2
20
3,178
2,592
1,309
1,283
194
5
{-# LANGUAGE ViewPatterns, UnicodeSyntax, ExistentialQuantification #-} module Parse where import Data.List (stripPrefix, splitAt) import Data.Maybe (catMaybes, listToMaybe) import Data.Char (isSpace) import Control.Monad (join, mplus) import Util import Language paragraphs ∷ [String] → [String] paragraphs [] = [] p...
cfr/burningbar
src/Parse.hs
unlicense
2,981
0
13
619
984
511
473
56
2
module Tables.A284530 (a284530, a284530_list) where import Tables.A284486 (a284486_list) import Data.List (elemIndices) a284530_list :: [Int] a284530_list = map (+1) $ elemIndices 1 a284486_list a284530 :: Int -> Int a284530 n = a284530_list !! (n - 1)
peterokagey/haskellOEIS
src/Tables/A284530.hs
apache-2.0
255
0
7
37
91
52
39
7
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -- import Text.JSON -- import Text.JSON.Generic import Network.HTTP (getResponseBody, getRequest, simpleHTTP, urlEncode) import Data.List (isInfixOf, or) import qualified Data.Text as T import Control.Exception import ...
hawkish/echonestclient
echonest.hs
apache-2.0
4,035
0
20
1,353
1,146
584
562
89
2
{-# OPTIONS -Wall #-} ---------------------------------------------------------------------- {- | Module : Data.ZoomCache.Format Copyright : Conrad Parker License : BSD3-style (see LICENSE) Maintainer : Conrad Parker <conrad@metadecks.org> Stability : unstable Portability : unknown ...
kfish/zoom-cache
Data/ZoomCache/Format.hs
bsd-2-clause
10,377
0
6
3,613
163
105
58
26
1
{-# LANGUAGE OverloadedStrings, TypeFamilies, PackageImports, FlexibleContexts #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module TestClient ( CertSecretKey, client, CipherSuite(..), KeyExchange(..), BulkEncryption(..), ValidateHandle(..) ) where import Network.PeyoTLS.Client import Control.Monad import "crypto-rando...
YoshikuniJujo/forest
subprojects/tls-analysis/server/TestClient.hs
bsd-3-clause
1,357
28
12
168
314
184
130
34
1
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.Column -- Description : Layout that places all windows in one column. -- Copyright : (c) 2009 Ilya Portnov -- License : BSD3-style (see LI...
xmonad/xmonad-contrib
XMonad/Layout/Column.hs
bsd-3-clause
2,685
0
12
687
540
302
238
26
2
{-| Module : Data.Relational.PostgreSQL Description : PostgreSQL-simple driver for Relational. Copyright : (c) Alexander Vieth, 2015 Licence : BSD3 Maintainer : aovieth@gmail.com Stability : experimental Portability : non-portable (GHC only) TODO import Database.PostgreSQL.Simple.Types to obtain the Quer...
avieth/RelationalPostgreSQL
Data/Relational/PostgreSQL.hs
bsd-3-clause
32,508
227
30
8,544
6,646
3,506
3,140
-1
-1
-- | This module keeps a persistent @bimap@ between @Text@s and @Int@s. module NLP.Text.BTI.Internal where import Data.ByteString.UTF8 import Data.IORef (newIORef,IORef,readIORef,atomicWriteIORef,atomicModifyIORef') import System.IO.Unsafe (unsafePerformIO,unsafeDupablePerformIO) import Data.Bijection.HashMap impor...
choener/LinguisticsTypes
NLP/Text/BTI/Internal.hs
bsd-3-clause
1,336
1
14
278
295
162
133
21
2
module Network.SPDY.NVH ( encodeNVH , decodeNVH ) where -- haskell platform import Control.Monad (liftM) import Data.Binary.Get (runGetOrFail) import Data.Binary.Put (runPut) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as L impo...
kolmodin/spdy
Network/SPDY/NVH.hs
bsd-3-clause
2,531
0
14
559
810
413
397
54
2
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Puzzle.EvaluationConfigGA where import Control.Monad (replicateM) import System.Random import Control.Lens import Control.Monad.Random import Data.Default i...
phaul/chess
Test/Puzzle/EvaluationConfigGA.hs
bsd-3-clause
3,759
0
22
1,045
939
506
433
81
1
module Main ( main ) where import Control.Lens ((&)) import Control.Monad (forever) import Control.Monad.Trans (liftIO) import Control.Monad.Trans.Either (EitherT (..)) import Data.Conduit (awaitForever, yield, ($...
Martoon-00/toy-compiler
launch/Main.hs
bsd-3-clause
2,524
0
17
895
662
365
297
-1
-1
module Main where import System.Environment -- | A type A = B -- | B -- TODO type B = C
hecrj/haskell-format
test/specs/comments/output.hs
bsd-3-clause
99
0
4
32
24
17
7
4
0
import qualified Zora.List as ZList import qualified Data.Char as Char valid_ns :: [Integer] valid_ns = filter (\n -> (n == (f n))) $ [1..] where f :: Integer -> Integer f = sum . map ((^) 5 . Char.digitToInt) . show main :: IO () main = do putStrLn . show $ take 3 valid_ns
bgwines/project-euler
src/solved/problem30.hs
bsd-3-clause
283
1
12
63
141
75
66
9
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-| Module : Numeric.AERN.RealArithmetic.Interval.Measures Description : distance and imprecision for intervals Copyright : (c) Michal Konecny License ...
michalkonecny/aern
aern-interval/src/Numeric/AERN/RealArithmetic/Interval/Measures.hs
bsd-3-clause
2,868
0
11
671
518
292
226
57
0
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module Oracles.ArgsHash (checkArgsHash, argsHashOracle) where import Base import Expression import Settings import Settings.Args import Target newtype ArgsHashKey = ArgsHashKey Target deriving (Show, Eq, Typeable, Binary, Hashable, NFData) -- This i...
quchen/shaking-up-ghc
src/Oracles/ArgsHash.hs
bsd-3-clause
1,476
0
12
252
218
118
100
18
1
{-# LANGUAGE NoOverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Main where import Data.List import Development.Shake -- import Development.Shake.FilePath import System.Directory import System.FilePath.Posix import System.IO.Temp version = "7.6.3-3.0a-20040418" aquaVer = "3.0a" aquaDmg ...
jwiegley/tryhaskell
Build.hs
bsd-3-clause
5,047
2
20
1,550
937
474
463
93
3
{- (c) The University of Glasgow, 2006 \section[HscTypes]{Types for the per-module compiler} -} {-# LANGUAGE CPP, ScopedTypeVariables #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE Flexi...
sdiehl/ghc
compiler/main/HscTypes.hs
bsd-3-clause
134,066
0
28
39,362
17,320
9,701
7,619
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Shell.Core ( Event(..) , UIUpdate(..) , shell ) where import Control.Applicative ((<$>)) import Control.Concurrent.STM (TChan, atomically, readTChan, writeTChan) impor...
yuttie/mash
Shell/Core.hs
bsd-3-clause
4,254
0
21
1,778
1,060
548
512
86
5
-- | Interface to the Futhark parser. module Language.Futhark.Parser ( parseFuthark , parseExp , parseType , parseLambda , parseValue , parseValues , parseExpIncr , parseExpIncrIO , ParseError (..) ) where import Control.Applicative import Control.Monad import Control.Monad.Trans.State import ...
mrakgr/futhark
src/Language/Futhark/Parser.hs
bsd-3-clause
6,812
0
14
1,560
1,603
852
751
127
2
module Hack2.Contrib.AirBackports where import Data.Time import System.Directory import System.IO -- import System.Locale (defaultTimeLocale) import qualified System.IO.Unsafe as Unsafe import Air.Env hiding (Default, def) import Prelude () import qualified Data.Text as T import qualified Data.Text.Encoding as E imp...
nfjinjing/hack2-contrib
src/Hack2/Contrib/AirBackports.hs
bsd-3-clause
961
0
7
141
255
149
106
-1
-1
module Stats(runW, n, nDjun, intervalWidth, groupSelection, realData) where import Graphics.Gloss import Graphics.Gloss.Data.ViewPort import Text.Printf import Data.List(sort) import Control.Arrow import System.Random import Control.Monad(replicateM) import Crypto.Random type Selection = [[Float]] type Inte...
AM636E/Statistics
src/Stats.hs
bsd-3-clause
7,548
0
17
2,113
3,443
1,898
1,545
145
1
module Settings ( getArgs, getLibraryWays, getRtsWays, flavour, knownPackages, findPackageByName, getPkgData, getPkgDataList, isLibrary, stagePackages, programContext, getIntegerPackage, getDestDir ) where import CommandLine import Expression import Flavour import {-# SOURCE #-} Settings.Default import...
ezyang/ghc
hadrian/src/Settings.hs
bsd-3-clause
2,289
0
12
395
503
276
227
50
2
-- | Demonstriert, wie man ein eta mit Hilfe von Lookup-Tables definiert. module Main where import qualified EFA.Example.Topology.LinearOne as LinearOne import EFA.Example.Topology.LinearOne (Node(Sink, Source)) import EFA.Application.Utility (quantityTopology) import qualified EFA.Flow.Topology.Absolute as EqSys i...
energyflowanalysis/efa-2.1
demo/lookupEta/Main.hs
bsd-3-clause
1,677
0
17
342
581
336
245
45
2
{-# LANGUAGE FlexibleInstances, ScopedTypeVariables, ForeignFunctionInterface #-} ----------------------------------------------------------------------------- -- | -- Module : Client -- Copyright : (c)2011, Texas Instruments France -- License : BSD-style (see the file LICENSE) -- -- Maintainer : c-fav...
ChristopheF/OpenCLTestFramework
Client/client.hs
bsd-3-clause
2,039
0
13
405
480
264
216
34
2
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE ScopedTypeVariables #-} module Hadoom.BSP (BSP(..), buildBSP, circleIntersects) where import BasePrelude hiding (left, lefts, right, rights, lines) import Hadoom.Geometry import Linear import Linear.Affine import Data.List.NonEmpty (NonEmpty(..)) -- | A binary space partition ...
ocharles/hadoom
hadoom/Hadoom/BSP.hs
bsd-3-clause
3,652
0
22
1,288
1,105
571
534
85
10
{-| Event Types and Noun Conversion -} module Urbit.Arvo.Event where import Urbit.Noun.Tree (HoonMap, HoonSet) import Urbit.Prelude hiding (Term) import Urbit.Arvo.Common (KingId(..), ServId(..)) import Urbit.Arvo.Common (Desk, Mime) import Urbit.Arvo.Common (Header(..), HttpEvent) import Urbit.Arvo.Common (Ame...
jfranklin9000/urbit
pkg/hs/urbit-king/lib/Urbit/Arvo/Event.hs
mit
10,363
0
16
2,526
2,977
1,602
1,375
-1
-1
{-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE CPP #-} -- | Support for using GLFW as the window manager backend. module Graphics.Gloss.Internals.Interface.Backend.GLFW (GLFWState) where import Data.IORef import Data.Char (toLower) import Control.Monad import Graphics.Gloss.Data.Display im...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss/Graphics/Gloss/Internals/Interface/Backend/GLFW.hs
mit
20,879
0
32
6,504
4,259
2,134
2,125
386
24
-- -- -- ---------------- -- Exercise 6.3. ---------------- -- -- -- module E'6''3 where -- shift :: ((Integer, Integer), Integer) -> (Integer, (Integer, Integer)) shift ( ( x , y ) , z ) = ( x , ( y , z ) ) -- shift :: ((a, b), c) -> (a, (b, c)) -- GHCi> :t shift -- shift :: ((t, t1), t2) -> (t, (t1, t2)) ...
pascal-knodel/haskell-craft
_/links/E'6''3.hs
mit
323
0
7
83
49
36
13
3
1
{- | Module : ./Propositional/ProveWithTruthTable.hs Description : Provers for propositional logic Copyright : (c) Till Mossakowski, Uni Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : till@informatik.uni-bremen.de Stability : experimental Portability : portable A truth table ...
spechub/Hets
Propositional/ProveWithTruthTable.hs
gpl-2.0
17,192
0
25
5,567
4,159
2,213
1,946
326
10
-- -- Benchmark code: sample request using http-streams -- -- Copyright © 2012-2014 Operational Dynamics Consulting, Pty Ltd -- -- The code in this file, and the program it is a part of, is made -- available to you by its authors as open source software: you can -- redistribute it and/or modify it under a BSD licence. ...
laurencer/confluence-sync
vendor/http-streams/tests/StreamsSample.hs
bsd-3-clause
1,216
0
20
282
240
131
109
26
1
module MatrixList ( MatrixList , mEntryCol , mEntryRow , mEntryVal , MListEntry , mListEntries , mListHeight , mListWidth ) where type MListEntry a = (Int, Int, a) type MatrixList a = (Int, Int, [MListEntry a]) -- matrix height, width, and list of entries (row, column, value) ; -- including zero-value entries is opti...
FreeON/spammpack
src-Haskell/MatrixList.hs
bsd-3-clause
700
0
7
134
250
146
104
23
1
----------------------------------------------------------------------------- -- | -- License : BSD-3-Clause -- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi> -- module GitHub.Data.Email where import GitHub.Internal.Prelude import Prelude () import qualified Data.Text as T data EmailVisibility = EmailVis...
jwiegley/github
src/GitHub/Data/Email.hs
bsd-3-clause
1,280
0
15
283
315
169
146
37
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} -- | Parsing command line targets module Stack.Build.Target ( --...
meiersi-11ce/stack
src/Stack/Build/Target.hs
bsd-3-clause
13,121
0
21
4,825
3,188
1,684
1,504
284
12
module SDL.Raw.Event ( -- * Event Handling addEventWatch, delEventWatch, eventState, filterEvents, flushEvent, flushEvents, getEventFilter, getNumTouchDevices, getNumTouchFingers, getTouchDevice, getTouchFinger, hasEvent, hasEvents, loadDollarTemplates, peepEvents, pollEvent, pumpEve...
bj4rtmar/sdl2
src/SDL/Raw/Event.hs
bsd-3-clause
27,265
0
12
3,834
6,460
3,260
3,200
524
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE DeriveGeneric, NoImplicitPrelude, MagicHash, ExistentialQuantification, ImplicitParams #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : G...
siddhanathan/ghc
libraries/base/GHC/IO/Exception.hs
bsd-3-clause
12,471
0
17
2,787
1,863
1,040
823
212
2
module Range () where import Control.Applicative import Language.Haskell.Liquid.Prelude goo x = [] poo (x:_) = True poo ([]) = liquidAssertB False xs = goo (choose 0) prop1 = liquidAssertB (poo xs)
mightymoose/liquidhaskell
tests/neg/meas0.hs
bsd-3-clause
204
0
7
37
88
48
40
8
1
module Tests.PutStr where runTest :: IO () runTest = do mapM_ putStr $ words "this is a list of words without spaces" mapM_ putStrLn $ words "and this is a list of words WITH spaces" putStrLn $ unlines $ words "finally, words with newlines"
joelburget/haste-compiler
Tests/PutStr.hs
bsd-3-clause
248
0
8
51
61
28
33
6
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} module T13393 ( ) where import Control.Monad.Trans.RWS.St...
ezyang/ghc
testsuite/tests/polykinds/T13393.hs
bsd-3-clause
2,014
0
13
397
629
358
271
-1
-1
{-# LANGUAGE PartialTypeSignatures #-} module WildcardInNewtype where -- Currently handled by the same checks as for ADTs, but in case this -- changes in the future, add at least one test. newtype Foo a = Foo (Either _ a)
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/partial-sigs/should_fail/WildcardInNewtype.hs
bsd-3-clause
224
0
7
41
24
16
8
3
0
{-# LANGUAGE MagicHash #-} module Main where import Language.Haskell.TH import GHC.Prim(Addr#) import GHC.Ptr import Foreign.Marshal.Array (peekArray) import Data.Word (Word8) check_equal :: [Word8] -> Addr# -> IO () check_equal bytes addr = do bytes' <- peekArray (length bytes) (Ptr addr) print (bytes == bytes')...
urbanslug/ghc
testsuite/tests/th/TH_StringPrimL.hs
bsd-3-clause
499
0
13
89
192
100
92
16
1
{-# OPTIONS -XRecursiveDo #-} -- shadowing is not allowed module Main (main) where import Control.Monad.Fix t :: IO () t = mdo x <- return 1 x <- return 2 return () main :: IO () main = t
sdiehl/ghc
testsuite/tests/mdo/should_fail/mdofail002.hs
bsd-3-clause
211
0
8
62
75
39
36
-1
-1
module Data.ByteString.Extended ( module Data.ByteString , constTimeCompare ) where import Data.Bits import Data.ByteString import qualified Data.List as L import Prelude hiding (length, zip, zipWith) constTimeCompare :: ByteString -> ByteString -> Bool constTimeCompa...
juretta/haskell-jwt
src/Data/ByteString/Extended.hs
mit
435
0
11
118
135
75
60
10
1
{-# LANGUAGE BangPatterns #-} -- TODO: Add some comments describing how this implementation works. -- | A reimplementation of Data.WordMap that seems to be 1.4-4x faster. module Data.WordSet.Internal where import Control.DeepSeq import qualified Data.List as List import Data.Word (Word) import Data.Bits import Da...
gereeter/bounded-intmap
src/Data/WordSet/Internal.hs
mit
23,071
0
16
7,533
6,340
3,129
3,211
340
26
--{-# LANGUAGE AllowAmbiguousTypes #-} module Handler.BlogPost where import Import import Helper import Yesod.Text.Markdown import Yesod.Form.Bootstrap3 isAdmin :: Handler Bool isAdmin = do mauth <- maybeAuth return $ maybe False (userAdmin . entityVal) mauth getBlogPostWithTags :: BlogPostId -> Handler (Blo...
ruHaskell/ruhaskell-yesod
Handler/BlogPost.hs
mit
5,285
0
19
1,223
1,582
769
813
-1
-1
module Gauges.API.Requestable ( Requestable(..), Fetchable(..) ) where import Data.List (intercalate) class Requestable a where pathParts :: a -> [String] path :: a -> String path = intercalate "/" . pathParts class (Requestable a) => Fetchable a where query :: a -> ...
jrwest/hs-gauges
Gauges/API/Requestable.hs
mit
461
0
11
132
161
90
71
13
0
module Handler.Admin where import Application.Types import Control.Applicative import Control.Concurrent.STM import Handler.Instances (getAllKeys) import qualified Data.Text as T import Data.Time.Format (formatTime) import System.Locale (defaultT...
kRITZCREEK/FROST-Backend
src/Handler/Admin.hs
mit
2,328
0
15
503
501
262
239
-1
-1
import System.Random import System.Environment main :: IO () main = do args <- getArgs let maxv = case length args of 1 -> read $ head args :: Integer _ -> 100 nr <- randomRIO (0,maxv-1) print nr
fizzoo/miniprojekt
rng/rng.hs
mit
248
0
14
90
97
47
50
9
2
-- PutJSON.hs module PutJSON where import Data.List (intercalate) import Data.Char (toLower) import SimpleJSON renderJValue :: JValue -> String renderJValue (JString s) = show s renderJValue (JNumber n) = show n -- renderJValue (JBool x) = serialize_bool $ show x -- where serialize_bool (y:ys) = toLower y : ys --...
gitrookie/functionalcode
code/Haskell/jsonparser/PutJSON.hs
mit
845
0
9
187
283
144
139
19
3
module Parser.Internal where import Constants import Data.List (isSuffixOf) import Deployer.Types import Language.Types import Text.Parsec import Text.Parsec.String import Types parseCardFile :: FilePath -> String -> Either ParseError Spa...
badi/super-user-spark
src/Parser/Internal.hs
mit
6,879
0
15
1,532
1,916
935
981
207
2
module Main where import Criterion.Main import Network.HostAndPort main :: IO () main = defaultMain [ bgroup "ipv4" [ bench "127.0.0.1" $ whnf isIPv4Address "127.0.0.1" , bench "bad" $ whnf isIPv4Address "22222.2222.222.22"] , bgroup "ipv6" [ bench "::1" $ whnf isIPv6Address "::1...
bacher09/hostandport
benchmarks/Benchmark.hs
mit
957
0
10
308
206
100
106
15
1
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} module Rdioh.Util where import qualified Data.URLEncoded as UE import qualified Data.List.Utils as U import Rdioh.Models -- | used internally to convert a list of parameters to a string that can be passed via GET/POST toParams :: [(String, String)] -> String toP...
egonSchiele/rdioh
src/Rdioh/Util.hs
mit
2,482
0
9
461
375
223
152
31
1
-- | Provides a type class for pretty printing. module Language.TaPL.ShowPretty (ShowPretty, showp) where -- | Pretty printing type class. class ShowPretty a where -- | Converts an instance of ShowPretty into a pretty string. showp :: a -> String
zeckalpha/TaPL
src/Language/TaPL/ShowPretty.hs
mit
257
0
7
50
36
22
14
3
0
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Betfair.StreamingAPI.API.ResponseException ( ResponseException(..) ) where import Protolude import Text.PrettyPrint.GenericPretty -- import Betfair.StreamingAPI.API.R...
joe9/streaming-betfair-api
src/Betfair/StreamingAPI/API/ResponseException.hs
mit
539
0
8
94
95
58
37
16
0
module ProofNumberSearch where import qualified Move import qualified BitBoard import qualified Piece import qualified Util import qualified Tree import Data.Ord import Data.List import qualified MoveGenerator data NodeType = Or | And deriving Show data ProofResult = BlackWin | WhiteWin | Draw | None deriving Show ...
ysnrkdm/Hamlet
src/ProofNumberSearch.hs
mit
5,146
0
14
1,130
1,741
912
829
86
6
module Sync.MerkleTree.Sync ( child, local, parent, openStreams, StreamPair (..), Direction (..), ) where import Control.Concurrent.MVar import Control.Monad import Control.Monad.State import Data.ByteString (ByteString) import Data.Bytes.Serial (Serial) import qualified Data.Text as T import S...
ekarayel/sync-mht
src/Sync/MerkleTree/Sync.hs
mit
4,271
0
14
931
1,257
643
614
-1
-1
module Lab4 where ------------------------------------------------------------------------------------------------------------------------------ -- RECURSIVE FUNCTIONS ------------------------------------------------------------------------------------------------------------------------------ import Data.Char -- ==...
anwb/fp-one-on-one
lab-04.hs
mit
2,178
0
13
470
909
547
362
31
3
{-# LANGUAGE BangPatterns #-} module Render ( renderObjects, renderGun, renderHud, GameData(..) ) where import MD3 import Object import Graphics.Rendering.OpenGL hiding (vertex, rotate) import qualified Graphics.Rendering.OpenGL as GRO import Data.IORef import Data.Maybe import Camera import Matrix im...
elitak/frag
src/Render.hs
gpl-2.0
12,626
0
32
5,200
3,580
1,803
1,777
-1
-1