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
choose :: Integer -> Integer -> Integer choose n 0 = 1 choose 0 k = 0 choose n k = choose (n-1) (k-1) * n `div` k forAllR :: Integer -> [Integer] forAllR n = map (\r -> choose n r) [1..n] count p = length . filter p larger1M = count ((<) 1000000) main = do print $ larger1M $ concatMap forAllR [1..100]
ulikoehler/ProjectEuler
Euler53.hs
apache-2.0
313
0
9
75
173
90
83
10
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QIntValidator.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:15 Warning : this file is machine generated - do...
keera-studios/hsQt
Qtc/Gui/QIntValidator.hs
bsd-2-clause
9,885
0
14
1,593
3,052
1,557
1,495
-1
-1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QGraphicsEllipseItem_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:27 Warning : this file is machine gener...
keera-studios/hsQt
Qtc/Gui/QGraphicsEllipseItem_h.hs
bsd-2-clause
100,155
0
18
20,812
30,664
14,671
15,993
-1
-1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QHeaderView.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:18 Warning : this file is machine generated - do n...
keera-studios/hsQt
Qtc/Gui/QHeaderView.hs
bsd-2-clause
106,871
0
15
16,590
33,576
17,073
16,503
-1
-1
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-} module Distribution.Server ( -- * Server control Server(..), ServerEnv(..), initialise, run, shutdown, checkpoint, reloadDatafiles, -- * Server configuration ListenOn(..), ServerConfig(..), defaultServerConfig, hasSave...
chrisdotcode/hackage-server
Distribution/Server.hs
bsd-3-clause
12,926
0
18
3,092
2,364
1,295
1,069
225
3
{-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE TypeFamilies #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett 2013 -- License : BSD3 -- Maintainer: Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability: non-port...
ekmett/tasks
src/Control/Task/STM.hs
bsd-3-clause
2,673
0
12
541
768
422
346
69
0
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Trans.Error -- Copyright : (c) Michael Weber <michael.weber@post.rwth-aachen.de> 2001, -- (c) Jeff Newbern 2003-2006, -- (c) Andriy Palamarchuk 2006 --...
ekmett/transformers
Control/Monad/Trans/Error.hs
bsd-3-clause
7,290
0
21
2,061
2,051
1,065
986
131
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE MultiWayIf #-} module Game.Monsters.MBrain where import Control.Lens (use, preuse, ix, (.=), (^.), zoom, (-=), (%=), (+=), (&), (.~), (-~), (%~), (+~)) import Control.Monad (unless, when, liftM, void) import Data.Bits ((.&.), (.|.), complement) import Data.Maybe (isNothi...
ksaveljev/hake-2
src/Game/Monsters/MBrain.hs
bsd-3-clause
32,667
0
52
9,476
8,719
4,413
4,306
-1
-1
{-# LANGUAGE OverloadedStrings #-} module HPACK.HuffmanSpec where import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS import Data.Char (toLower) import Data.Hex import Data.Maybe (fromJust) import Network.HPACK import Network.HPACK.Huffman import Test.Hspec import Test.Hspec.QuickCheck t...
bergmark/http2
test/HPACK/HuffmanSpec.hs
bsd-3-clause
1,902
0
17
368
497
277
220
45
1
module Controls where import Data.Binary.Get import Data.IORef import System.IO.Unsafe import Memory import ImpossibleImports import Methods import Deserialize import Serialize getState :: Int -> State getState index = ((!! index) . unsafePerformIO) $ readIORef states readState :: Int -> IO State readState stateInde...
skill-lang/skill
deps/haskell/Controls.hs
bsd-3-clause
2,188
0
9
310
676
366
310
53
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveDataTypeable #-} ------------------------------------------------------------------------------- -- | -- Module : Data.NBT.Types -- Copyright : (c) 2016 Michael Carpenter -- License : BSD3 -- Maintainer : Michael Carpenter <oldmanmike.dev@gmail.com> -- S...
oldmanmike/hs-minecraft-nbt
src/Data/NBT/Types.hs
bsd-3-clause
2,048
0
9
494
494
287
207
60
0
{-# LANGUAGE NoBangPatterns, CPP, DeriveDataTypeable, ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Data.CompactMap -- Copyright : (c) David Himmelstrup 2008 -- License : BSD-style -- Maintainer : libraries@haskell.org -- Stability...
dmjio/CompactMap
src/Data/CompactMap.hs
bsd-3-clause
47,741
0
25
13,393
10,018
5,307
4,711
520
5
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Useful utilities for using Lucid with Yesod. module Yesod.Lucid (module Yesod.Lucid ,module Yesod ,module Control.Monad.Reader) where import Control...
haskell-lang/haskell-lang
src/Yesod/Lucid.hs
bsd-3-clause
1,736
0
17
511
454
248
206
45
1
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.APPLE.VertexArrayObject -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Port...
haskell-opengl/OpenGLRaw
src/Graphics/GL/APPLE/VertexArrayObject.hs
bsd-3-clause
836
0
5
110
66
49
17
12
0
module System.Expect (module System.Expect.ExpectInterface) where import System.Expect.ExpectInterface
stroan/haskell-libexpect
System/Expect.hs
bsd-3-clause
105
0
5
9
21
14
7
3
0
{-| Module : MZBuiltIns Description : MiniZinc built-in predicates, tests and functions License : BSD3 Maintainer : Klara Marntirosian <klara.mar@cs.kuleuven.be> Stability : experimental This module uses definitions of "Interfaces.MZAST" to provide an easy interface to MiniZinc built-in calls. It might be ...
GRACeFUL-project/haskelzinc
src/Interfaces/MZBuiltIns.hs
bsd-3-clause
15,238
0
8
2,955
3,171
1,787
1,384
316
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} -- Create a source distribution tarball module Stack.SDist ( getSDistTarball )...
meiersi-11ce/stack
src/Stack/SDist.hs
bsd-3-clause
10,829
0
21
2,925
2,621
1,390
1,231
197
10
-- http://adventofcode.com/2016/day/13 import Numeric import Data.Char import Control.Monad.Writer.Lazy import Control.Monad.Trans.List type Position = (Int, Int) type Stack = ListT (Writer (Sum Int)) Position seed :: Int -- seed = 1350 seed = 10 main :: IO () main = do print partOne partOne :: Stack partOne =...
MaxwellBo/Advent_Of_Code_2016
ListT_Diversion.hs
bsd-3-clause
881
0
17
213
430
236
194
26
1
{-| Module : MZAuxiliary Description : Contains auxiliary definitions License : BSD3 Maintainer : Klara Marntirosian <klara.mar@cs.kuleuven.be> Stability : experimental This module handles the configuration needed to run constraint models. -} module Interfaces.MZAuxiliary( Configuration(..), parseConf...
GRACeFUL-project/haskelzinc
src/Interfaces/MZAuxiliary.hs
bsd-3-clause
4,422
0
12
1,487
1,063
592
471
100
2
module Matrix where import Control.Applicative import Data.Serialize (Serialize) import Data.Vector.Unboxed (Unbox) import qualified Data.Vector.Unboxed as V import qualified Data.Matrix.Unboxed as M import qualified Data.Serialize as Serialize newtype Matrix a = Matrix { unMatrix :: M.Matrix a } deriving (Show, Eq...
intolerable/mpi
src/Matrix.hs
bsd-3-clause
1,962
0
11
416
926
473
453
44
1
module Control.Distributed.Process.Global ( -- * Cluster operations addNode , ResolutionMethod(..) , ResolutionNotification(..) , globalWhereis , globalRegister , globalUnregister , globalReregister -- * Locks , GlobalNameServer , LockName , LockRequesterId , LockId , queryLock ,...
jepst/distributed-process-global
src/Control/Distributed/Process/Global.hs
bsd-3-clause
1,186
0
6
164
189
132
57
33
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE FlexibleInstances #-} module PID where import Ivory.Compile.C.CmdlineFrontend import Ivory.Language [ivory| struct PID { pid_mv :: Stored IFloat ; pid_i :: Stored IFloat ...
GaloisInc/ivory
ivory-examples/examples/PID.hs
bsd-3-clause
2,393
0
18
744
760
408
352
57
1
{-# LANGUAGE PatternGuards, FlexibleInstances, StandaloneDeriving #-} module TypedValue ( Any(..) , prettyval ) where import Data.Map (Map) import qualified Data.Map as Map import Data.Monoid hiding (Any) import Pretty import SrcLoc import Var import ParseOps import Memory import Type import Prims import Value...
girving/duck
duck/TypedValue.hs
bsd-3-clause
3,088
0
14
664
1,275
632
643
75
3
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ViewPatterns #-} -- | -- Module : Network.Socks5 -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- This is an implementation of SOCKS5 as defined in RFC 1928 -- -- In Wikipedi...
erikd/hs-socks
Network/Socks5.hs
bsd-3-clause
5,329
0
14
1,183
833
458
375
78
1
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module Day16 where import Control.Lens import Control.Monad import Control.Monad.ST import Data.Propagator import Data.Propagator.Cell -- boilerplate link' :: Cell s a -> Prism' a b ...
joelburget/daily-typecheckers
src/Day16.hs
bsd-3-clause
5,463
0
15
1,385
2,413
1,176
1,237
127
6
module Graphics.Efl.Widgets.Button where import Graphics.Efl.Widgets.Reactive import Graphics.Efl.Widgets.Window import Graphics.Efl.Widgets.Rectangle import Graphics.Efl.Widgets.Text import Graphics.Efl.Widgets.Widget import Graphics.Efl.Widgets.Layout import qualified Graphics.Efl.Canvas as Peer data Button = Butto...
hsyl20/graphics-efl
src/Graphics/Efl/Widgets/Button.hs
bsd-3-clause
1,906
0
15
373
569
294
275
47
2
{-# LANGUAGE GADTs, OverloadedStrings, RecordWildCards #-} module Main where import Common (fromHandleForever, lineByLine, withSerial, zmqConsumer, parseForever, encodeToMsgPack, getConfigFor) import qualified System.IO as SysIO import qualified System.Hardware.Serialport as S import qualified System.ZMQ4 as Z impo...
jaj42/hsmedstream
haskell/src/OdmStream.hs
isc
5,620
0
15
1,931
1,709
891
818
145
2
module Fuml.Base.LinearRegression where import Numeric.LinearAlgebra -- | Ordinary least squares ols :: [(Vector Double, Double)] -> Vector Double ols xys = let x = fromRows $ map fst xys y = col $ map snd xys betaMat = inv (tr' x <> x) <> tr' x <> y in tr' betaMat ! 0 -- | Weighted ordinary least sq...
diffusionkinetics/open
fuml/lib/Fuml/Base/LinearRegression.hs
mit
827
0
16
228
366
182
184
21
1
module StatExpr where f = do "koe"
roberth/uu-helium
test/typeerrors/Examples/StatExpr.hs
gpl-3.0
36
0
6
8
12
7
5
2
1
{-# LANGUAGE OverloadedLists #-} module Nirum.Constructs.ModulePathSpec where import Control.Exception (evaluate) import Data.List (sort) import GHC.Exts (IsList (fromList, toList)) import System.FilePath ((</>)) import Test.Hspec.Meta import Nirum.Constructs (Construct (toCode)) import Nirum.Constructs.ModulePath (...
spoqa/nirum
test/Nirum/Constructs/ModulePathSpec.hs
gpl-3.0
5,410
0
18
1,926
1,533
850
683
106
1
module Paths_MipsPreprocessor ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -...
yyttr3/Mips_Preprocessor
dist/dist-sandbox-b8f9eba6/build/autogen/Paths_MipsPreprocessor.hs
gpl-3.0
1,592
0
10
182
371
213
158
28
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-rds/gen/Network/AWS/RDS/ListTagsForResource.hs
mpl-2.0
5,042
0
15
1,033
681
406
275
84
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-efs/gen/Network/AWS/EFS/DescribeTags.hs
mpl-2.0
5,716
0
14
1,243
874
521
353
102
1
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "Data/Aeson/Parser/Unescape.hs" #-} {-# LANGUAGE CPP #-} module Data.Aeson.Parser.Unescape ( unescapeText ) where import Data.Aeson.Parser.UnescapePure (unescapeText)
phischu/fragnix
tests/packages/scotty/Data.Aeson.Parser.Unescape.hs
bsd-3-clause
313
0
5
128
28
20
8
7
0
-- Copyright (c) 2015 Eric McCorkle. 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. Redistributions of source code must retain the above copyright -- notice, this list of conditions...
saltlang/dynamic-pprint
src/Text/Format.hs
bsd-3-clause
62,580
33
21
21,333
11,824
6,794
5,030
1,125
16
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "pure/Data/Aeson/Parser/UnescapePure.hs" #-} -- WARNING: This file is security sensitive as it uses unsafeWrite which does -- not check bounds. Any changes should be made with care and we would love to -- get informed about them, just cc us in any PR targetting this file: @eskimo...
phischu/fragnix
tests/packages/scotty/Data.Aeson.Parser.UnescapePure.hs
bsd-3-clause
9,616
0
20
2,791
3,140
1,668
1,472
224
28
{- | Module : $Header$ - Description : Implementation of logic instance of disjoint union of features - Copyright : (c) Daniel Hausmann & Georgel Calin & Lutz Schroeder, DFKI Lab Bremen, - Rob Myers & Dirk Pattinson, Department of Computing, ICL - License : GPLv2 or higher, see LICENSE.t...
keithodulaigh/Hets
GMP/GMP-CoLoSS/GMP/Logics/DisjUnion.hs
gpl-2.0
3,217
0
18
730
1,040
549
491
45
0
{-# LANGUAGE DeriveDataTypeable #-} module ApiAnnotation ( getAnnotation, getAndRemoveAnnotation, getAnnotationComments,getAndRemoveAnnotationComments, ApiAnns, ApiAnnKey, AnnKeywordId(..), AnnotationComment(..), IsUnicodeSyntax(..), unicodeAnn, HasE(..), LRdrName -- Exists for haddocks only ) wh...
nushio3/ghc
compiler/parser/ApiAnnotation.hs
bsd-3-clause
11,033
0
11
2,517
1,174
731
443
165
2
-- GSoC 2015 - Haskell bindings for OpenCog. {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE DataKinds #-} -- | This Module defines the main functions to interact with the Pattern Matcher. module OpenCog.AtomSpace.Query ( cogBind ) where import Control.Monad.IO.Class (liftIO) impo...
UIKit0/atomspace
opencog/haskell/OpenCog/AtomSpace/Query.hs
agpl-3.0
1,396
0
14
321
268
152
116
25
2
{-# LANGUAGE TypeApplications #-} module T11313 where x = fmap @(*) -- test error message output, which was quite silly before
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T11313.hs
bsd-3-clause
130
0
7
24
19
12
7
-1
-1
{-# LANGUAGE CPP, GADTs, UnboxedTuples #-} ----------------------------------------------------------------------------- -- -- Monad for Stg to C-- code generation -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmMonad ( ...
urbanslug/ghc
compiler/codeGen/StgCmmMonad.hs
bsd-3-clause
30,891
0
15
8,210
5,848
3,197
2,651
466
2
{-# LANGUAGE TemplateHaskell #-} module T5358 where import Language.Haskell.TH t1, t2 :: Int t1 x = x t2 x = x prop_x1 x = t1 x == t2 x $(return []) runTests = $( do VarI _ t _ _ <- reify (mkName "prop_x1") error $ ("runTest called error: " ++ pprint t) )
green-haskell/ghc
testsuite/tests/th/T5358.hs
bsd-3-clause
290
0
12
88
115
58
57
10
1
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} -- !!! Functional dependencies -- This broke an early impl of functional dependencies -- (complaint about ambiguity) module ShouldCompile where class C a b | a -> b where f :: a -> b g :: (C a b, Eq b) => a -> Bool g x = f x == f x
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc112.hs
bsd-3-clause
299
0
7
62
78
43
35
5
1
module MLCore where import Stats.Types import Linear import Control.Monad.State.Strict import qualified Data.Vector.Unboxed as VU import qualified Data.Vector.Generic as G import Data.Vector.Unboxed (Unbox) import Data.Vector.Unboxed.Deriving (derivingUnbox) type MLModel vp vs = ( LinAlg vp Double, LinAlg vs Doub...
yongqli/ghctestcase
src/MLCore.hs
isc
1,970
0
11
452
668
351
317
-1
-1
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, ImplicitParams, LambdaCase, MultiParamTypeClasses, MultiWayIf, TemplateHaskell, TypeSynonymInstances #-} {- _________ /\/\/ \/\/\ /\/\/\ /\/\/\ \ \ \ | / / / \ \ |\ | /| / / \\ | \ | / | // ...
nushio3/formura
src/Formura/MPICxx/Cut.hs
mit
21,777
10
31
6,057
6,624
3,411
3,213
431
17
module FrameWithProcessEvent ( frameWithProcessEvent ) where import Graphics.UI.WXCore import Graphics.UI.WX.Types import Graphics.UI.WX.Attributes import Graphics.UI.WX.Layout import Graphics.UI.WX.Classes import Graphics.UI.WX.Window import Graphics.UI.WX.TopLevelWindow import Graphics.UI.WX.Events import Graphi...
RudolfVonKrugstein/BiVision
FrameWithProcessEvent.hs
mit
2,453
0
19
424
643
356
287
40
3
module Framework.LangFramework where type Var = String type Label = String type Name = String data Op = Plus | Minus | Times | Divide deriving (Show, Eq) data Prim = I Int | V Var | L Label | True | False | Fn Name ...
cgswords/Grift
Framework/LangFramework.hs
mit
361
0
6
170
95
58
37
17
0
import Game.Cosanostra.Glue.Instances.JSON () import Game.Cosanostra.Game import Game.Cosanostra.Plan import Game.Cosanostra.Lenses import Control.Lens import Control.Monad.Except import Control.Monad.State import qualified Data.ByteString.Char8 as BS import Data.Yaml hiding ((.=)) import System.Environment main :: ...
rfw/cosanostra
glue/run-night.hs
mit
1,133
0
16
286
386
203
183
26
1
#!/usr/bin/env stack -- stack --install-ghc runghc --package turtle --package exceptions {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE DeriveAnyClass #-} module Main where import Prelude hiding (FilePath) import Turtle import qualified Data.Text as T import ...
stites/scripts
hs/exe/SafePathAdd.hs
mit
3,478
0
16
769
1,198
595
603
84
3
-- | Based on «Scrap Your Zippers: A Generic Zipper for Heterogeneous Types. -- Michael D. Adams. WGP '10: Proceedings of the 2010 ACM SIGPLAN -- workshop on Generic programming, 2010» -- (<http://michaeldadams.org/papers/scrap_your_zippers/>). -- -- Compared to the original @syz@ package, this implementation (based o...
feuerbach/traverse-with-class
Data/Generics/Traversable/Zipper.hs
mit
8,921
0
12
2,023
2,180
1,161
1,019
-1
-1
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-} data Foo = Foo {a :: Int, b :: Int} foo Foo{b, ..} = a
Pnom/haskell-ast-pretty
Test/examples/RecordWildcards.hs
mit
106
0
8
22
40
23
17
3
1
module Q27 where combineWithRest :: [a] -> Int -> [([a],[a])] combineWithRest [] _ = [] combineWithRest (p:q) 1 = let rest = combineWithRest q 1 in ([p],q):(map (\(x, y) -> (x, p:y)) rest) combineWithRest (p:q) r = let restTake = (combineWithRest q (r-1)) restDrop = (combineWithRest q r) ...
cshung/MiscLab
Haskell99/q27.hs
mit
558
0
13
136
379
212
167
15
1
{-# htermination lookup :: (Eq a, Eq k) => (Either a k) -> [((Either a k),b)] -> Maybe b #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_lookup_11.hs
mit
93
0
2
20
3
2
1
1
0
{- OEML - REST API This section will provide necessary information about the `CoinAPI OEML REST API` protocol. <br/> This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> <br/><br/> Implemented Standards: * [HTTP1....
coinapi/coinapi-sdk
oeml-sdk/haskell-http-client/lib/OEML-REST/Client.hs
mit
9,415
4
21
1,863
2,192
1,157
1,035
-1
-1
module System.AtomicWrite.Writer.TextSpec (spec) where import Test.Hspec (it, describe, shouldBe, Spec) import System.AtomicWrite.Writer.Text (atomicWriteFile, atomicWriteFileWithMode) import System.IO.Temp (withSystemTempDirectory) import System.FilePath.Posix (joinPath) import System.PosixCompat.Files (setFileMo...
stackbuilders/atomic-write
spec/System/AtomicWrite/Writer/TextSpec.hs
mit
4,883
0
18
1,240
882
431
451
74
1
module Feature.Comment.PG where import ClassyPrelude import Feature.Comment.Types import Feature.Auth.Types import Platform.PG import Database.PostgreSQL.Simple.SqlQQ import Database.PostgreSQL.Simple findComments :: PG r m => Maybe UserId -> Slug -> Maybe CommentId -> m [Comment] findComments mayUserId slug mayComme...
eckyputrady/haskell-scotty-realworld-example-app
src/Feature/Comment/PG.hs
mit
2,552
0
12
783
491
257
234
-1
-1
import Declar import Environment import Parser import Syntax import Typing import Control.Exception import System.IO importFile :: String -> IO Handle importFile s = openFile ("lib/" ++ s ++ ".hs") ReadMode driverLoop :: Handle -> Handle -> TyState -> TyEnv -> Env -> IO (TyState, TyEnv, Env) dr...
asi1024/haling
src-exec/main.hs
mit
1,656
0
31
533
624
308
316
46
4
{-# LANGUAGE TypeFamilies,StandaloneDeriving,CPP #-} module UnitB.UnitB ( module UnitB.Syntax , module UnitB.UnitB , theory_po ) where -- Modules import UnitB.Expr import UnitB.PO import UnitB.Syntax import Logic.Expr.Scope import Logic.Proof import Logic.Proof.Tactics hiding (assert) --import ...
literate-unitb/literate-unitb
src/UnitB/UnitB.hs
mit
10,287
0
17
2,666
3,317
1,722
1,595
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Services.TextAndImages ( routes ) where import Control.Monad (replicateM_) import Snap.Blaze (blaze) import Simulation.Node.Service.Http ( HttpService , Routes (..) , putResponse ) import Simulation.Node.Service.Http.Server ( static , mkPrefixFunc ,...
kosmoskatten/programmable-endpoint-demo
src/Services/TextAndImages.hs
mit
1,759
0
20
548
507
281
226
44
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGLinearGradientElement (js_getX1, getX1, js_getY1, getY1, js_getX2, getX2, js_getY2, getY2, SVGLinearGradientElement, castToSVGLinearGradientElement, gTypeSVGLinearGradientElement) ...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGLinearGradientElement.hs
mit
2,745
24
10
365
638
377
261
43
1
module JSON(JValue(..), JSONSerializable(..), isNull, prettifiedJSONString) where import JSON.Type(JValue(..), JSONSerializable(..), isNull) import JSON.Parser import JSON.Prettify prettifiedJSONString :: String -> String prettifiedJSONString str = either show prettyJSON $ parseJSON str
zsedem/haskell-playground
json-parser/src/JSON.hs
mit
289
0
6
29
89
54
35
6
1
module Ruab.Backend -- exports {{{1 ( module Ruab.Backend.GDB , setup ) where -- imports {{{1 import Ruab.Backend.GDB hiding (setup) import qualified Ruab.Backend.GDB as B import Ruab.Options (Options(optGdbLog, optBinary)) setup :: Options -> Callback -> IO Context -- {{{1 setup opt callback = B.setup (optGdbL...
copton/ocram
ruab/src/Ruab/Backend.hs
gpl-2.0
353
0
7
56
105
64
41
9
1
{- | Module : $Header$ Description : RDF Morphism Copyright : (c) Francisc-Nicolae Bungiu, Felix Gabriel Mance, 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : f.bungiu@jacobs-university.de Stability : provisional Portability : portable Morphisms for RDF -} module RDF.Morphism where...
nevrenato/HetsAlloy
RDF/Morphism.hs
gpl-2.0
5,335
0
16
1,414
315
173
142
29
1
{-# LANGUAGE TypeFamilies #-} {- Cheap and cheesy lists with sizes in their types. - Copyright : (C)opyright 2006, 2011 peteg42 at gmail dot com - License : GPL (see COPYING for details) - - We count from /1/ to /n/, i.e. the first element of the list has index 1. -} module ADHOC.Data.SizedLists where ---...
peteg/ADHOC
ADHOC/Data/SizedLists.hs
gpl-2.0
8,079
154
14
1,979
1,919
1,267
652
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Lib.Set ( filterA, partitionA ) where import Prelude.Compat import Data.Set (Set) import qualified Data.Set as S import qualified Lib.List as L filterA :: (Applicative f, Ord k) => (k -> f Bool) -> Set k -> f (Set k) filterA p = fmap S.fromAscList . L.filterA p . S.to...
da-x/buildsome
src/Lib/Set.hs
gpl-2.0
622
0
10
133
270
141
129
14
2
base :: [Integer] base = [1..9] seqs :: (Num a1, Ord a1) => a1 -> [a] -> [[a]] seqs n [] = if n > 0 then [] else [[]] seqs n (x:s) | n == 0 = [[]] | True = map (x:) (seqs (n-1) s) ++ seqs n s diagNeg :: [[Integer]] -> [[Integer]] diagNeg = zipWith (zipWith (*)) . (repeat 1:) . iterate (1:) $ (negate 1:repeat ...
xkollar/handy-haskell
other/js-2016-07/js-2016-07.hs
gpl-3.0
1,711
0
12
556
789
445
344
45
2
{-# LANGUAGE FlexibleInstances , UndecidableInstances #-} module Data.Pickle ( encode , decode , Picklable(..)) where import Data.ByteString import qualified Data.Serialize as S class Picklable a where dumps :: a -> ByteString loads :: ByteString -> Either String a -- ...
br0ns/hindsight
src/Data/Pickle.hs
gpl-3.0
565
0
8
139
147
82
65
18
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeF...
merijn/GPU-benchmarks
benchmark-analysis/src/Schema/Platform/V0.hs
gpl-3.0
725
0
8
99
89
60
29
17
0
module System.DevUtils.Base.Url.Session ( Session(..), defaultSession ) where import qualified System.DevUtils.Base.Url.Auth as A import qualified System.DevUtils.Base.Url.Connection as C data Session = Session { _auth :: Maybe A.Auth, _con :: C.Connection } deriving (Show, Read) defaultSession :: Session defaul...
adarqui/DevUtils-Base
src/System/DevUtils/Base/Url/Session.hs
gpl-3.0
387
0
10
54
108
71
37
11
1
#!/usr/bin/runhaskell import Distribution.Simple main :: IO () main = defaultMain
styx/gtc
Setup.hs
gpl-3.0
83
0
6
11
22
12
10
3
1
module Country where import Data.SafeCopy import Data.Typeable import qualified Data.Map as M import qualified Data.Aeson as J import qualified Data.Text.Lazy.Encoding as E import qualified Data.Text.Lazy as L import Data.Time.Clock import GHC.Generics import Network.URL type IsoCodeAlpha2 = String data Country = Co...
dservgun/erp
src/common/Country.hs
gpl-3.0
1,559
0
8
345
457
252
205
-1
-1
module Data.IntSet (module X) where import "containers" Data.IntSet as X
wdanilo/container
src/Data/IntSet.hs
apache-2.0
74
0
4
11
20
14
6
-1
-1
-- -- Copyright : (c) T.Mishima 2014 -- License : Apache-2.0 -- {-# LANGUAGE BangPatterns #-} module Bindings.OculusRift where import Foreign.Ptr import Foreign.C.String import Foreign.C.Types import Foreign.Storable import Foreign.Marshal.Array import Foreign.Marshal.Alloc import Data.Word import Bindings.OculusR...
tmishima/bindings-Oculus
Bindings/OculusRift.hs
apache-2.0
27,373
0
21
5,162
2,703
1,479
1,224
201
3
{-# LANGUAGE LambdaCase, NoMonomorphismRestriction, OverloadedStrings #-} import Control.Applicative ((<$),(<$>),(<*),(<*>),(*>)) import Control.Monad import Data.Aeson import Data.Char import System.Environment import Text.Parsec import qualified Data.ByteString.Lazy.Char8 as L import qualified Data.HashMap.Lazy as H ...
aweinstock314/haskell-ropc
jsonderef.hs
apache-2.0
2,563
0
13
356
847
469
378
36
2
module Sarsi.Processor where import qualified Codec.GHC.Log as GHC import Codec.Sarsi (Message) import Codec.Sarsi.GHC (fromGHCLog) import qualified Codec.Sarsi.Nix as Nix import qualified Codec.Sarsi.Rust as Rust import qualified Codec.Sarsi.SBT.Machine as SBT import qualified Codec.Sarsi.Scala as Scala import Data.A...
aloiscochard/sarsi
src/Sarsi/Processor.hs
apache-2.0
2,363
0
16
377
830
458
372
46
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE Safe #-} {-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} {-# OPTIONS_HADDOCK show-extensions #-} {-| Co...
Ericson2314/clash-prelude
src/CLaSH/Prelude/Synchronizer.hs
bsd-2-clause
6,526
0
14
2,126
1,180
670
510
-1
-1
module Pkgs.Main where import Control.Monad.Except import Data.Either import Text.Parsec (ParseError) import Pkgs.Parser import Pkgs.Syntax import Pkgs.Pretty import Pkgs.Repository import Pkgs.TypeCheck import Pkgs.Eval type Compiler = ExceptT Error IO data Error = ParsingError String | TypingError String | Evaluat...
markflorisson/packages
Pkgs/Main.hs
bsd-3-clause
2,365
0
11
584
739
360
379
55
2
{-# LANGUAGE DeriveFunctor #-} module Drive.HTTP.Types ( HttpF (..) , HttpUriF (..) , HttpHeaderF (..) , HttpError (..) ) where import qualified Data.ByteString.Lazy as BS import qualified Network.Wreq as Wreq type Uri = String data HttpError = RequestError String | NoContent deriving (Sho...
palf/free-driver
packages/drive-http/lib/Drive/HTTP/Types.hs
bsd-3-clause
623
0
10
135
197
121
76
22
0
{-# LANGUAGE RankNTypes #-} module Core.Tag where import Utilities import Core.FreeVars import Core.Size import Core.Syntax tagTerm :: IdSupply -> Term -> TaggedTerm tagTerm = mkTagger (\i f (I e) -> Tagged (mkTag (hashedId i)) (f e)) tagFVedTerm :: IdSupply -> SizedFVedTerm -> TaggedSizedFVedTerm tagFVedTerm = mk...
batterseapower/chsc
Core/Tag.hs
bsd-3-clause
3,121
0
20
950
1,273
641
632
59
9
-- | -- Module: $HEADER$ -- Description: Provide exclusive access to a resource using lock file. -- Copyright: (c) 2013 Peter Trsko -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experimental -- Portability: portable -- -- Provide exclusive access to a resource using lock fi...
trskop/lock-file-resourcet
src/System/IO/LockFile/Resource.hs
bsd-3-clause
1,174
0
8
272
203
129
74
27
1
-- Implementation of the variable elimination algorithm -- from the paper -- Toward Good Elimination Orders for Symbolic SAT Solving -- by Jinbo Huang and Adnan Darwiche {-# LANGUAGE BangPatterns #-} module VariableEliminationOBDD ( variableEliminationOBDD , variableEliminationOBDDUsingDTree ) whe...
malie/drolesat
VariableEliminationOBDD.hs
bsd-3-clause
4,172
0
23
1,353
1,064
571
493
95
6
; ; HSP help manager—p HELPƒ\[ƒXƒtƒ@ƒCƒ‹ ; (æ“ª‚ªu;v‚̍s‚̓Rƒƒ“ƒg‚Æ‚µ‚ďˆ—‚³‚ê‚Ü‚·) ; %type Šg’£–½—ß %ver 3.3 %note llmod3.hsp,misc.hsp‚ðƒCƒ“ƒNƒ‹[ƒh‚·‚é %date 2009/08/01 %author tom %dll llmod3 %url http://www5b.biglobe.ne.jp/~diamond/hsp/hsp2file.htm %index tooltip ƒc[ƒ‹ƒ`ƒbƒv‚ð•t...
zakki/openhsp
package/hsphelp/llmod3_misc.hs
bsd-3-clause
1,833
667
16
304
1,595
871
724
-1
-1
module Tests.Testframe where import Test.HUnit import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as C import qualified Data.ByteString as B import Text.ParserCombinators.Parsec import Control.Applicative ((*>),(<*),(<*>),(<$>)) import Data.Word (Word8) import Control.Mo...
hakoja/SHA3
Tests/testframe.hs
bsd-3-clause
5,678
0
12
1,153
1,432
773
659
106
2
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module LambdaHive.AI where import AI.Minimax import Control.DeepSeq import qualified Data.Bimap as Bimap import Data.Bool import qualified Data.IGraph as IG import qualifie...
z0isch/lambda-hive
src/LambdaHive/AI.hs
bsd-3-clause
5,389
0
19
1,451
1,815
939
876
125
4
{- parse-dimacs is free software: it is released under the BSD3 open source license. You can find details of this license in the file LICENSE at the root of the source tree. Copyright 2008 Denis Bueno -} -- | A simple module for parsing CNF files in DIMACS format. module Language.CNF.Parse.ParseDIMA...
rbonifacio/funsat
etc/parse-dimacs/Language/CNF/Parse/ParseDIMACS.hs
bsd-3-clause
2,921
0
11
633
605
347
258
60
1
{-# LANGUAGE OverloadedStrings #-} module Fakemain where import Brick.Main import Brick.BChan import Control.Concurrent import Control.Monad import Graphics.Vty import Data.Default import Network.Wreq import Control.Lens import System.Environment.XDG.BaseDir import Network.HTTP.Conduit import Data.Scientific import Te...
Frefreak/hnem
src/Fakemain.hs
bsd-3-clause
1,878
0
20
518
540
272
268
-1
-1
module Language.SystemF.Parser where import Language.SystemF.Syntax import Text.ParserCombinators.Parsec hiding (runParser,char,string,space) import qualified Text.ParserCombinators.Parsec as P import Data.Char import Data.List import Control.Monad import Data.Maybe ---------------------------------------------------...
andygill/er-systemf
Language/SystemF/Parser.hs
bsd-3-clause
6,533
0
20
2,421
2,010
961
1,049
168
2
-- some tests for behaviors. module Main ( main ) where import Sirea.Prelude bHelloWorld = bconst "Hello, World!" >>> bprint main :: IO () main = print "before hw app (ctrl+c to halt)" >> runSireaApp bHelloWorld >> print "after hw app"
dmbarbour/Sirea
tst/Hello.hs
bsd-3-clause
268
0
7
73
59
31
28
9
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE UnicodeSyntax #-} {-| [@ISO639-1@] - [@ISO639-2@] - [@ISO639-3@] kmr [@Native name@] - [@English name@] Kurmanji -} module Text.Numeral.Language.KMR.TestData (cardin...
telser/numerals
src-test/Text/Numeral/Language/KMR/TestData.hs
bsd-3-clause
6,274
0
8
1,985
1,633
1,091
542
183
1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell [lq| type Vec a N = {v:[a] | len v = N } |] [lq| ok :: Vec Int 3 |] ok = [1,2,3] :: [Int] [lq| ok' :: Vec _ 3 |] -- would be nice to support the hole in the application.. ok' = [1,2,3]
spinda/liquidhaskell
tests/gsoc15/unknown/pos/hole-app.hs
bsd-3-clause
250
0
5
68
61
41
20
7
1
module Control.Bind where import Control.Apply class Apply f => Bind f where (=<<) :: (a -> f b) -> f a -> f b
tonymorris/lens-proposal
src/Control/Bind.hs
bsd-3-clause
127
0
10
40
58
30
28
7
0
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : dave.laing.80@gmail.com Stability : experimental Portability : non-portable -} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} ...
dalaing/type-systems
src/Fragment/Annotation/Ast/Term.hs
bsd-3-clause
3,348
0
10
590
1,186
631
555
59
0
----------------------------------------------------------------------------- -- | -- Module : Text.PrettyPrint.Annotated -- Copyright : (c) Trevor Elliott <revor@galois.com> 2015 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : David Terei <code@davidterei.com> -- Stability : stable...
ddssff/pretty-listlike
src/Text/PrettyPrint/Annotated.hs
bsd-3-clause
2,026
0
5
552
234
171
63
25
0
{-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} module Language.C.Inline.FunPtr ( mkFunPtr , mkFunPtrFromName , peekFunPtr , uniqueFfiImportName ) where import Foreign.Ptr (FunPtr) import qualified Language.Haskell.TH as TH import qualified Language.Haskell.TH.Sy...
Teaspot-Studio/inline-c
src/Language/C/Inline/FunPtr.hs
mit
2,080
0
11
352
329
188
141
31
2
{-# LANGUAGE BangPatterns #-} module LocalRef where import Prelude hiding (lookup) -- difference a b = foldlWithKey' go where go = case "oaeu" of "oeu" -> "oqeju" _ -> "oeuoeu" {-# INLINABLE difference #-} -- intersection a b = foldlWithKey' go (5 :: Int) 3 1 where ...
google/haskell-indexer
haskell-indexer-backend-ghc/testdata/basic/LocalRef.hs
apache-2.0
392
0
9
119
106
59
47
10
2
{-# LANGUAGE TemplateHaskell, FunctionalDependencies #-} {-| Implementation of the Ganeti Disk config object. -} {- Copyright (C) 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 are met: 1. ...
onponomarev/ganeti
src/Ganeti/Objects/Disk.hs
bsd-2-clause
11,302
0
19
2,698
2,391
1,255
1,136
202
17
-- | -- Module : Codec.Binary.DataEncoding -- Copyright : (c) 2007 Magnus Therning -- License : BSD3 -- -- This module exposes several instances of 'DataCodec', one for each data -- encoding implemented in the library without causing the name clashing that -- would result from importing the individual encoding mod...
magthe/dataenc
src/Codec/Binary/DataEncoding.hs
bsd-3-clause
4,310
0
11
877
759
501
258
100
1
module System.Console.GetOpt.Generics.Modifier.Types where data Modifiers = Modifiers { shortOptions :: [(String, [Char])], renaming :: String -> String, positionalArgumentsField :: Maybe (String, String), _helpTexts :: [(String, String)], version :: Maybe String } getVersion :: Modifiers -> Maybe String ...
kosmikus/getopt-generics
src/System/Console/GetOpt/Generics/Modifier/Types.hs
bsd-3-clause
655
0
11
91
180
103
77
14
1
module Halfs.File ( FileHandle (..) -- fhInode, fhReadable, fhWritable) , createFile , fofReadOnly , fofWriteOnly , fofReadWrite , getFHINR_lckd , openFilePrim , closeFilePrim , removeFile ) where import Halfs.BlockMap import Halfs.Classes import Halfs.Directory import Halfs.Errors import Halfs.Ha...
hackern/halfs
Halfs/File.hs
bsd-3-clause
6,496
0
28
2,000
1,396
697
699
120
3
module Graphics.Vty.UnicodeWidthTable.Types ( UnicodeWidthTable(..) , WidthTableRange(..) ) where import Data.Word (Word8, Word32) -- | A range of code points in a width table. data WidthTableRange = WidthTableRange { rangeStart :: Word32 -- ^ The range's starting code point. ...
jtdaugherty/vty
src/Graphics/Vty/UnicodeWidthTable/Types.hs
bsd-3-clause
1,046
0
9
388
110
73
37
12
0