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
{-# LANGUAGE FlexibleContexts #-} module Exp.Roll where import Autolib.Exp import Autolib.NFA import Autolib.Exp.Some import Exp.Property roll :: NFAC c Int => [ Property c ] -> IO ( RX c, NFA c Int ) roll props = do let [ alpha ] = do Alphabet alpha <- props ; return alpha let [ s ] = do Max...
marcellussiegburg/autotool
collection/src/Exp/Roll.hs
gpl-2.0
389
0
13
108
154
77
77
13
1
-- The error screen, showing a current error condition (such as a parse error after reloading the journal) {-# LANGUAGE OverloadedStrings, FlexibleContexts, RecordWildCards #-} module Hledger.UI.ErrorScreen (errorScreen ,uiCheckBalanceAssertions ,uiReloadJournal ,uiReloadJournalIfChanged ) where import Brick --...
ony/hledger
hledger-ui/Hledger/UI/ErrorScreen.hs
gpl-3.0
6,585
0
22
1,660
1,668
890
778
112
10
-- This file is part of seismic_repa. -- -- seismic_repa is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- seismic_repa is...
agremm/Seismic
repa/Main.hs
gpl-3.0
1,486
0
12
280
236
121
115
21
2
module SequenceSpec(main,spec) where import Test.Hspec import qualified Data.Sequence as S import Data.Sequence ( ViewL((:<)), ViewR ((:>)) ) main :: IO () main = hspec spec exampleSeq :: S.Seq Int exampleSeq = S.fromList [1..10] spec :: Spec spec = describe "A Sequence" $ do it "can be queried for the left head"...
svenkeidel/gnome-citadel
test/SequenceSpec.hs
gpl-3.0
484
0
15
108
186
100
86
16
1
{-# LANGUAGE NoImplicitPrelude, CPP, RecordWildCards #-} module Graphics.UI.Bottle.MainLoop ( AnimConfig (..) , mainLoopAnim , mainLoopImage , mainLoopWidget ) where import Prelude.Compat import Control.Concurrent (ThreadId, threadDelay, killThread, myThreadId) import ...
rvion/lamdu
bottlelib/Graphics/UI/Bottle/MainLoop.hs
gpl-3.0
13,867
0
23
4,493
3,210
1,668
1,542
-1
-1
{-# LANGUAGE NoMonomorphismRestriction#-} {-# LANGUAGE NoImplicitPrelude #-} module Bamboo.Helper where import Bamboo.Helper.ByteString import Bamboo.Helper.PreludeEnv hiding (at) import Bamboo.Helper.Translation import Bamboo.Type import Bamboo.Type.Reader import Bamboo.Type.StaticWidget hiding (name, body, reader) ...
nfjinjing/bamboo
src/Bamboo/Helper.hs
gpl-3.0
11,030
16
34
3,759
3,708
1,921
1,787
-1
-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/Instances/ResetSSLConfig.hs
mpl-2.0
5,404
0
19
1,255
786
458
328
117
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.AndroidPublisher.Types.Sum -- Copyright : (c) 2015-201...
rueshyna/gogol
gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Sum.hs
mpl-2.0
18,599
0
11
4,108
3,158
1,648
1,510
395
0
{-# LANGUAGE TemplateHaskell #-} module HQueries.TH( deriveQType , deriveQKey , makeQLenses ) where import Language.Haskell.TH import HQueries.Internal import Data.Text (Text) import qualified Data.Text as T import qualified Data.String.Utils as SU import Data.Maybe import Control.Lens con2ArgTypes :: ...
premium-minds/h-queries
HQueries/TH.hs
lgpl-3.0
5,387
0
19
1,887
1,878
978
900
125
2
{-# LANGUAGE CPP,NamedFieldPuns, RecordWildCards #-} -- #define RCS_DEBUG module StearnsWharf.Steel.HatProfiles where import StearnsWharf.Common (BeamTypeId) import qualified StearnsWharf.Profiles as P import qualified StearnsWharf.Steel.HUP as H import qualified StearnsWharf.Steel.Plates as Pl data HatProfile ...
baalbek/stearnswharf
src/StearnsWharf/Steel/HatProfiles.hs
lgpl-3.0
4,526
0
14
1,605
1,376
740
636
84
1
-- http://blog.tmorris.net/posts/20-intermediate-haskell-exercises/index.html class Fluffy f where furry :: (a -> b) -> f a -> f b -- Exercise 1 -- Relative Difficulty: 1 instance Fluffy [] where furry = map -- Exercise 2 -- Relative Difficulty: 1 instance Fluffy Maybe where furry _ Nothing = Nothing furry f...
jstolarek/sandbox
haskell/20.intermediate.haskell.exercises.hs
unlicense
3,535
0
15
867
1,486
777
709
64
1
{-# LANGUAGE OverloadedStrings #-} module CountdownGame.State ( State (..) , Round (..) , initState , setAttempt , takeSnapshot , initialCompletions , completions )where import Data.Text (Text, pack) import qualified Data.Map.Strict as M import Countdown.Game (...
CarstenKoenig/DOS2015
CountdownGame/src/web/CountdownGame/State.hs
unlicense
2,097
0
20
457
761
396
365
55
2
{-# LANGUAGE PolyKinds #-} module Data.Container.Type where import Prelude --type family In (a :: a) (cont :: c) :: Bool --type instance In a '[] = False --type instance In a '[] = False type family In a lst where In a (a ': ls) = True In a (l ': ls) = In a ls In a '[] = False
wdanilo/container
src/Data/Container/Type.hs
apache-2.0
300
0
8
83
79
46
33
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Refile where import Control.Applicative import qualified Data.Text as T import System.Directory import System.FilePath import Data.RDF import Util import Import fileByDate :: FilePath -> FilePath -> IO () fileByDate directoryRoot f = do putStrLn f tris <- readFileMet...
bergey/metastic
src/Refile.hs
bsd-2-clause
904
0
21
207
303
150
153
26
3
{-| Module : Idris.Core.Evaluate Description : Evaluate Idris expressions. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE BangPatterns, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module...
bravit/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
54,891
0
27
19,907
19,129
9,789
9,340
961
80
{- | Module : Distribution.NixOS.Derivation.Meta License : BSD3 Maintainer : nix-dev@cs.uu.nl Stability : provisional Portability : portable A representation of the @meta@ section used in Nix expressions. A detailed description can be found in section 4, \"Meta-attributes\", o...
shlevy/nixos-types
src/Distribution/NixOS/Derivation/Meta.hs
bsd-3-clause
2,440
0
21
533
372
210
162
28
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module PeerTrader.Database where import Control.Monad.Logger import ...
WraithM/peertrader-backend
src/PeerTrader/Database.hs
bsd-3-clause
2,592
0
13
737
775
403
372
62
1
module Main where import Test.Tasty import Test.Tasty.Runners.Html import AgentsetBuilding -- import Interaction -- import RandomOrderInitialization import Agentsets -- import Layouts -- import Repeat import AnyAll -- import Let -- import ReporterTasks import Ask -- import Links -- import ResizeWorld import...
bezirg/hlogo
tests/unit.hs
bsd-3-clause
4,110
0
10
1,095
252
177
75
27
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Prelude hiding (readFile, drop) import Control.Monad import Control.Monad.IO.Class import Control.Exception import Foreign.C.Types import System.Random import Numeric.LinearAlgebra import Numeric.LinearAlgebra.Data import SDL import Debug.Trace import qualif...
Catchouli/neuron
src/Main.hs
bsd-3-clause
8,402
0
19
1,926
2,245
1,148
1,097
140
3
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 \section[TyCoRep]{Type and Coercion - friends' interface} Note [The Type-related module hierarchy] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Class CoAxiom TyCon imports Class, CoAxiom TyCoRep imports Class, CoAxiom, T...
vTurbine/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
128,802
20
20
31,433
19,652
10,432
9,220
-1
-1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveFunctor, TypeSynonymInstances, PatternGuards, CPP #-} module Idris.AbsSyntaxTree where import Core.TT import Core.Evaluate import Core.Elaborate hiding (Tactic(..)) import Core.Typecheck import IRTS.Lang import IRTS.CodegenCommon import Util.Pr...
christiaanb/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
45,732
0
19
16,719
16,086
8,291
7,795
975
61
module Helpers ( isSubsetOf , none , remove , unions , andThen , return , guard ) where import Prelude hiding (return) import Data.Set (Set) import qualified Data.Set as Set -- |Checks whether a set is a subset of the other set. isSubsetOf :: Ord a => Set a -> Set a -> Bool isSubsetOf first second = ...
jakubriha/automata
src/Helpers.hs
bsd-3-clause
1,002
0
10
227
374
195
179
32
1
{-| Module : Reactive.DOM.Widget.Common Description : Various useful widgets Copyright : (c) Alexander Vieth, 2016 Licence : BSD3 Maintainer : aovieth@gmail.com Stability : experimental Portability : non-portable (GHC only) -} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE Ran...
avieth/reactive-dom
Reactive/DOM/Widget/Common.hs
bsd-3-clause
3,635
0
19
692
1,174
616
558
71
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} module Servant.API.ResponseHeadersSpec where import Test.Hspec import Servant.API.Header import Servant.API.ResponseHeaders spec :: Spec spec = describe "Servant.API.ResponseHeaders" $ do describe "addHeader" $ do it "adds a header to a value" $ do...
zerobuzz/servant
servant/test/Servant/API/ResponseHeadersSpec.hs
bsd-3-clause
975
0
20
217
321
160
161
22
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} module Language.KansasLava.Signal.Utils ( splitByte , debounce , nary , divideClk , counter , rotatorL , fromUnsigned , toUnsigned , parity , whenEnabled ) where import Langua...
gergoerdi/kansas-lava-papilio
src/Language/KansasLava/Signal/Utils.hs
bsd-3-clause
2,818
0
19
794
1,173
596
577
63
1
module UU.UUAGC (uuagc, uuagcMain, compile, module Options) where import Ag (uuagcLib, uuagcExe, compile) import Options import System.Exit (ExitCode(..)) uuagc :: [String] -> FilePath -> IO (ExitCode, [FilePath]) uuagc = uuagcLib uuagcMain :: IO () uuagcMain = uuagcExe
norm2782/uuagc
src/UU/UUAGC.hs
bsd-3-clause
274
0
9
40
100
61
39
8
1
{-# LANGUAGE OverloadedStrings #-} module VForth.LocationSpec where import qualified Data.Text as T import Data.Text.Arbitrary import TextShow import Data.Char(isSpace) import Test.Hspec import Test.QuickCheck import VForth newtype TestableLocation = TestableLocation Location instance Arbitrary TestableLocation wher...
budgefeeney/ventureforth
chap4/test/VForth/LocationSpec.hs
bsd-3-clause
1,438
0
18
284
397
208
189
32
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE GADTs #-} module Test.IO.Tinfoil.Signing.Ed25519.Internal where import Data.ByteString (ByteString) import qualified Data.ByteString as BS import qualified Data.Text as T import Diso...
ambiata/tinfoil
test/Test/IO/Tinfoil/Signing/Ed25519/Internal.hs
bsd-3-clause
1,392
0
15
303
372
208
164
36
2
{-# LANGUAGE FlexibleInstances, GADTs, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Matrix.ReflectorBase -- Copyright : Copyright (c) , Patrick Perry <patperry@stanford.edu> -- License : BSD3 -- Maintainer : Patrick Perry <patperry...
patperry/lapack
lib/Data/Matrix/ReflectorBase.hs
bsd-3-clause
7,812
0
15
1,934
2,082
1,089
993
154
1
{-# LANGUAGE BangPatterns, CPP, MultiParamTypeClasses, TypeFamilies, FlexibleContexts #-} #if __GLASGOW_HASKELL__ >= 707 {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} #endif {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.Vector.Unboxed.Base -- Copyright : (c) Roman Leshchinskiy 2009-2010 -- Licens...
sergv/vector
Data/Vector/Unboxed/Base.hs
bsd-3-clause
14,519
0
9
3,602
3,335
1,767
1,568
-1
-1
module Database.HypherGraph.Utils ( stats ) where -- stats :: IO Int stats = undefined
tolysz/hypergraph-store
src/Database/HypherGraph/Utils.hs
bsd-3-clause
93
0
4
20
18
12
6
3
1
import Computation import Control.Applicative import Control.Monad import Data.Char import Implementation.Cryptodev import Parser import PPrint import SuiteB import System.Environment import System.Exit import System.IO import Test.AES import Transducer main = getArgs >>= mapM_ (runAndReport . checkRoundtrip) runAndRe...
GaloisInc/hacrypto
calf/bin/Main.hs
bsd-3-clause
1,883
9
11
307
702
350
352
48
2
{-# LANGUAGE PatternGuards, ViewPatterns, NamedFieldPuns #-} module Converter ( convert ) where import Parse import Smart (TaskChan, restart, interp) import Result (hasError) import Html import Lang import Args import Hash import qualified Language.Haskell.Exts.Pretty as HPty import qualified Language.Haske...
pgj/ActiveHs
Converter.hs
bsd-3-clause
9,925
0
23
3,164
3,075
1,604
1,471
201
15
import XMonad import XMonad.Hooks.DynamicLog (dynamicLogWithPP, xmobarPP, ppOutput, ppCurrent, ppVisible, ppHidden, ppHiddenNoWindows, ppTitle, ppLayout, ppSep, ppOrder, ppExtras, xmobarColor, wrap, shorten, xmobar) import XMonad.Actions.SpawnOn import XMonad.Layout.NoBorders (smartBorders) import XMonad.Layout.Named i...
mark-i-m/dotfilesvm
wm/.xmonad/xmonad.hs
mit
6,631
12
18
1,784
2,034
1,131
903
136
6
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Coinbase.Exchange.Private ( getAccountList , getAccount , getAccountLedger , getAccountHolds , createOrder , cancelOrder , cancelAllOrders , getOrderList , ge...
AndrewRademacher/coinbase-exchange
src/Coinbase/Exchange/Private.hs
mit
4,477
0
14
1,013
1,208
633
575
82
3
{-# OPTIONS -fglasgow-exts #-} module Baum.RedBlack ( make_quiz ) where -- $Id$ import Baum.RedBlack.Type import Baum.RedBlack.Ops import Baum.RedBlack.Show import qualified Baum.Such.Class as C import qualified Baum.Such.Central import qualified Tree as T import Autolib.ToDoc import Inter.Types import Data.Typ...
florianpilz/autotool
src/Baum/RedBlack.hs
gpl-2.0
914
0
7
160
231
135
96
-1
-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-cloudwatch/gen/Network/AWS/CloudWatch/ListMetrics.hs
mpl-2.0
5,778
0
16
1,339
1,002
584
418
113
1
module GameServer.Clients.Messages where import Data.Aeson import Data.Text (Text) import GameServer.Utils import GHC.Generics import GHC.Natural data Message = ListGames | NewGame { numHumans :: Natural, numRobots :: Natural } | JoinGame { playerKey :: Id, gameId :: Id } | Action { payload :: Text } | Bye ...
abailly/hsgames
game-server/src/GameServer/Clients/Messages.hs
apache-2.0
1,068
0
9
230
325
195
130
-1
-1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : Qtc.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:01:40 Warning : this file is machine generated - do not modif...
uduki/hsQt
Qtc.hs
bsd-2-clause
661
0
5
126
76
50
26
14
0
-- The @FamInst@ type: family instance heads {-# LANGUAGE GADTs, CPP #-} module ETA.TypeCheck.FamInst ( FamInstEnvs, tcGetFamInstEnvs, checkFamInstConsistency, tcExtendLocalFamInstEnv, tcLookupFamInst, tcLookupDataFamInst, tcLookupDataFamInst_maybe, tcInstNewTyCon_maybe, tcTopN...
pparkkin/eta
compiler/ETA/TypeCheck/FamInst.hs
bsd-3-clause
16,102
0
14
4,693
2,591
1,383
1,208
209
3
{-# LANGUAGE TemplateHaskell #-} module Bead.View.Translation.Entries where import Bead.View.Translation.Base $(generateTranslationEntries labels)
pgj/bead
src/Bead/View/Translation/Entries.hs
bsd-3-clause
149
0
7
13
26
16
10
4
0
module NestedImporting2.A where import Prelude r :: Double r = 1
beni55/fay
tests/NestedImporting2/A.hs
bsd-3-clause
67
0
4
13
19
12
7
4
1
{-# LANGUAGE ForeignFunctionInterface #-} module Test.TestFormat where import Data.Time import Data.Time.Clock.POSIX import Data.Char import Foreign import Foreign.C import Control.Exception; import Test.TestUtil {- size_t format_time ( char *s, size_t maxsize, const char *format, int isdst,int gmtoff,time_t t);...
bergmark/time
test/Test/TestFormat.hs
bsd-3-clause
6,668
16
22
1,251
2,341
1,201
1,140
133
4
{-# LANGUAGE OverloadedStrings #-} {-| Parser for the output of the @xm list --long@ command of Xen -} {- Copyright (C) 2013 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributi...
leshchevds/ganeti
src/Ganeti/Hypervisor/Xen/XmParser.hs
bsd-2-clause
6,612
0
16
1,342
1,170
615
555
95
7
module Constructor where -- Should be able to rename AType to MyType, as they are in different name -- spaces data MyType = AType Int | YourType Bool foo :: MyType -> Bool foo (AType i) = i > 0 foo (YourType b) = b
RefactoringTools/HaRe
test/testdata/Renaming/Constructor.hs
bsd-3-clause
219
0
7
49
61
34
27
5
1
{-# LANGUAGE MultiParamTypeClasses, GADTs, RankNTypes, ConstraintKinds, QuantifiedConstraints, UndecidableInstances #-} module T15359a where class C a b class a ~ b => D a b data Dict c where Dict :: c => Dict c foo :: (forall a b. C a b => D a b) => Dict (C a b) -> a -> b foo Dict x = x...
sdiehl/ghc
testsuite/tests/quantified-constraints/T15359a.hs
bsd-3-clause
321
0
9
92
110
57
53
-1
-1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ConstraintKinds #-} module T4175 where import GHC.Exts type family A a b type instance A Int Int = () type instance A (Maybe a) a = a type instance A (B a) b = () data family B a data instance B () = MkB class C a where type D a b instance C Int where type D Int (...
urbanslug/ghc
testsuite/tests/ghci/scripts/T4175.hs
bsd-3-clause
526
0
8
145
231
127
104
-1
-1
{-# LANGUAGE GADTs, DataKinds, KindSignatures, FlexibleInstances #-} module T8537 where import Data.Functor data Nat = S !Nat | Z infixr 3 :* data Shape (rank :: Nat) a where Nil :: Shape Z a (:*) :: !(a) -> !(Shape r a ) -> Shape (S r) a instance Functor (Shape Z) where fmap = \ f Nil -> Nil ...
siddhanathan/ghc
testsuite/tests/simplCore/should_compile/T8537.hs
bsd-3-clause
422
0
10
110
116
67
49
17
0
{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude, FlexibleContexts #-} {-# OPTIONS_GHC -Wall #-} module LLVM.General.Util.Internal.Diagnostic ( LLVMError(..), llvmErrorFunctionName, llvmErrorString, errorToIO, diagToIO, catchInternal, catchCaller, catchCallerError, catchCallerDiag, module LLVM.General.Dia...
dfoxfranke/llvm-general-util
LLVM/General/Util/Internal/Diagnostic.hs
mit
3,552
0
14
1,008
1,139
576
563
88
3
{-# LANGUAGE OverloadedStrings #-} module Guguk.Phonetics where import qualified Data.Text as T import qualified Data.List as L type IPASymbol = T.Text type SurfaceForm = T.Text -- Vowel types data VowelOpenness = Close | NearClose | CloseMid | Mid | OpenMid | NearOpen | Open...
joom/Guguk
src/Guguk/Phonetics.hs
mit
6,769
0
9
1,743
1,766
930
836
115
1
module Nauva.View.Terms.Generator (main) where import Data.List (sort, nub) import Data.Char (toUpper) sanitize :: String -> String sanitize str = removeDash str ++ "_" where removeDash ('-' : x : xs) = toUpper x : removeDash xs removeDash (x : xs) = x : removeDash xs removeDash [] = ...
wereHamster/nauva
pkg/hs/nauva/src/Nauva/View/Terms.Generator.hs
mit
3,080
0
14
1,026
801
456
345
121
3
{-# LANGUAGE OverloadedStrings, RankNTypes, FlexibleContexts #-} module FTag (module FTag.Data, module FTag) where import Database.Persist import Database.Persist.Sqlite import Data.Text hiding (map) import Control.Exception import Control.Monad.IO.Class import Data.Maybe (catMaybes) import Data.List (nub) import Con...
chrys-h/ftag
src/FTag.hs
mit
3,692
0
16
732
1,510
777
733
85
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.BeforeLoadEvent (js_getUrl, getUrl, BeforeLoadEvent, castToBeforeLoadEvent, gTypeBeforeLoadEvent) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, mayb...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/BeforeLoadEvent.hs
mit
1,341
6
10
158
365
233
132
23
1
-- Point in Polygon -- http://www.codewars.com/kata/530265044b7e23379d00076a/ module PointInPolygon where type Point = (Double, Double) pointInPoly :: [Point] -> Point -> Bool pointInPoly poly point = odd . length . filter (intersect (point, 1, 0)) . zip poly $ (tail poly ++ [head poly]) where intersect ((px, py...
gafiatulin/codewars
src/3 kyu/PointInPolygon.hs
mit
634
0
16
225
297
165
132
11
1
-- | Defining a `KVMap` data structure, which is a string -> string -- mapping that is text encoded in a simple format. module Data.KVMap where import ClassyPrelude import qualified Data.Text as T import qualified Data.HashMap.Strict as H import Data.Attoparsec.ByteString.Lazy (Parser) import Data.Attoparsec.ByteStrin...
adnelson/nix-binary-cache
src/Data/KVMap.hs
mit
1,082
0
15
241
271
145
126
21
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.Window ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Window #else module Graphics.UI.Gtk.WebKit.DOM.Window #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GH...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/Window.hs
mit
395
0
5
39
31
24
7
4
0
{-# LANGUAGE AutoDeriveTypeable, DeriveDataTypeable, DeriveGeneric, DeriveAnyClass, DeriveFunctor, DeriveFoldable, DeriveTraversable #-} {-# LANGUAGE TemplateHaskell, LambdaCase, TypeFamilies #-} module Data.Sexp where import Derive.List (deriveList) import Control.Lens (Plated (..)) import Data.Foldable (Foldabl...
sboosali/s-expression
sources/Data/Sexp.hs
mit
7,867
0
12
2,077
1,054
555
499
64
3
{-# htermination keysFM_GE :: FiniteMap Char b -> Char -> [Char] #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_keysFM_GE_3.hs
mit
86
0
3
14
5
3
2
1
0
{-# LANGUAGE TemplateHaskell #-} module UnitTest.RequestParse.AccountUnlinking where import Data.Aeson (Value) import Data.Yaml.TH (decodeFile) import Test.Tasty as Tasty import Web.Facebook.Messenger import UnitTest.Internal ----------------------- -- ACCOUNT UNLINKING -- ----------------------- accountUnlinkVal...
Vlix/facebookmessenger
test/UnitTest/RequestParse/AccountUnlinking.hs
mit
568
0
7
74
93
56
37
-1
-1
module ObjCSyntax where data Interface = Interface Name [Property] [Method] data Property = Property [PropertyModifier] Type Name data PropertyModifier = Nonatomic | Strong | Weak | Copy data Implementation = Implementation Name [Method] data Method = Method ClassOrInstance ReturnType MethodName Body data ClassOr...
chriseidhof/objc-value-objects
ObjCSyntax.hs
mit
1,550
0
7
459
321
189
132
38
0
{-# OPTIONS -Wall #-} import Data.Functor (($>)) import Data.Set (Set) import qualified Data.Set as Set import Helpers.Parse import Text.Parsec type Input = [([Set Segment], [Set Segment])] data Segment = A | B | C | D | E | F | G deriving (Eq, Ord, Show) main :: IO () main = do input <- parseInput let output...
SamirTalwar/advent-of-code
2021/AOC_08_1.hs
mit
1,043
0
13
288
423
223
200
33
1
import Data.Numbers.Primes (primes) tenThousandFirstPrime :: Integer tenThousandFirstPrime = primes !! 10000 -- tenThousandFirstPrime == 104743
samidarko/euler
problem007.hs
mit
147
0
5
18
27
16
11
3
1
module Feature.Common.Util where import ClassyPrelude orThrow :: Monad m => m (Maybe a) -> e -> m (Either e a) orThrow action e = maybe (Left e) Right <$> action
eckyputrady/haskell-scotty-realworld-example-app
src/Feature/Common/Util.hs
mit
165
0
10
33
75
38
37
5
1
sumsqr :: Int -> Int sumsqr n = sum [x^2 | x <- [1..n]] sumsqr' :: Int -> Int sumsqr' n = sum (map (\x -> x * x) [1..n]) sumsqr'' :: Int -> Int sumsqr'' n = foldl (\acc x -> acc + x^2) 0 [1..n] main = do print $ sumsqr 100 print $ sumsqr' 100 print $ sumsqr'' 100
fabioyamate/programming-in-haskell
ch05/ex01.hs
mit
279
0
10
77
168
85
83
10
1
module Logic where import Control.Monad import Data.List import qualified Data.Map as M import Data.Ord import System.Exit import System.IO import System.Process import Text.Printf import TimeAccounting data Cell = Unknown | Revealed Int | Flagged deriving Show showCell Unknown = "." showCell Fl...
cmears/mines-solver
Logic.hs
mit
3,730
0
21
999
1,661
878
783
87
5
import Test.Hspec import Test.QuickCheck import Control.Exception (evaluate) main :: IO () main = hspec $ do describe "Prelude.head" $ do it "returns the first element of a list" $ do head [23 ..] `shouldBe` (23 :: Int) it "returns the first element of an *arbitrary* list" $ property $ \x xs -> ...
manuel-io/snake
spec/Spec.hs
mit
464
0
18
114
153
78
75
12
1
module LexML.Linker.RegrasSTF ( pSTF ) where import Data.Char import Data.Maybe import Control.Monad import Control.Monad.Trans import Control.Monad.Except import Control.Monad.Identity import Control.Monad.State import LexML.Linker.Decorator (DecorationMap, addURN) import Data.Typeable import LexML.Linker.LexerPrim...
lexml/lexml-linker
src/main/haskell/LexML/Linker/RegrasSTF.hs
gpl-2.0
3,271
0
16
819
990
557
433
86
4
ver 0 b c = b + 1 ver a 0 c = ver (a-1) c c ver a b c = ver (a-1) (ver a (b-1) c) c
btrzcinski/synacor-challenge
hs/ver.hs
gpl-2.0
85
0
9
30
86
43
43
3
1
{-# LANGUAGE ScopedTypeVariables #-} module Robots3.Solver where -- $Id$ import Robots3.Config import Robots3.Data import Robots3.Move import Robots3.Final import Robots3.Hull import Robots3.Nice import Robots3.Final import Robots3.Examples import Autolib.Schichten import Data.Maybe import Autolib.Set import Autol...
Erdwolf/autotool-bonn
src/Robots3/Solver.hs
gpl-2.0
2,702
38
20
772
1,137
616
521
77
1
-- quadratic-to-qubezier.hs import System.Environment (getArgs) -- | Converts y = Ax^2 + Bx + C to QBezier notation. quadToQbez :: Float -- ^ Coefficient of x^2. -> Float -- ^ Coefficient of x. -> Float -- ^ Constant term. -> [(Float, Float)] -- ^ C...
friedbrice/Haskell
quadratic-to-qubezier.hs
gpl-2.0
1,217
3
11
401
484
269
215
24
1
{- | Module : $Id: h2hf.hs 18342 2013-11-29 02:57:59Z sternk $ Description : a test driver for Haskell to Isabelle HOLCF translations Copyright : (c) Christian Maeder, Uni Bremen 2002-2005 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Port...
nevrenato/HetsAlloy
Haskell/h2hf.hs
gpl-2.0
2,772
0
22
830
780
410
370
62
8
module Main where import Control.Monad import Control.Concurrent import Control.Concurrent.STM main = do shared <- atomically $ newTVar 0 before <- atomRead shared putStrLn $ "Before: " ++ show before forkIO $ 25 `timesDo` (dispVar shared >> milliSleep 20) forkIO $ 10 `timesDo`...
tormeh/uniproject
haskell/stm.hs
gpl-2.0
730
0
12
199
256
127
129
18
1
module Problem001 (answer) where answer :: Int answer = sum $ filter (\x -> x `mod` 3 == 0 || x `mod` 5 == 0) [1..999]
geekingfrog/project-euler
Problem001.hs
gpl-3.0
120
0
13
27
65
38
27
3
1
module HakeModule ( targets , moreFile , deps ) where import Control.Arrow targetDependPairs :: [ (String, [ String ]) ] targetDependPairs = [ (firstSampleXhtml , firstSampleXhtmlMoreFile ) , (useRuleXhtml , useRuleXhtmlMoreFile ) , (useDefaultXhtml , useDefaultXhtmlMoreFile ) , (useA...
YoshikuniJujo/hake_haskell
web_page/short_tutorial/HakeModule.hs
gpl-3.0
2,605
0
8
437
444
281
163
54
1
module Main where import Application.PVP2LibLinear.ArgsParser as AP import Application.PVP2LibLinear.Conduit import Application.PVP2LibLinear.Utility import Classifier.LibLinear import Control.Monad as M import Data.Conduit import ...
XinhuaZhang/PetaVisionHaskell
Application/PVP2LibLinear/Test.hs
gpl-3.0
2,857
0
26
1,358
581
303
278
64
5
module Util where import Data.List import qualified Data.Map as Map import Data.Maybe (fromMaybe) import System.Info (os) joinWith :: String -> [String] -> String joinWith = intercalate joinWithSpace :: [String] -> String joinWithSpace = unwords joinWithComma :: [String] -> String joinWithComma = intercalate", " j...
eriksvedang/Carp
src/Util.hs
mpl-2.0
1,710
0
10
371
608
325
283
51
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- Module : Khan.Model.SSH -- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of th...
brendanhay/khan
khan/Khan/Model/SSH.hs
mpl-2.0
2,552
0
14
834
717
370
347
67
2
{-# 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/Instances/StartReplica.hs
mpl-2.0
5,160
0
19
1,234
784
456
328
116
1
module CCAR.Model.ProjectWorkbench( querySupportedScripts , queryActiveWorkbenches , manageWorkbench , executeWorkbench , testExecuteScript )where import CCAR.Main.DBUtils import GHC.Generics import Data.Aeson as J import Yesod.Core import Control.Monad.IO.Class(liftIO) import Control.Concurrent import Control.C...
asm-products/ccar-websockets
CCAR/Model/ProjectWorkbench.hs
agpl-3.0
14,069
283
26
3,246
3,883
2,056
1,827
354
4
-- C->Haskell Compiler: C attribute definitions and manipulation routines -- -- Author : Manuel M. T. Chakravarty -- Created: 12 August 99 -- -- Version $Revision: 1.1 $ from $Date: 2004/11/21 21:05:27 $ -- -- Copyright (c) [1999..2001] Manuel M. T. Chakravarty -- -- This file is free software; you can redistribu...
thiagoarrais/gtk2hs
tools/c2hs/c/CAttrs.hs
lgpl-2.1
15,404
106
15
4,418
3,277
1,741
1,536
-1
-1
-- | -- Module: SwiftNav.SBP.GnssSignal -- Copyright: Copyright (C) 2015 Swift Navigation, Inc. -- License: LGPL-3 -- Maintainer: Mark Fine <dev@swiftnav.com> -- Stability: experimental -- Portability: portable -- -- Struct to represent a signal (constellation, band, satellite identifier) module SwiftNav...
mookerji/libsbp
haskell/src/SwiftNav/SBP/GnssSignal.hs
lgpl-3.0
1,685
0
11
272
284
163
121
-1
-1
{-# LANGUAGE TypeOperators, TypeFamilies, DataKinds #-} module Example.Pass.Typecheck where import Data.Generics.Fixplate import Data.OpenRecords import Example.Ast data Type = TInt | TBool deriving (Eq) instance Show Type where show TInt = "Int" show TBool = "Bool" type' :: Label "type'" type' = Lab...
hyPiRion/hs-playground
trex-ann/Example/Pass/Typecheck.hs
unlicense
1,851
0
11
451
765
375
390
-1
-1
module Lib ( go ) where go :: IO () go = putStrLn "Nothing successfully completed."
aztecrex/haskell-sample
src/Lib.hs
unlicense
95
0
6
27
27
15
12
4
1
module HelperSequences.A220096Spec (main, spec) where import Test.Hspec import HelperSequences.A220096 (a220096) main :: IO () main = hspec spec spec :: Spec spec = describe "A220096" $ it "correctly computes the first 20 elements" $ take 20 (map a220096 [1..]) `shouldBe` expectedValue where expectedValue...
peterokagey/haskellOEIS
test/HelperSequences/A220096Spec.hs
apache-2.0
370
0
10
59
160
95
65
10
1
{-# LANGUAGE OverloadedStrings #-} -- | Internal doc. module Database.CouchDB.Conduit.Internal.Doc ( couchRev, couchRev', couchDelete, couchGetWith, couchPutWith, couchPutWith_, couchPutWith' ) where import Prelude import Control.Monad (void) import Contr...
akaspin/couchdb-conduit
src/Database/CouchDB/Conduit/Internal/Doc.hs
bsd-2-clause
4,799
0
11
1,556
984
531
453
95
2
module Main where import Position import Data.IORef import Data.Char import Control.Concurrent import Control.Monad import TerminalStuff import Map import Move import Monster import Player import State import Ray import Data.Maybe import System.IO import System.IO.Unsafe import Vision import Vision.DDA -- import UI.NC...
CheeseSucker/haskell-roguelike
src/roguelike.hs
bsd-2-clause
5,171
0
13
1,306
2,090
997
1,093
185
4
{-# LANGUAGE RankNTypes, BangPatterns, DeriveDataTypeable, StandaloneDeriving #-} {-# OPTIONS -W #-} module Language.Hakaru.Types where import Data.Dynamic import System.Random -- Basic types for conditioning and conditioned sampler data Density a = Lebesgue !a | Discrete !a deriving Typeable type Cond = Maybe Dynam...
zaxtax/hakaru-old
Language/Hakaru/Types.hs
bsd-3-clause
896
0
13
210
231
124
107
25
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {- | Module : Control.Monad.Error.Class Copyright : (c) Michael Weber <michael.weber@post.rwth-aachen.de> 2001, (c) Jeff N...
ekmett/mtl
Control/Monad/Error/Class.hs
bsd-3-clause
8,435
0
11
1,527
1,483
831
652
83
1
module PathFinder.Interface ( search2d , search2d' , searchGraphMatrix , graph ) where import PathFinder.Core ( pathFinderSearch , PathFinderState ) import PathF...
markus1189/pathfinder
src/PathFinder/Interface.hs
bsd-3-clause
1,720
0
14
571
633
332
301
-1
-1
{-# LANGUAGE RecordWildCards #-} module Leash.AMQP ( subscribe -- * Network.AMQP re-exports , AMQPException , Connection , Message(..) , Envelope , closeConnection ) where import Network.AMQP import Bark.Types import qualified Data.ByteString.Char8 as B subscribe :: URI ->...
brendanhay/amqp-bark
leash/src/Leash/AMQP.hs
bsd-3-clause
993
0
14
341
255
136
119
31
1
{-# LANGUAGE CPP, RankNTypes, GADTs #-} #if __GLASGOW_HASKELL__ >= 800 #define TheExc TypeError #else #define TheExc ErrorCall #endif module Test.ShouldNotTypecheck (shouldNotTypecheck) where import Control.DeepSeq (force, NFData) import Control.Exception (evaluate, try, throwIO, TheExc(..)) import Data.List (isSuffix...
CRogers/should-not-typecheck
src/Test/ShouldNotTypecheck.hs
bsd-3-clause
1,546
0
17
251
248
134
114
16
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeFamilies #-} -------------------------------------------------------------------- -- | -- Module : The Connection type class -- Copyright : (C) Marek Kidon 2016 -- License : BSD-style (see the...
Tr1p0d/connections
src/Network/Connections/Class/Connection.hs
bsd-3-clause
2,097
0
13
458
474
265
209
46
0
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, FlexibleInstances, GADTs, GeneralizedNewtypeDeriving, StandaloneDeriving, NoImplicitPrelude #-} module Types where import BasePrelude import qualified Data.Map as Map import Data.Text import Test.QuickCheck (Property, counterexample) data Foo = Foo { fooInt ::...
aelve/json-x
tests/Types.hs
bsd-3-clause
2,695
1
11
740
797
446
351
-1
-1
module DoubledWordsSpec (main, spec) where import Test.Hspec import DoubledWords ( OurWord(..) , WordInfo(..) , doubledWords , keepOnlyLatestDuplicates ) main :: IO () main = hspec spec spec :: Spec spec = do describe "DoubledWords" $ do describe "doubledWords" $ do it "reports nothing whe...
FranklinChen/doubled-words-haskell
test/DoubledWordsSpec.hs
bsd-3-clause
1,317
0
21
414
326
163
163
33
1
module Main where import System.Environment (getArgs) import Anatomy.Builder main :: IO () main = do args <- getArgs case args of [fn, "-o", out] -> buildFile fn out [fn] -> buildFile fn "." _ -> putStrLn . unlines $ [ "usage:" , "anatomy FILENAME\t\tbuild FI...
vito/atomo-anatomy
src/Main.hs
bsd-3-clause
462
0
11
145
105
57
48
13
3
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- | Create new a new project directory populated with a basic working -- project. module Stack.New ( new , NewOpts(..) , defaultTe...
phadej/stack
src/Stack/New.hs
bsd-3-clause
18,577
0
23
5,715
4,333
2,193
2,140
423
5
module Test.Sandbox.Compose.Template ( applyTemplate ) where import qualified Text.Hastache as H import qualified Text.Hastache.Context as H import qualified Data.Text.Lazy as TL import qualified Data.Text as T import qualified Data.Map as M applyTemplate :: H.MuVar a => [(String, a)] -> String ...
junjihashimoto/test-sandbox-compose
Test/Sandbox/Compose/Template.hs
bsd-3-clause
768
0
17
184
265
146
119
21
2
{-# LANGUAGE BangPatterns #-} module RandomSkewHeapSpec where import Data.List (group, sort) import Test.Hspec import qualified RandomSkewHeap as P spec :: Spec spec = do describe "base priority queue" $ do it "queues entries based on weight" $ do let q = P.enqueue 5 1 5 $ ...
kazu-yamamoto/http2
bench-priority/test/RandomSkewHeapSpec.hs
bsd-3-clause
932
0
20
327
382
198
184
23
3
-- | -- This module export Text, ByteString, LText, and LByteString -- module Prelude.Bitpacked.Types ( Text , ByteString , LText , LByteString ) where import Data.Text (Text) import Data.ByteString (ByteString) import qualified Data.Text.Lazy as LazyText import qualified Data.ByteString.Lazy as LazyByteStr...
andrewthad/lens-prelude
src/Prelude/Bitpacked/Types.hs
bsd-3-clause
398
0
5
62
78
53
25
11
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE ParallelArrays, MagicHash #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.PArr -- Copyright : (c) 2001-2011...
jstolarek/ghc
libraries/base/GHC/PArr.hs
bsd-3-clause
1,386
4
7
283
65
54
11
-1
-1