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
import Utils main = do print . sum . takeWhile (< 2000000) $ primes
mskmysht/ProjectEuler
src/Problem10.hs
bsd-3-clause
71
0
10
17
31
16
15
3
1
{-# LANGUAGE OverloadedStrings #-} module Language.Haskell.Liquid.WiredIn ( propType , propTyCon , hpropTyCon , pdVarReft , wiredTyCons, wiredDataCons , wiredSortedSyms -- | Constants for automatic proofs , dictionaryVar, dictionaryTyVar, dictionaryBind ,...
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/WiredIn.hs
bsd-3-clause
5,558
0
13
1,432
1,705
943
762
94
1
-- Translation of 'c_test.c' in the LevelDB source code. module Main ( main -- :: IO () ) where import Control.Monad (liftM, when) import System.Posix.User (getEffectiveUserID) import Database.LevelDB.FFI as C import Foreign.C import Foreign.Ptr import Foreign.C.String import Foreign.Storable import For...
thoughtpolice/hs-leveldb
examples/ffi_test.hs
bsd-3-clause
6,128
0
23
1,300
2,016
941
1,075
156
2
{-# LANGUAGE Arrows, FlexibleContexts, TypeOperators, TypeFamilies, ConstraintKinds, ScopedTypeVariables #-} {-# LANGUAGE PartialTypeSignatures #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main where import MixedTypesNumPrelude -- import qualified Prelude as P -- i...
michalkonecny/aern2
aern2-real/attic/DemoPar.hs
bsd-3-clause
1,361
0
14
302
424
222
202
40
3
{-# LANGUAGE Trustworthy #-} -- | Synchronization primitives module MAC.MVar ( MACMVar , newMACMVar , newMACEmptyMVar , takeMACMVar , putMACMVar ) where import MAC.Lattice -- Trustworthy import MAC.MAC -- Unsafe import MAC.Effects import Control.Concurrent.MVar -- | Labeled @MVar...
alejandrorusso/mac-privacy
MAC/MVar.hs
bsd-3-clause
881
0
9
195
240
129
111
21
1
{-# LANGUAGE QuasiQuotes , TypeFamilies , GeneralizedNewtypeDeriving , TemplateHaskell , OverloadedStrings , GADTs , FlexibleContexts #-} module Market.History.Persistent where import Control.Applicative import Control.Concurrent.STM.TVar import Control.Monad import Control.Monad.IO.Class (liftIO) import Control.Mo...
s9gf4ult/market
Market/History/Persistent.hs
bsd-3-clause
2,086
0
18
695
560
289
271
-1
-1
module Test.SimpleCheck.Gen ( RoseTree(..) , joinRose , roseRoot , roseChildren , filterRose , Generator(..) , Gen(..) , choose , oneof , frequency , elements , sized , sample , sample' ) where import Prelude hiding (sequence) import Text.Show.Funct...
reiddraper/haskell-simple-check
src/Test/SimpleCheck/Gen.hs
bsd-3-clause
4,110
0
16
917
1,309
698
611
88
2
{-# LANGUAGE RankNTypes #-} module Pipes.ZMQ4 ( fromZMQ , request ) where import Control.Monad (forever) import Data.ByteString (ByteString) import Pipes import qualified System.ZMQ4 as Z {-| Send upstream bytes into a request socket, wait/block and yield the reply...
PierreR/pipes-zmq4
src/Pipes/ZMQ4.hs
bsd-3-clause
779
2
14
200
219
112
107
16
1
module Utils ( medianOf ) where import Data.List (sort) medianOf :: (Real a, Eq a) => [a] -> Maybe Double medianOf [] = Nothing medianOf [x] = Just . fromRational $ toRational x medianOf xs = let sorted = sort xs len = length xs in case even len of True -> let [x, y] = take 2 $ drop (len `di...
caneroj1/median-stream
utils/Utils.hs
bsd-3-clause
532
0
18
157
261
135
126
16
2
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, TypeFamilies #-} -- | The type checker checks whether the program is type-consistent. module Futhark.TypeCheck ( -- * Interface checkProg , TypeError (..) , ErrorCase (..) -- * Extensionality , TypeM ...
mrakgr/futhark
src/Futhark/TypeCheck.hs
bsd-3-clause
40,576
0
26
11,225
12,468
6,145
6,323
887
4
{-# LANGUAGE TypeFamilies #-} -- | The 'Date' module provides the API for the Javascript @Date@ -- object. The API documentation is mainly taken from -- w3schools (<http://www.w3schools.com/jsref/jsref_obj_date.asp>). -- Deprecated methods are not supported. module Language.Sunroof.JS.Date ( JSDate , newDa...
ku-fpg/sunroof-compiler
Language/Sunroof/JS/Date.hs
bsd-3-clause
11,315
0
8
1,698
1,766
976
790
128
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.ConsoleHandler -- Copyright : (c) The University of Glasgow -- License : see libraries/base/LICENSE -- -- Maintainer : ...
jstolarek/ghc
libraries/base/GHC/ConsoleHandler.hs
bsd-3-clause
5,258
0
4
1,315
36
31
5
5
0
module Example where
smurphy8/refactor-patternmatch-with-lens
src/Example.hs
bsd-3-clause
23
0
2
5
4
3
1
1
0
{- Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.0 Kubernetes API version: v1.9.12 Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) -} {-| Module : Kubernetes.OpenAPI.API.Authori...
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/API/Authorization.hs
bsd-3-clause
2,747
0
8
331
484
333
151
-1
-1
module CommandsSpec where import Test.Hspec import Network import Text.Parsec (parse) import Commands import Models spec :: Spec spec = do describe "Parsing Commands" $ do describe "Switching between connections" $ do it "returns a switch command with a connection name for switch" $ do com...
shterrett/peer-chat
test/CommandsSpec.hs
bsd-3-clause
3,153
0
32
1,135
678
334
344
62
1
module Data.Hexagon.LineDrawSpec where import SpecHelper spec :: Spec spec = do describe "Data.Hexagon.LineDraw" $ do context "context" $ do it "does something" $ do True `shouldBe` True main :: IO () main = hspec spec
alios/hexagon
test/Data/Hexagon/LineDrawSpec.hs
bsd-3-clause
242
0
16
58
77
39
38
10
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.EXT.PixelTransform -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/EXT/PixelTransform.hs
bsd-3-clause
1,173
0
4
127
88
66
22
18
0
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module PactContinuationSpec (spec) where import qualified Control.Exception as Exception import Control.Lens hiding ((.=)) im...
kadena-io/pact
tests/PactContinuationSpec.hs
bsd-3-clause
39,979
0
25
9,280
9,216
4,564
4,652
-1
-1
{-# LANGUAGE OverloadedStrings #-} -- | -- Module : Example.ExceptionSemantics -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : provisional -- Portability : non-portable (GHC extensions) -- module Ex...
fmapfmapfmap/amazonka
examples/src/Example/ExceptionSemantics.hs
mpl-2.0
2,513
0
17
815
582
295
287
54
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-codedeploy/gen/Network/AWS/CodeDeploy/RegisterApplicationRevision.hs
mpl-2.0
4,391
0
9
879
490
297
193
62
1
-- | -- Module : Basement.Types.OffsetSize -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : portable -- {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {...
vincenthz/hs-foundation
basement/Basement/Types/OffsetSize.hs
bsd-3-clause
8,253
0
11
1,729
2,397
1,271
1,126
-1
-1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} {-# OPTIONS -Wall #-} import Language.Paraiso.Generator (generateIO) import qualified Language.Paraiso.Generator.Claris as C import qualified Language.Paraiso.Generator.Native as Native import Language.Paraiso.Name import Language.Para...
nushio3/Paraiso
attic/Claris/Vector.hs
bsd-3-clause
3,299
0
18
929
1,234
638
596
71
1
{-# LANGUAGE CPP, ScopedTypeVariables #-} module Main ( main ) where #if MIN_VERSION_base(4,8,0) #define HAS_NATURAL #endif import Control.Applicative import Control.Exception as C (SomeException, catch, evaluate) impor...
fpco/binary
tests/QC.hs
bsd-3-clause
20,208
0
20
6,698
4,941
2,681
2,260
-1
-1
import Control.Parallel.OpenCL import Foreign( castPtr, nullPtr, sizeOf ) import Foreign.C.Types( CULong,CUInt ) import Foreign.Marshal.Array( newArray, peekArray ) import System.Exit( exitFailure ) import qualified Control.Exception as Ex( catch ) main :: IO () main = do -- Initialize OpenCL (platform:_) <- c...
r00tb0x/typhon-vx
kraken_rewrite/trollky/krak.hs
gpl-3.0
2,076
0
13
508
552
283
269
43
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GADTs #-} module T13747 where class C a where type family TC a :: * class D a where data family TD a :: * instance C Int where type instance TC Int = Int instance D Double where data instance TD Double = TDDouble instance D Int where newtype instance TD Int = T...
ezyang/ghc
testsuite/tests/parser/should_compile/T13747.hs
bsd-3-clause
428
0
7
116
132
73
59
-1
-1
-- !!! check that hiding on an unqualified import also hides the qualified name module ShouldFail ( Data.List.map ) where import Data.List hiding ( map )
urbanslug/ghc
testsuite/tests/rename/should_fail/rnfail033.hs
bsd-3-clause
154
0
5
26
24
16
8
2
0
{-# LANGUAGE MagicHash #-} module T7796 where import GHC.Prim -- -- test for #7796 -- -- created by nicolas.frisby@gmail.com, feel free to email me! -- -- a delicate interaction between specialisation and w/w creates a -- binding that is dead but is allocated at run-time -- -- -- we grep the -ddump-prep for $s$go, ...
urbanslug/ghc
testsuite/tests/simplCore/should_compile/T7796.hs
bsd-3-clause
1,782
0
17
532
242
147
95
15
3
{-# LANGUAGE GeneralizedNewtypeDeriving, GADTs #-} module T7148 where data SameType a b where Refl :: SameType a a coerce :: SameType a b -> a -> b coerce Refl = id trans :: SameType a b -> SameType b c -> SameType a c trans Refl Refl = Refl sameUnit :: SameType () () sameUnit = Refl class IsoUnit a where ...
holzensp/ghc
testsuite/tests/deriving/should_fail/T7148.hs
bsd-3-clause
813
0
9
182
311
162
149
24
1
module Mod131_A (f) where f x = x
urbanslug/ghc
testsuite/tests/module/Mod131_A.hs
bsd-3-clause
36
0
5
10
17
10
7
2
1
module Tar where import Data.Either import Data.List import System.Exit import System.Process import Utils readTarLines :: FilePath -> IO [TarLine] readTarLines fp = do (ec, out, err) <- readProcessWithExitCode "tar" ["-jtvf", fp] "" case (ec, err) of (ExitSuccess, []) -> case par...
ghc-android/ghc
distrib/compare/Tar.hs
bsd-3-clause
1,908
0
13
782
506
271
235
48
3
{- Copyright (c) 2008-2015 the Urho3D project. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
Teaspot-Studio/Urho3D-Haskell
app/sample05/Main.hs
mit
10,591
0
16
2,000
1,919
915
1,004
-1
-1
-- file: ch03/Distictions.hs a = ("Porpoise", "Grey") b = ("Table", "Oak") data Cetacean = Cetacean String String deriving (Show) data Furniture = Furniture String String deriving (Show) c = Cetacean "Porpoise" "Grey" d = Furniture "Table" "Oak"
supermitch/learn-haskell
real-world-haskell/ch03/Distinctions.hs
mit
250
3
6
41
89
45
44
6
1
module ASPico.Monad.Db where import ASPico.Prelude hiding (product) import Database.Persist.Sql (Filter, PersistEntity(..), PersistRecordBackend, PersistStoreRead, SqlBackend, (==.), get, getBy, insertEntity, selectFirst, selectList) import ASPico.Db (Affiliate(..), Conversion(..), Crea...
arowM/ASPico
src/ASPico/Monad/Db.hs
mit
4,425
0
15
824
1,066
560
506
-1
-1
import Control.Monad (guard) import Data.Maybe (mapMaybe) import Data.IntSet (IntSet) import qualified Data.IntSet as ISet import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) import qualified Data.Set as Set import Groups import Subutils main :: IO () main = mapM_ (\(subgr, gens) -> do putSt...
jwodder/groups
haskell/old/subgroups/subgrs04b.hs
mit
1,271
3
14
242
550
287
263
28
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.AbstractView (js_getDocument, getDocument, js_getStyleMedia, getStyleMedia, AbstractView, castToAbstractView, gTypeAbstractView) where import Prelude ((.), (==), (>>=), return, IO, Int, Float...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/AbstractView.hs
mit
1,824
12
11
224
471
287
184
29
1
-- ProjectEuler - Problem Two -- 1st July 2010, By James North -- Define the Fibonacci sequence -- This is the slowest algorithm for calculating -- the sequence because it has to make so many -- function calls. fibonacci :: (Integral a) => a -> a fibonacci 0 = 0 fibonacci 1 = 1 fibonacci a = fibonacci(a-1) ...
jamesnorth/project_euler
haskell/prob2.hs
mit
1,339
6
15
315
310
160
150
13
1
-- parenthesis are not for calling functions, they are just for -- specifying precedence. foo x = x + x -- this is an error -- functions have the highest precedence, so this will try to take -- `foo` and `2` as and argument to `foo` whic is wrong. -- operation1 = foo foo 2 -- this is equivalent to -- `foo(foo(2))` i...
v0lkan/learning-haskell
session-002/parens.hs
mit
348
1
7
71
38
21
17
2
1
module Main ( main ) where import Control.Concurrent import Control.Concurrent.Async import Control.Concurrent.QSem import Control.Monad {- For exploring running concurrent tasks simultaneously while limiting the max number of tasks. -} doStuff :: QSem -> a -> IO a doStuff qs v = do waitQSem qs -- be ca...
Javran/misc
max-in-flight/src/Main.hs
mit
575
0
11
125
162
82
80
17
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE Rank2Types #-} -- | A postgresql backend for persistent. module Database.Persist.Postgresql...
jcristovao/persistent
persistent-postgresql/Database/Persist/Postgresql.hs
mit
37,160
0
25
12,916
9,725
5,114
4,611
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} module Greet where import GHC.Generics import Data.Aeson import Data.Monoid import Data.Proxy import Data.Text import Servant.API -- * ...
mooreniemi/haskapi
greet.hs
mit
947
0
14
202
164
93
71
23
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} module Graphics.UI.Gtk.WidgetBuil...
Philonous/prototyper
src/Graphics/UI/Gtk/WidgetBuilder.hs
mit
9,405
0
18
2,688
2,978
1,470
1,508
226
2
-- ------------------------------------------------------------------------------------- -- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved. -- For email, run on linux (perl v5.8.5): -- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0...
cbrghostrider/Hacking
HackerRank/FunctionalProgramming/Recursion/stringOPermute.hs
mit
834
1
15
188
222
121
101
11
2
-- | Command-line argument handling. module Args where import Data.Char (toLower) import Data.Monoid ((<>)) import Options.Applicative import Distribution.PackageDescription (FlagAssignment, FlagName(..)) import Distribution.System (Arch(..), OS(..)) import System.FilePath (FilePath) import Fields data Args = Args ...
barrucadu/cabal-info
cabal-info/Args.hs
mit
3,355
0
15
665
850
436
414
73
17
import Data.Char import Data.List x = 2 inc x = x + 1 digits2Number x y = x * 10 + y y = inc 2 z = digits2Number 4 2 name = "Humpty Dumpty" letter = 'H' s = "One " ++ "two " ++ "three" n1 = length "The quick brown fox jumps over the lazy dog" n2 = length s condDec x = if x > 0 then x - 1 el...
kbiscanic/PUH
lectures/puh-lecture1.hs
mit
1,041
15
10
362
483
233
250
31
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} module Buchhaltung.Ask where import Buchhaltung.Types import Control.Arrow import Control.Monad import Control.Monad.Reader import Control.Monad.Trans.Class import Data.Char import ...
johannesgerer/buchhaltung
src/Buchhaltung/Ask.hs
mit
4,910
0
19
1,604
1,280
677
603
87
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Ebay.Types ( timeFormat , DevID, AppID, CertID, RuName , EbayConf (..) , EbayFailure (..) , SiteID (..) , siteIdNumber , xpSiteId , DetailLevelCode (..) , xpDetailLevelCode , AckCodeType (..) , E...
AndrewRademacher/hs-ebay-trading
src/Ebay/Types.hs
mit
9,490
0
10
2,681
2,099
1,168
931
221
1
module Network.Gazelle ( whatCD, torrentRoute, runGazelle, Torrent(..), TorrentID(..), TorrentGroup(..), TorrentGroupID(..), MusicInfo(..), Entry(..), Artist(..), ArtistID(..), getArtist, Tag(..), ArtistStatistics(..), getTorrent, getTorrentAndGroup, g...
mr/gazelle
src/Network/Gazelle.hs
mit
2,826
0
18
579
957
505
452
-1
-1
{-| Module : Numeric.LinearAlgebra.Easy.Basics Description : Easy linear algebra: common functions Copyright : (C) Richard Cook, 2016 Licence : MIT Maintainer : rcook@rcook.org Stability : experimental Portability : portable Typical usage is to import the top-level module unqualified using @import Numeri...
rcook/mlutil
easyla/src/Numeric/LinearAlgebra/Easy/Basics.hs
mit
8,140
0
9
1,889
1,138
776
362
100
1
-- data Pole = Maybe Kloc data Gra = Warcaby | Szachy data Kolor = Bialy | Czarny zacznijGre :: IO () zacznijGre = do putStrLn "W jaka gre chcesz zagrac?"
RAFIRAF/HASKELL
BoardGame.hs
mit
163
0
7
38
43
23
20
5
1
{-| Module : CatNPlus Description : Umbrella module Copyright : (C) Richard Cook, 2017 Licence : MIT Maintainer : rcook@rcook.org Stability : experimental Portability : portable -} module CatNPlus ( module CatNPlus.App , module CatNPlus.KeyPress ) where import CatNPlus.App import ...
rcook/catnplus
src/CatNPlus.hs
mit
347
0
5
89
29
19
10
5
0
import XMonad import XMonad.Config.Desktop import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Util.Run (spawnPipe) import XMonad.Util.EZConfig(additionalKeys) import System.IO base = desktopConfig main = do xmproc <- spawnPipe "xmobar" xmonad $ base { manageHook = manageDocks <+> ma...
deciduously/dotfiles
xmonad.hs
mit
1,067
2
14
276
297
172
125
28
1
module AppDeps (FileType(..), FileInfo(..), SubAppDeps, AppDeps, fileType, isJsLintable, nonExistentMtime, insertFile, insertFiles, safeJsSoy, emptyAppDeps, ...
Prinhotels/goog-closure
src/AppDeps.hs
mit
3,476
0
15
769
1,059
553
506
80
8
{-# LANGUAGE Arrows, NoMonomorphismRestriction, TypeOperators #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {- The Robot example in circuits. - Copyright : (C)opyright 2006, 2009-2011 peteg42 at gmail dot com - License : GPL (see COPYING for details) - - ghci -package ADHOC Robot_clock.hs - dot kaut...
peteg/ADHOC
Apps/Robot/Robot_clock.hs
gpl-2.0
5,043
12
18
994
1,111
596
515
-1
-1
-- -- Copyright (c) 2013 Bonelli Nicola <bonelli@antifork.org> -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. --...
beni55/cgrep
src/CGrep/Strategy/BoyerMoore.hs
gpl-2.0
3,178
0
19
777
817
444
373
48
2
module Probability.MeasurableSpace where import Notes import Functions.Basics.Macro import Functions.Basics.Terms import Logic.FirstOrderLogic.Macro import NumberTheory.Macro import Sets.Algebra.Intersection.Terms import Sets.Basics.Terms import ...
NorfairKing/the-notes
src/Probability/MeasurableSpace.hs
gpl-2.0
2,939
0
20
800
865
453
412
68
1
{-# LANGUAGE RankNTypes, FlexibleContexts #-} module Carnap.Languages.PureFirstOrder.Logic ( FOLogic(..) , parseFOLogic, folCalc , parseMontagueQCCalc, montagueQCCalc , parseMagnusQL, magnusQLCalc , parseThomasBolducAndZachFOL, thomasBolducAndZachFOLCalc , parseThomasBold...
gleachkr/Carnap
Carnap/src/Carnap/Languages/PureFirstOrder/Logic.hs
gpl-3.0
4,889
0
13
1,555
992
531
461
73
1
module Syntax where import Data.Text import qualified Data.Vector as V import qualified Data.Map.Strict as Map data Variable = NamedVar Text | GeneratedVar Int | ViewVar | SelfVar Text deriving (Eq, Ord, Show) type Env = Map.Map Variable Expr data Type = BoolT | IntT | TextT | VectorT Type | Rec...
fehrenbach/rechts
app/Syntax.hs
gpl-3.0
1,652
0
9
397
521
297
224
59
0
import Control.Applicative (liftA3) import System.IO.Extra (parsePrompt) import Data.QuadraticEquation (QuadraticEquation (..)) import qualified Data.QuadraticEquation as QuadraticEquation main :: IO () main = do equation <- liftA3 QuadraticEquation (parsePrompt "I...
kosc/sqrteq
app/Main.hs
gpl-3.0
444
0
10
116
107
58
49
11
1
-- sth-expand: uncompress stdin (run length encoding) module Main where import System.Exit (exitSuccess, exitFailure) import STH.Lib (charFilter, rlDecode, reportErrorMsgs) main :: IO () main = do xs <- getContents ys <- case rlDecode '\BEL' xs of Just zs -> return zs Nothing -> reportErrorM...
nbloomf/st-haskell
src/STH/Expand/Main.hs
gpl-3.0
432
0
13
132
109
56
53
13
2
module Main where import Lib import Data.Char import Text.HTML.TagSoup import Text.HTML.TagSoup.Tree import Data.List import Data.String.Utils import Text.Regex.Posix import System.Directory import Control.Monad.IO.Class --main :: IO () --main = putStr main :: IO () main = do contents <- readFile "insert filenam...
alekaar/htmlSan
htmlSan/app/Main.hs
gpl-3.0
9,007
0
22
2,058
2,722
1,439
1,283
181
20
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-books/gen/Network/Google/Resource/Books/Familysharing/Unshare.hs
mpl-2.0
5,330
0
20
1,306
872
505
367
120
1
-- | Various fixups in the introspection data. module Data.GI.CodeGen.Fixups ( dropMovedItems , guessPropertyNullability , detectGObject ) where import Data.Maybe (isNothing, isJust) import Data.Monoid ((<>)) import qualified Data.Text as T import Data.GI.CodeGen.API -- | Remove functions and methods...
ford-prefect/haskell-gi
lib/Data/GI/CodeGen/Fixups.hs
lgpl-2.1
5,799
0
32
1,699
1,342
701
641
95
3
import Debug.Trace import Euler import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe a046090 0 = 1 a046090 1 = 4 a046090 2 = 21 a046090 n = 7*a046090(n-1) - 7*a046090(n-2) + a046090(n-3) isValidCount c = let v = 8*c*c - 8*c + 4 sv = squareRoot v in (sv + 2) `mod` 4 == 0 && sv*sv == v ...
jdavidberger/project-euler
prob100.hs
lgpl-3.0
563
0
15
146
328
171
157
20
1
{-# LANGUAGE TypeFamilies #-} module Language.Haskell.TokenUtils.API ( -- * Creating a `LayoutTree` -- |This should only be required by impementors of token utils backends Allocatable(..) -- * Eliminating a `LayoutTree` -- |This should only be required by impementors of token utils backends , renderLay...
alanz/haskell-token-utils
src/Language/Haskell/TokenUtils/API.hs
unlicense
624
0
5
110
62
46
16
10
0
module QC.Q (Q, empty, isEmpty, put, get, rest) where import Control.Monad (liftM2) import Test.QuickCheck import Text.Printf (printf) -- | A queue with O(1) `put` and amortized O(1) `get` operations. data Q a = Q { front :: [a], back :: [a] } -- corresponds to front ++ reverse back instance Show a =>...
BurntSushi/150fp-practice
QC/Q.hs
unlicense
3,930
0
11
1,041
1,267
668
599
72
3
module Main where getCount :: String -> String -> Int getCount [] [] = 0 getCount (x:xs) (y:ys) = (if x == y then 0 else 1) + (getCount xs ys) main = do contents <- getContents let contentLines = lines contents putStrLn $ show $ getCount (contentLines !! 0) (contentLines !! 1)
ctimmons/hs_rosalind
5 - Counting Point Mutations/Main.hs
unlicense
296
0
10
71
136
71
65
8
2
{-# OPTIONS -fno-warn-duplicate-exports #-} module SW_Integer ( module SW_Integer, module Compare, module Function ) where import Compare import Function integer__divides :: Int -> Int -> Bool infixl 4 `integer__divides` x `integer__divides` y = y == 0 || x `mod` y == 0 integer__multipleOf :: Int -> Int -> Bool infi...
KestrelInstitute/Specware
Library/Haskell/SW_Integer.hs
bsd-2-clause
1,315
0
11
283
539
311
228
37
2
{-# LANGUAGE TemplateHaskell, FunctionalDependencies #-} {-| Implementation of the Ganeti config objects. -} {- Copyright (C) 2011, 2012, 2013, 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions...
ganeti/ganeti
src/Ganeti/Objects.hs
bsd-2-clause
27,469
0
19
7,341
5,396
3,153
2,243
-1
-1
{-| Module : Game.GoreAndAsh.Actor Description : Module that contains actor API for Gore&Ash Copyright : (c) Anton Gushcha, 2015-2016 License : BSD3 Maintainer : ncrashed@gmail.com Stability : experimental Portability : POSIX The core module contains API for actor based aproach of game development. The ...
Teaspot-Studio/gore-and-ash-actor
src/Game/GoreAndAsh/Actor.hs
bsd-3-clause
3,779
0
5
718
171
124
47
33
0
{-# LANGUAGE BangPatterns, UnboxedTuples #-} module Network.CommSec.BitWindow ( BitWindow , zeroWindow , updateBitWindow ) where import Data.Bits import Network.CommSec.Types import Data.Word (Word64) -- | A Bit Window is just an unpacked tuple of base and mask type BitWindow = (Word64,Word64) zeroWi...
TomMD/commsec
Network/CommSec/BitWindow.hs
bsd-3-clause
1,340
0
14
420
422
214
208
34
2
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1996-1998 TcHsSyn: Specialisations of the @HsSyn@ syntax for the typechecker This module is an extension of @HsSyn@ syntax, for use in the type checker. -} {-# LANGUAGE CPP #-} module TcHsSyn ( mkHsConApp, mkHsDictLet, mkHsApp,...
AlexanderPankiv/ghc
compiler/typecheck/TcHsSyn.hs
bsd-3-clause
65,092
2
19
19,205
18,880
9,446
9,434
-1
-1
{-# LANGUAGE RankNTypes, LambdaCase #-} {-# LANGUAGE ScopedTypeVariables, LiberalTypeSynonyms, TupleSections, TypeFamilies #-} {-| -} module Commands.Mixins.DNS13OSX9.ObservedSharing where import Commands.RHS import Commands.Extra import qualified Data.HRefCache.Internal as HRefCache...
sboosali/commands-frontend-DragonNaturallySpeaking
sources/Commands/Mixins/DNS13OSX9/ObservedSharing.hs
bsd-3-clause
4,141
0
24
1,179
1,376
686
690
74
11
{-| Module : Idris.Elab.Implementation Description : Code to elaborate instances. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards #-} module Idris.Elab.Implementation(elabImplementation) where import Idris.AbsSyntax import Idris.ASTUtils import Idris.DSL import Id...
enolan/Idris-dev
src/Idris/Elab/Implementation.hs
bsd-3-clause
20,949
1
28
7,091
7,478
3,721
3,757
389
40
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANG...
achirkin/easytensor
easytensor/src/Numeric/Matrix/SVD.hs
bsd-3-clause
29,643
0
25
9,528
9,305
4,808
4,497
555
12
module CLaSH.QuickCheck.Instances.Vec () where import Test.QuickCheck import CLaSH.Prelude instance (KnownNat n, Arbitrary a) => Arbitrary (Vec n a) where arbitrary = sequence $ CLaSH.Prelude.repeat arbitrary shrink x = sequence $ shrink <$> x
Ericson2314/clash-prelude-quickcheck
src/CLaSH/QuickCheck/Instances/Vec.hs
bsd-3-clause
253
0
8
42
83
46
37
6
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Distance.SV.Rules ( rules ) where ...
facebookincubator/duckling
Duckling/Distance/SV/Rules.hs
bsd-3-clause
1,935
0
18
465
497
281
216
58
2
{-# OPTIONS_GHC -Wall -fwarn-tabs #-} {-# LANGUAGE CPP, DeriveDataTypeable #-} -- HACK: in GHC 7.10, Haddock complains about Control.Monad.STM and -- System.IO.Unsafe being imported but unused. However, if we use -- CPP to avoid including them under Haddock, then it will fail to -- compile! #ifdef __HADDOCK__ {-# OPTI...
bitemyapp/stm-chans
src/Control/Concurrent/STM/TMQueue.hs
bsd-3-clause
7,506
0
12
1,654
905
494
411
87
3
----------------------------------------------------------- -- Daan Leijen (c) 2000, daan@cs.uu.nl ----------------------------------------------------------- module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr import Text.ParserCombinators.Parsec.Token import Text.ParserCo...
FranklinChen/hugs98-plus-Sep2006
packages/parsec/examples/UserGuide/Main.hs
bsd-3-clause
4,666
49
14
1,614
1,291
661
630
100
2
----------------------------------------------------------------------------- -- | -- Module : Debug.QuickCheck.Poly -- Copyright : (c) Andy Gill 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : experimental -- Portability : n...
OS2World/DEV-UTIL-HUGS
libraries/Debug/QuickCheck/Poly.hs
bsd-3-clause
2,361
0
12
479
487
276
211
34
1
import qualified Data.ByteString.Char8 as S8 import Data.Char import Data.Conduit import qualified Data.Conduit.List as CL import Data.Conduit.Shell main = run (ls $| grep "Key" $| shell "cat" $| conduit (CL.map (S8.map toUpper)))
chrisdone/shell-conduit
examples/Piping.hs
bsd-3-clause
262
0
13
62
83
47
36
6
1
{-# LANGUAGE ScopedTypeVariables, RankNTypes, TypeFamilies, FlexibleContexts, ExistentialQuantification #-} module Others (tests) where import Language.KansasLava import Language.KansasLava.Signal(mkShallowS) import qualified Language.KansasLava.Stream as S import Data.Bits import Data.Sized.Ix import Data.Sized.Sam...
andygill/kansas-lava
tests/Others.hs
bsd-3-clause
13,368
93
16
4,793
4,079
2,105
1,974
222
2
#!/usr/bin/env runghc import Distribution.Simple import System.Directory import System.FilePath import Control.Monad import System.Info import System.Exit import List inf = "infinity" -- files to remove bins = [inf] ++ ["util" </> "unlambda"] -- directories to clean dirs = [ "." , "util" ] ++ ...
thoughtpolice/infinity
Setup.hs
bsd-3-clause
1,011
0
11
242
331
180
151
28
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE BangPatterns #-} module Graphics.JPEG where import Data.Char(chr,ord) import Data.Word import Data.Int import Data.List(transpose) import Data.Bits(testBit) import Control.Monad(replicateM, liftM, liftM2) import Debug.Trace import System.IO import Control.Monad.State(Stat...
ownclo/jpeg-on-steroids
vendor/Haskell/jpeg-0.0.1/src/Graphics/JPEG.hs
bsd-3-clause
16,756
1
18
5,390
6,276
3,377
2,899
361
7
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE Trustworthy #-} -------------------------------------------------------------------- -- | -- Module : Data.MessagePack.Get -- Copyright : (c) Hideyuki Tanaka, 2009-2015 -- License : BSD3 -- -- Maintainer: tanaka.hideyuki@gmail.com -- Stability : experimental -- Portabil...
SX91/msgpack-haskell
src/Data/MessagePack/Get.hs
bsd-3-clause
3,971
0
16
1,051
1,185
622
563
120
9
{-# LANGUAGE CPP, NamedFieldPuns, NondecreasingIndentation #-} {-# OPTIONS_GHC -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- GHC Driver -- -- (c) The University of Glasgow 2005 -- ------------------------------...
christiaanb/ghc
compiler/main/DriverPipeline.hs
bsd-3-clause
105,219
0
31
36,276
16,614
8,391
8,223
1,444
45
module Data.Set.StringSet ( StringSet, insert, singleton, member, size, fromList, null, elems, empty, ) where import Data.Set.StringSet.Internal import Prelude hiding (null) import Data.Bits import Da...
axman6/TernaryTrees
Data/Set/StringSet.hs
bsd-3-clause
3,523
0
16
1,232
1,374
686
688
79
3
module Data.Map.Generators where import Prelude hiding (map) import Test.QuickCheck import qualified Data.Map as M map :: Ord k => Gen [(k, a)] -> Gen (M.Map k a) map = fmap M.fromList
massysett/barecheck
lib/Data/Map/Generators.hs
bsd-3-clause
187
0
10
33
80
46
34
6
1
module Network.TCPCommon ( initHandle , initLogger ) where import System.IO (hSetBuffering, hSetBinaryMode, BufferMode(..), Handle) import Import.SystemLog import Data.Char growlLoggerPriority = EMERGENCY initHandle :: Handle -> BufferMode -> IO () initHandle h bu...
thlorenz/Pricetory
src/Network/TCPCommon.hs
bsd-3-clause
668
0
10
152
168
88
80
13
1
-- © 2006 Peter Thiemann {- | Generic utilities for implementing transactionsal memories -} module WASH.CGI.TransactionUtil (withCGI, withTCGI, Control (..)) where import qualified WASH.CGI.BaseCombinators as B import qualified WASH.CGI.HTMLWrapper as H hiding (map,head) import WASH.CGI.CGIMonad import WASH.CGI....
nh2/WashNGo
WASH/CGI/TransactionUtil.hs
bsd-3-clause
11,502
559
13
3,294
3,455
1,983
1,472
266
10
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE TemplateHaskell #-} ----------------------------------------------------------------------------- -- | -- Module : Data.GeoJSON.Position -- Copyright : (C) 2016 Markus Barenhof...
alios/geojson-types
src/Data/GeoJSON/Position.hs
bsd-3-clause
8,429
0
15
1,894
2,898
1,512
1,386
-1
-1
-- one try at constructing a dtree by an 'occurence tree' module DTreeOT ( dtreeTest , buildOccurenceTree , reportOccurenceTree , testOccurenceTree , randomInitialAssignment , reportAssignment , improveAssignment ) where import qualified Data.List as L import qu...
malie/drolesat
DTreeOT.hs
bsd-3-clause
9,206
0
18
3,250
2,778
1,391
1,387
188
6
{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} {- | Module : ./Common/ATerm/ConvInstances.hs Description : special ShATermConvertible instances Copyright : (c) Klaus Luettich, C. Maeder, Uni Bremen 2005-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stab...
spechub/Hets
Common/ATerm/ConvInstances.hs
gpl-2.0
4,548
0
23
1,156
1,473
768
705
91
1
module Chorebot.Tribunal where import Chorebot.Assignment import Chorebot.Profile import Data.Time import Data.List import Data.List.Extra import Data.Maybe -- Rank a set of assignments. rank :: [Profile] -> [Assignment] -> Double rank profiles newAssignments = desirable + equitable where getProf a...
mjhoy/chorebot
src/Chorebot/Tribunal.hs
gpl-2.0
2,581
0
18
635
562
304
258
40
3
{-# 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-codedeploy/gen/Network/AWS/CodeDeploy/ListDeploymentGroups.hs
mpl-2.0
6,178
0
14
1,301
847
504
343
105
1
{-# LANGUAGE PArr #-} {-# OPTIONS -fvectorise #-} {-# OPTIONS -fno-spec-constr-count #-} module QSortVect (qsortVect) where import Data.Array.Parallel.Prelude import Data.Array.Parallel.Prelude.Double import qualified Data.Array.Parallel.Prelude.Int as I import qualified Prelude qsortVect:: PArray Double -> PArray D...
mainland/dph
icebox/examples/qsort/QSortVect.hs
bsd-3-clause
727
18
13
163
286
158
128
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} -- From https://ocharles.org.uk/blog/posts/2014-12-08-type-operators.html import Data.String data I a = I...
mpickering/ghc-exactprint
tests/examples/ghc710/TypeOperators.hs
bsd-3-clause
1,751
25
11
477
505
276
229
43
2
module Language.Gherkin.Parser where import Language.Gherkin.AST import Text.Parsec hiding ((<|>), many) import Text.Parsec.String import Data.Char import Data.List import Control.Applicative parseFeature :: Parser Feature parseFeature = do tags <- parseTags string_ "Feature:" name <- parseLine description <-...
sol/haskell-gherkin
Language/Gherkin/Parser.hs
bsd-3-clause
4,859
0
17
1,479
1,425
724
701
132
1
{-# LANGUAGE DeriveDataTypeable , GeneralizedNewtypeDeriving , TemplateHaskell #-} module Distribution.Server.Features.Distro.Types where import Distribution.Server.Framework.Instances () import Distribution.Server.Framework.MemSize import Distribution.Server.Users.State() import Distribution.Server.Users...
haskell-infra/hackage-server
Distribution/Server/Features/Distro/Types.hs
bsd-3-clause
2,159
0
14
335
556
315
241
53
0
-- (c) The University of Glasgow, 1992-2006 {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# OPTIONS_GHC -fno-omit-interface-pr...
siddhanathan/ghc
compiler/basicTypes/SrcLoc.hs
bsd-3-clause
23,102
0
15
6,448
4,095
2,191
1,904
322
3
{- Parser.hs: Parser for the pleco interface definition language Part of Pleco: a trace definition DSL for Barrelfish Copyright (c) 2013, ETH Zurich. All rights reserved. This file is distributed under the terms in the attached LICENSE file. If you do not find this file, copies can be found by writin...
joe9/barrelfish
tools/pleco/Parser.hs
mit
2,282
0
10
672
439
233
206
51
1