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 DeriveDataTypeable #-} {- | Module : ./THF/As.der.hs Description : A abstract syntax for the TPTP-THF Syntax Copyright : (c) A. Tsogias, DFKI Bremen 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : Alexis.Tsogias@dfki.de Stability : provisional Portability : portable A Ab...
spechub/Hets
THF/As.der.hs
gpl-2.0
12,422
0
8
2,670
2,958
1,674
1,284
326
0
{------------------------------------------------------------------------------- Copyright: The Hatchet Team (see file Contributors) Module: TypeSigs Description: Collects all the type signatures from a module Primary Authors: Bernie Pope, ...
dec9ue/jhc_copygc
src/FrontEnd/TypeSigs.hs
gpl-2.0
4,267
0
10
749
1,201
621
580
88
1
{-# LANGUAGE ScopedTypeVariables #-} module PolyLet where f :: forall a . a -> ([a],[a]) f x = let g :: forall b . b -> [a] g _ = [x] in (g x,g [True]) -- Recursive variant that doesn't disappear in optimisation, -- and x occurs free in g frec :: forall a . a -> ([a],[a]) frec x = let g :: forall...
danr/hipspec
tfp1/tests/should_fail/PolyLet.hs
gpl-3.0
419
0
11
131
211
119
92
13
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.Config.Types.Sum -- Copyr...
fmapfmapfmap/amazonka
amazonka-config/gen/Network/AWS/Config/Types/Sum.hs
mpl-2.0
6,791
0
12
1,451
1,182
600
582
157
0
{-# 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-devicefarm/gen/Network/AWS/DeviceFarm/GetDevicePool.hs
mpl-2.0
4,044
0
13
900
582
348
234
75
1
{- Copyright 2015,2016 Markus Ongyerth, Stephan Guenther This file is part of Monky. Monky is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at y...
Ongy/monky
Monky/Examples/Time.hs
lgpl-3.0
2,417
0
15
557
363
207
156
37
1
-- | This is a simple static image widget, and a polling image widget that -- updates its contents by calling a callback at a set interval. module System.Taffybar.Widget.Generic.Icon ( iconImageWidgetNew , iconImageWidgetNewFromName , pollingIconImageWidgetNew , pollingIconImageWidgetNewFromName ) where impo...
teleshoes/taffybar
src/System/Taffybar/Widget/Generic/Icon.hs
bsd-3-clause
3,975
0
24
775
690
363
327
64
1
-- | -- Module : Crypto.Random.Entropy.RDRand -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : Good -- {-# LANGUAGE ForeignFunctionInterface #-} module Crypto.Random.Entropy.RDRand ( RDRand ) where import Foreign.Ptr import Fore...
vincenthz/cryptonite
Crypto/Random/Entropy/RDRand.hs
bsd-3-clause
1,080
0
8
195
228
127
101
22
2
------------------------------------------------------------------------------- -- | -- Module : CCO.Tree.ATerm.Lexer -- Copyright : (c) 2008 Utrecht University -- License : All rights reserved -- -- Maintainer : stefan@cs.uu.nl -- Stability : provisional -- Portability : portable -- -- A 'Lexer' fo...
UU-ComputerScience/uu-cco
uu-cco/src/CCO/Tree/ATerm/Lexer.hs
bsd-3-clause
6,373
0
18
1,357
1,438
790
648
93
1
module FunIn2 where --A new definition can be introduced to denote an identified sub-expression. --The newly introduced definition may be a function binding --or a simple constant binding. The new binding will be put at the end of the --local 'where' or 'let' clause depending on the scope of high lighted source. --I...
kmate/HaRe
old/testing/introNewDef/FunIn2.hs
bsd-3-clause
525
0
9
122
61
35
26
4
1
module A3 where import D3 main = sumSquares [1..4]
kmate/HaRe
old/testing/addOneParameter/A3.hs
bsd-3-clause
55
0
6
13
20
12
8
3
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Machine-dependent assembly language -- -- (c) The University of Glasgow 1993-2004 -- ----------------------------------------------------------------------------- #include "HsVersions.h" #include "nativeGen/NCG.h"...
wxwxwwxxx/ghc
compiler/nativeGen/PPC/Instr.hs
bsd-3-clause
25,211
0
18
8,715
6,686
3,448
3,238
438
60
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, ForeignFunctionInterface, DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-} ----------------------------------------------------------------------------- -- | -- Mo...
jtojnar/haste-compiler
libraries/ghc-7.8/base/GHC/Conc/Windows.hs
bsd-3-clause
11,367
4
22
2,473
2,763
1,434
1,329
-1
-1
module StockMarket where import Data.Ix (Ix) import GTL.Data.Dynamic (DynamicXAS) import GTL.Data.Utility (UtilityXAS) import GTL.Data.Signaling (SignalingWXAS, SignalingWXAS2) import GTL.Numeric.Probability (Trans, Dist, joint2) import Numeric.Probability.Distribution (choose, certainly) data Order = Sell | Hold | B...
dudebout/cdc_2012_dudebout_shamma
simulations/StockMarket.hs
isc
3,069
0
11
895
1,298
678
620
79
5
module Plugins.Core.Main (plugin, main) where import Plugins.Types import Data.Time import Data.IORef import Data.Maybe(listToMaybe) import Control.Concurrent ( threadDelay,forkIO ) import Control.Monad ( forever,when,liftM ) import System.Exit ( exitSuccess ) import Reactive.Banana import Graphics.Rendering.OpenGL i...
andrey013/pluginstest
Plugins/Core/Main.hs
mit
4,249
1
28
1,367
1,274
624
650
89
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE InstanceSigs #-} module GenericGraph (module GenericGraph, Ix, ) where import Data.List (union, nub) import qualified Data.Array as Array (bounds) import Data.Array hiding...
shouya/thinking-dumps
graph/GenericGraph.hs
mit
1,226
0
11
268
445
244
201
30
1
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.NavigatorUserMediaSuccessCallback (newNavigatorUserMediaSuccessCallback, newNavigatorUserMediaSuccessCall...
ghcjs/jsaddle-dom
src/JSDOM/Generated/NavigatorUserMediaSuccessCallback.hs
mit
3,090
0
13
771
561
335
226
51
1
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE DataKinds, KindSignatures, PolyKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs, RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} --{-# LANGUAGE NoMonomorphismRestriction #-} module FactorGraph where import Control.Applicati...
vladfi1/hs-misc
FactorGraph/FactorGraphVinyl.hs
mit
2,466
0
14
613
870
466
404
58
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.NavigatorUserMediaErrorCallback (newNavigatorUserMediaErrorCallback, newNavigatorUserMediaErrorCallbackSync, newNavigatorUserMediaErrorCallbackAsync, NavigatorUserMediaErrorCallback)...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/NavigatorUserMediaErrorCallback.hs
mit
2,812
0
12
679
521
310
211
47
1
module MAL.API ( module MAL.API.Add , module MAL.API.Delete , module MAL.API.List , module MAL.API.Search , module MAL.API.Update , module MAL.API.Verify ) where import MAL.API.Add import MAL.API.Delete import MAL.API.List import MAL.API.Search import MAL.API.Update import MAL.API.Verify
nyorem/skemmtun
src/MAL/API.hs
mit
319
0
5
64
86
59
27
13
0
module Exercise where type Item a = (a, Int) type Bag a = [Item a] subbag :: Eq a => Bag a -> Bag a -> Bool subbag sub bag = and $ map (\(a, n) -> (countItem a bag) >= n) sub getItem :: Eq a => a -> Bag a -> Item a getItem item [] = (item, 0) getItem item (it@(a, _):bag) | a == item = it ...
tcoenraad/functioneel-programmeren
2013/opg1b.hs
mit
449
0
11
135
247
129
118
12
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleContexts, FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} module Data.WordCount.CHP.Core ( lineCounter, wordCounter, charCounter, byteCounter, CHPCounter, runCounter ) where import Data.WordCount.Types (Counts(..), CountsUpdater, upLines,...
yanatan16/haskell-chp-wc
src/Data/WordCount/CHP/Core.hs
mit
3,812
0
13
705
1,392
741
651
71
1
-- everything neccessary for building VMs module PPL2.VM ( module PPL2.VM.Types , module PPL2.VM.Memory.State , module PPL2.VM.Control.Instructions , module PPL2.VM.Control.Loop , module PPL2.VM.Control.MicroOps , module PPL2.VM.Control.Types , module PPL2.VM.ALU.Types ...
UweSchmidt/ppl2
src/PPL2/VM.hs
mit
665
0
5
130
133
96
37
17
0
module Hoton.MatrixSpec (main, spec) where import Test.Hspec import Hoton.Matrix import Hoton.Vector import Hoton.TestUtils main :: IO () main = hspec spec spec :: Spec spec = do let ex = Cartesian 1 0 0 let ey = Cartesian 0 1 0 let ez = Cartesian 0 0 1 describe "Hoton.Matrix.mvmul" $ do it...
woufrous/hoton
test/Hoton/MatrixSpec.hs
mit
2,744
0
18
750
954
510
444
49
1
module GUI_Cpu ( createCpuWindow ) where ------------- --LIBRARIES-- ------------- import Map import Block import Solver import Levels import Data.Char import Movement as Mv import Graphics.UI.WX import Control.Concurrent import Graphics.UI.WXCore as Wx ----------- --METHODS-- ----------- createCpuWindow :: IO() ...
BrunoAltadill/Bloxorz_2D
code/GUI_Cpu.hs
mit
9,407
0
20
3,321
2,773
1,383
1,390
168
24
module TelescopeParser where import qualified Data.ByteString.Char8 as B import Data.Attoparsec.ByteString.Char8 as AB import Data.Word import Data.List import Control.Monad import Control.Applicative data TelescopeTag = TelescopeTag B.ByteString deriving (Eq) data TelescopeTree = TelescopeNode TelescopeTag [Telescop...
wangell/towhead
TelescopeParser.hs
mit
1,124
4
12
195
324
171
153
33
1
module Main where import Bio.Seq.IO (mkIndex) import System.Environment main :: IO () main = do (outF: inputs) <- getArgs mkIndex inputs outF
kaizhang/bioinformatics-toolkit
bioinformatics-toolkit-apps/app/MkIndex.hs
mit
153
0
9
33
57
31
26
7
1
{-# OPTIONS -w -O0 #-} {- | Module : COL/ATC_COL.der.hs Description : generated Typeable, ShATermConvertible instances Copyright : (c) DFKI Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable(overlapping Ty...
nevrenato/Hets_Fork
COL/ATC_COL.der.hs
gpl-2.0
1,115
0
4
162
72
49
23
12
0
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} -- | -- Module : Aura.Build -- Copyright : (c) Colin Woodbury, 2012 - 2020 -- License : GPL3 -- Maintainer: Colin Woodbury <colin@fosskers.ca> -- -- Agnostically builds packages, regardless of original source. module Aura.Build ( installPkgFiles , b...
bb010g/aura
aura/lib/Aura/Build.hs
gpl-3.0
7,894
0
21
1,749
2,097
1,022
1,075
148
2
module InferExamples where import InferWrappers import InferCombinators factorialExpr :: InferResults t factorialExpr = lambda "x" iInt $ \x -> getDef "if" $$ iInt $$: [ getDef "==" $$ iInt $$: [x, literalInteger 0] , literalInteger 1 , getDef "*" $$ iInt $$: [ x , recurse (integerType ~> intege...
MatiasNAmendola/lamdu
test/InferExamples.hs
gpl-3.0
2,556
0
27
740
959
499
460
73
1
fmap :: (a -> b) -> (r -> a) -> (r -> b)
hmemcpy/milewski-ctfp-pdf
src/content/1.7/code/haskell/snippet21.hs
gpl-3.0
40
0
8
12
35
19
16
1
0
-- | Datastructures for nHMMER hidden Markov models, representing RNA families -- For more information on nHMMER consult <http://eddylab.org/infernal/> module Bio.HMMData where import qualified Data.Vector as V -- | Data structure for HMMER data HMMER3 = HMMER3 { -- File format version; mandatory version...
eggzilla/BioHMM
src/Bio/HMMData.hs
gpl-3.0
3,341
0
10
824
500
317
183
53
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Test.HUnit(Test(..)) import JumpieTestLevelGeneration import Test.Framework import Test.Framework.Providers.HUnit import ClassyPrelude main :: IO () main = defaultMain ( hUnitTestToTests (TestList [ jumpieTestLevelGeneration ] ) )
pmiddend/jumpie
tests/Main.hs
gpl-3.0
293
0
10
34
70
42
28
9
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Class.String where import Data.Char(toLower) import System.Process(CreateProcess,createProcess,proc) import Data.Dates(WeekDay(..),weekdayNumber,intToWeekday) -- dates import Data.Time.Clock(UTCTime(..),addUTCTime,NominalDiffTime,getCurren...
shinjiro-itagaki/shinjirecs
shinjirecs-api/src/Class/String.hs
gpl-3.0
3,831
0
13
947
1,310
730
580
87
3
main :: IO() --funcion que recolle o nome do receptor toPart recipient = "Dear " ++ recipient ++ ",\n" --funcion que recolle o titulo bodyPart title = "Thanks for selling " ++ title ++ ".\n" --funcion que recolle o destinatario fromPart author = "Thanks, \n" ++ author --funcion que compon o string do mail createEm...
jmlb23/haskell
ch00/first_prog.hs
gpl-3.0
610
0
9
114
157
75
82
13
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} module FuncTorrent.ServerThread where import Control.Concurrent import Control.Exception.Base (bracket) import Control.Monad.IO.Class import Control.Monad.Trans.Maybe import Data.ByteString (ByteString) import Network import System.IO import FuncTorrent...
jaseemabid/functorrent
src/FuncTorrent/ServerThread.hs
gpl-3.0
3,756
0
18
809
992
508
484
91
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-containeranalysis/gen/Network/Google/Resource/ContainerAnalysis/Projects/Occurrences/Create.hs
mpl-2.0
5,254
0
17
1,170
780
455
325
113
1
{-# LANGUAGE KindSignatures, GADTs, PatternGuards, TypeOperators , FlexibleContexts #-} {-# OPTIONS_GHC -Wall #-} ---------------------------------------------------------------------- -- | -- Module : Shady.Language.Operator -- Copyright : (c) Conal Elliott 2009 -- License : GPLv3 -- -- Mai...
sseefried/shady-gen
src/Shady/Language/Operator.hs
agpl-3.0
12,282
0
15
3,478
4,916
2,501
2,415
193
2
{- arch-tag: Network.Utils.FTP.Parser tests main file Copyright (C) 2004 John Goerzen <jgoerzen@complete.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 y...
icetortoise/ftphs
testsrc/Network/FTP/Parsertest.hs
lgpl-2.1
2,019
0
11
485
175
99
76
14
1
module QuickChecks where import Test.Tasty.QuickCheck (forAll, listOf, arbitrary, Positive(..), testProperty) import Test.Tasty (testGroup) import Data.HaskID (encode, haskid, decode) round_trip_prop :: [Positive Int] -> Bool round_trip_prop xs = decode haskid (encode haskid xs') == xs' ...
bryant/haskid
test/QuickChecks.hs
apache-2.0
433
0
8
85
127
72
55
9
1
{-# LANGUAGE FlexibleContexts #-} module Network.Kibr.Http where import Preamble import Prelude (notElem) import Control.Monad.Reader (MonadReader, ask, asks) import Control.Monad.Trans (MonadIO) import Data.Acid (QueryEvent, EventResult) import Data.Acid.Advanced (quer...
dag/kibr
src/Network/Kibr/Http.hs
bsd-2-clause
3,774
0
13
1,094
1,053
559
494
113
4
import Data.Array import qualified Data.Array.Unboxed as U import qualified Data.Foldable as Fld import Data.Functor import Data.List import qualified Data.Map as Map import Data.Maybe import qualified Data.Sequence as Seq sqd xs = (x, xs') where (x Seq.:< xs') = Seq.viewl xs data Sp a b = Sp a b deriving...
pbl64k/HackerRank-Contests
2014-06-20-FP/BoleynSalary/bs.merge.hs
bsd-2-clause
4,161
0
22
1,542
1,865
982
883
90
4
-- | -- Module: $Header$ -- Description: Representation of all the names and paths under wich Command -- Wrapper toolset is known. -- Copyright: (c) 2018-2020 Peter Trško -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experimental -- Portability: GHC specific language ...
trskop/command-wrapper
command-wrapper-core/src/CommandWrapper/Core/Environment/AppNames.hs
bsd-3-clause
9,741
0
19
2,326
1,288
774
514
-1
-1
-- Copyright (c) 2014-present, Facebook, Inc. -- All rights reserved. -- -- This source code is distributed under the terms of a BSD license, -- found in the LICENSE file. {-# LANGUAGE OverloadedStrings #-} module TestBadDataSource (tests) where import Haxl.Prelude as Haxl import Prelude() import Haxl.Core import D...
jiayuanmark/Haxl
tests/TestBadDataSource.hs
bsd-3-clause
2,522
0
15
532
630
321
309
52
1
{-# LANGUAGE TypeFamilies, FlexibleContexts #-} -- | Modify how arrays are represented and accessed to ensure -- coalesced memory access from within GPU kernels. -- -- This module is presently embryonic: all it does is fiddle with the -- index functions of some kernels to ensure that their writeback is -- coalesced. M...
mrakgr/futhark
src/Futhark/Pass/CoalesceMemoryAccesses.hs
bsd-3-clause
5,203
24
16
1,521
1,222
634
588
89
2
-- | This module exports the type used to create resolve queries. module Data.Factual.Query.ResolveQuery ( -- * ResolveQuery type ResolveQuery(..) -- * ResolveValue type , ResolveValue(..) ) where import Data.Factual.Query import qualified Data.Map as M import Data.List.Utils (join) -- | A resolve v...
rudyl313/factual-haskell-driver
Data/Factual/Query/ResolveQuery.hs
bsd-3-clause
1,549
2
13
394
293
169
124
21
0
{-# LANGUAGE CPP #-} -- #define DEBUG {-| Module : AERN2.Poly.Cheb.Tests Description : Tests for Chebyshev-basis polynomials Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable Tests for Ch...
michalkonecny/aern2
aern2-fun-univariate/src/AERN2/Poly/Cheb/Tests.hs
bsd-3-clause
11,162
0
20
2,159
3,047
1,606
1,441
-1
-1
module FreeDSL.GraphBuilder ( GraphDSL , addVertex , addEdgeWithData , programPrettyShow , runDefaultInterpreter ) where import Control.Monad.Free (Free(..),liftF) import Control.Monad.State (State, execState, modify) import Data.List (nub) data GraphDslCmds v edata next = AddVer...
rpeszek/GraphPlay
src/FreeDSL/GraphBuilder.hs
bsd-3-clause
2,245
0
13
475
934
524
410
-1
-1
{-# OPTIONS_GHC -F -pgmF htfpp #-} module EdgeTests (htf_thisModulesTests) where import Data.List (sort) import Data.Maybe (isNothing) import Data.Graph.Simple.Edge import Data.Graph.Simple.Vertex import GraphQC import Safe (minimumMay, maximumMay) import Test.Framework import qualified Data.Set as S {- First we ch...
stefan-hoeck/labeled-graph
test/EdgeTests.hs
bsd-3-clause
4,867
0
12
1,509
1,501
768
733
-1
-1
module Tile.TileType ( TileType (..) , isWire ) where import qualified Electric.Pack as P -- | Specifies the kind of a tile and -- stores all the data about it. data TileType = InfSource P.Pack -- ^ Infinite source of energy. | Wire -- ^ Transports energy in packs. ...
Megaleo/Electras
src/Tile/TileType.hs
bsd-3-clause
387
0
7
120
69
43
26
9
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes...
chainone/HForgeAPIClient
src/ViewDataApi/CustomPersistentTypes.hs
bsd-3-clause
773
0
6
187
85
54
31
20
0
{-# LANGUAGE ForeignFunctionInterface #-} module Main where import Foreign.C.String import Foreign.Ptr import System.Environment (getArgs) import System.Posix.DynamicLinker type Fun = Int -> Int foreign import ccall "dynamic" mkFun :: FunPtr Fun -> Fun libPathC, libPathHsOverFFI, libPathPureHs :: FilePath libPathC...
michaxm/dynamic-linking-exploration
app/Main.hs
bsd-3-clause
1,802
0
16
338
534
273
261
50
5
module MateVMRuntime.TwoSpaceAllocator where import Foreign import Control.Monad.State import qualified Foreign.Marshal.Alloc as Alloc import Data.Set (Set) import qualified Data.Set as S import qualified Data.Map as M import Data.List import MateVMRuntime.MemoryManager import MateVMRuntime.RtsOptions import MateVMR...
LouisJenkinsCS/Minimal-JVM
MateVMRuntime/TwoSpaceAllocator.hs
bsd-3-clause
7,447
0
16
2,607
1,848
932
916
-1
-1
data G a where A :: a -> G Int B :: b -> G Bool g :: Int -> Int g proc = proc + 1
begriffs/hscope
t/files/garrs.hs
bsd-3-clause
91
0
7
36
51
27
24
-1
-1
-- | "Libtorrent" exceptions module Network.Libtorrent.Exceptions (LibtorrentException(..) , withErrorCode , withLibtorrentException , exceptU , except ) where import ...
eryx67/haskell-libtorrent
src/Network/Libtorrent/Exceptions.hs
bsd-3-clause
1,624
0
13
557
333
175
158
55
2
{-# LANGUAGE TypeFamilies, QuasiQuotes #-} import Text.Papillon parseHoge :: String -> Maybe String parseHoge src | Right (c, _) <- runError $ hoge $ parse src = Just c | otherwise = Nothing [papillon| hoge :: String = c { if c == 'h' then "hoge" else "piyo" } |]
YoshikuniJujo/papillon
test/peg/if.hs
bsd-3-clause
273
0
10
59
76
38
38
7
1
module Action.Label (addLabelsToRepo )where import Action.Internal.Label (addLabelsToRepo)
smurphy8/issue-add
src/Action/Label.hs
bsd-3-clause
101
0
5
17
22
14
8
2
0
module GCMarkScan (gc) where import Language import TiTypes import Utils gc :: TiState -> TiState gc state@(output, stack, dump, heap, globals, stats) = (output, stack, dump, heap'', globals, stats) where heap'' = scanHeap heap' (heap', _) = mapAccuml (\h a -> (markFrom h a, a)) heap addrs a...
caasi/spj-book-student-1992
src/GCMarkScan.hs
bsd-3-clause
2,135
0
14
871
646
345
301
45
6
module Buildsome.FileContentDescCache ( fileContentDescOfStat ) where import Prelude.Compat hiding (FilePath) import Buildsome.Db (Db) import Lib.FileDesc (FileContentDesc) import Lib.FilePath (FilePath) import qualified Buildsome.Db as Db import qualified Buildsome.Meddling as Meddling import qualified Lib.FileD...
buildsome/buildsome
src/Buildsome/FileContentDescCache.hs
gpl-2.0
1,267
0
16
242
276
146
130
26
2
module Control.Monad.Categorical (CMonad, CBind(..), CPointed(..)) where import Prelude hiding (id,(.)) import Control.Functor.Categorical
urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav
Control/Monad/Categorical.hs
apache-2.0
142
2
5
15
48
33
15
4
0
{-# LANGUAGE DeriveDataTypeable #-} {- ** ********************************************************************* * * * (c) Kathleen Fisher <kathleen.fisher@gmail.com> * * John Launchbury <john.launchbury@gmail.com> ...
GaloisInc/pads-haskell
Language/Pads/RegExp.hs
bsd-3-clause
646
0
6
238
50
30
20
5
0
-- | -- Module : Foundation.Array -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : portable -- -- Simple Array and Almost-Array-like data structure -- -- Generally accessible in o(1) -- {-# LANGUAGE MagicHash #-} module Foundation.Array ...
vincenthz/hs-foundation
foundation/Foundation/Array.hs
bsd-3-clause
726
0
4
196
82
58
24
17
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[Name]{@Name@: to transmit name info from renamer to typechecker} -} {-# LANGUAGE DeriveDataTypeable #-} -- | -- #name_types# -- GHC uses several kinds of name internally: -- -- * 'OccName.OccName': see "OccName#n...
pparkkin/eta
compiler/ETA/BasicTypes/Name.hs
bsd-3-clause
24,760
0
16
7,113
4,026
2,184
1,842
286
11
{-# Language PatternGuards #-} module Blub ( blub , foo , bar ) where #include "Foo.h" import Ugah.Foo import Control.Applicative import Control.Monad #ifdef FOO import Ugah.Blub #endif f :: Int -> Int f = (+ 3) g :: Int -> Int g = where
jystic/hsimport
tests/goldenFiles/ModuleTest26.hs
bsd-3-clause
254
0
5
60
71
45
26
-1
-1
{-# LANGUAGE RankNTypes #-} module Slantbot.Reddit.Monad where import Algolia.Query import Control.Monad.Reader import Data.ByteString (ByteString) import Reddit.Types.Reddit import Reddit.Types.User import Slantbot.Reddit.Config type RBot...
Andrew-the-Ubergeek/slantbot
src/Slantbot/Reddit/Monad.hs
mit
680
0
7
175
151
86
65
19
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PackageImports #-} {- Copyright 2015 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.ap...
Ye-Yong-Chi/codeworld
codeworld-base/src/Prelude.hs
apache-2.0
3,207
0
5
600
131
101
30
17
0
module Rules.Nofib where import Base import Expression import Oracles.Setting import Packages import System.Environment import System.Exit nofibLogFile :: FilePath nofibLogFile = "nofib-log" -- | Rules for running the @nofib@ benchmark suite. nofibRules :: Rules () nofibRules = do root <- buildRootRules --...
sdiehl/ghc
hadrian/src/Rules/Nofib.hs
bsd-3-clause
1,769
0
17
469
399
204
195
33
2
{-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections #-} module Language.Haskell.Liquid.Misc where import Control.Applicative import System.FilePath import qualified Data.List as L import Language.Fixpoint.Misc (errorstar) import Data.List (sort) import Paths_liquidhaskel...
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/Misc.hs
bsd-3-clause
2,930
0
10
856
1,437
778
659
74
2
module PackageTests.BuildDeps.InternalLibrary2.Check where import qualified Data.ByteString.Char8 as C import PackageTests.PackageTester import System.FilePath import Test.HUnit suite :: FilePath -> FilePath -> Test suite ghcPath ghcPkgPath = TestCase $ do let spec = PackageSpec { directory = "Packag...
DavidAlphaFox/ghc
libraries/Cabal/Cabal/tests/PackageTests/BuildDeps/InternalLibrary2/Check.hs
bsd-3-clause
1,193
0
15
279
302
155
147
24
1
{-@ LIQUID "--no-termination" @-} module Foo (add, remove, deleteMin, deleteMin') where import Language.Haskell.Liquid.Prelude data RBTree a = Leaf | Node Color a !(RBTree a) !(RBTree a) deriving (Show) data Color = B -- ^ Black | R -- ^ Red deriving (Eq,Show) ...
mightymoose/liquidhaskell
tests/pos/RBTree-ord.hs
bsd-3-clause
5,707
0
17
1,871
1,961
983
978
75
7
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-} module Data.StringTable ( StringTable, lookup, index, construct, prop, ) where import Prelude hiding (lookup) import qualified Data.List as List import qualified Data.Array.Unboxed as A import Data.Array.Unboxed ((!)) import Data.SafeCopy (b...
ocharles/hackage-server
Data/StringTable.hs
bsd-3-clause
3,023
0
13
725
1,043
550
493
69
3
import Data.Bits import GHC.Float import GHC.Word import Numeric main :: IO () main = do putStrLn "Float" mapM_ print floats putStrLn "\nDouble" mapM_ print doubles putStrLn "\nWord32" mapM_ (printHex32 . castFloatToWord32) floats putStrLn "\nWord64" mapM_ (printHex64 . castDoubleToWord...
ezyang/ghc
testsuite/tests/codeGen/should_run/castFloatWord.hs
bsd-3-clause
684
0
9
150
265
131
134
23
1
module PackageTests.BuildDeps.TargetSpecificDeps2.Check where import Test.Tasty.HUnit import PackageTests.PackageTester import System.FilePath import qualified Control.Exception as E suite :: SuiteConfig -> Assertion suite config = do let spec = PackageSpec { directory = "PackageTests" </> "BuildDeps...
gridaphobe/cabal
Cabal/tests/PackageTests/BuildDeps/TargetSpecificDeps2/Check.hs
bsd-3-clause
685
0
13
169
162
88
74
17
1
{- | module: $Header$ description: Utility functions license: MIT maintainer: Joe Leslie-Hurd <joe@gilith.com> stability: provisional portability: portable -} module HOL.Util where ------------------------------------------------------------------------------- -- Creating unsafe versions of functions ---------------...
gilith/hol
src/HOL/Util.hs
mit
660
0
10
102
158
82
76
8
1
-- Exclamation marks series #5: Remove all exclamation marks from the end of words -- https://www.codewars.com/kata/57faf32df815ebd49e000117 module Kata (remove) where remove :: String -> String remove = unwords . map (reverse . dropWhile (=='!') . reverse) . words
gafiatulin/codewars
src/7 kyu/RemoveEPfromEnds.hs
mit
268
0
12
40
54
31
23
3
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeSynonymInstances #-} module IHaskell.Display.Widgets.Box.SelectionContainer.Accordion ( -- * The Accordion widget Accordion, -- * Constructor mkAccordion) where -- To keep `cabal re...
sumitsahrawat/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Box/SelectionContainer/Accordion.hs
mit
1,834
0
13
419
353
191
162
40
1
{-# LANGUAGE ViewPatterns #-} module Rosalind.Proteins where {-- ref: http://rosalind.info/problems/orf/ Transcription May Begin Anywhere In “Transcribing DNA into RNA”, we discussed the transcription of DNA into RNA, and in “Translating RNA into Protein”, we examined the translation of RNA into a chain of amino ...
geophf/1HaskellADay
exercises/HAD/Rosalind/Proteins.hs
mit
4,006
0
15
693
460
252
208
-1
-1
module Database.EventSafe.DiscPoolSpec ( spec ) where import Database.EventSafe.DiscPool import Test.Hspec spec :: Spec spec = do describe "planMerges" $ do it "returns a list of actions" $ do planMerges 2 [IndexItem "filea" 10, IndexItem "fileb" 10, IndexItem "filec" 10, IndexItem "filed" 10] `shoul...
thoferon/eventsafe
tests/Database/EventSafe/DiscPoolSpec.hs
mit
630
0
16
136
277
158
119
14
1
sumlist [] = 0 sumlist (x:xs) = x + (sumlist xs) productlist [] = [] productlist (x:xs) = x*2 : (productlist xs) {- maxint (x:xs) = where maxnum = maxint [a|a <- xs,x>=xs] foldr':: [Int] -> Int foldr' f [] = 1 foldr' f (x:xs) = f x + foldr' f (xs) -} ---ThisFuncitonISUsedToMakeListThatMuliply--- zipwith' f [] _ = ...
badarshahzad/Learn-Haskell
Solution of Weekly labs/lab7.hs
mit
483
0
9
106
208
108
100
9
1
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE CPP #-} module Stackage.Select ( select , defaultSelectSettings ) where import Data.Either (partitionEithers) import qualified Data.Map as Map import Data.Maybe (mapMaybe) import Data.Set (e...
Tarrasch/stackage
Stackage/Select.hs
mit
5,581
0
19
1,725
1,461
775
686
119
5
module GB2.Primitive where -- In a near future, A scene may become a ray intersection -- accelerator, and Object may be something else than primitives (such as -- transform or aggregate of primitives) import Data.Foldable import Data.Maybe import Data.Function import GB2.Geometry import GB2.Material import GB2.Color...
gbataille/halray
src/GB2/Primitive.hs
mit
5,023
0
14
1,252
975
522
453
73
2
{-# LANGUAGE CPP, OverloadedStrings #-} -- | Less general functions for working with textual data. module DissociatedPress.Text ( Word, randomSentence, ask, updateDictFromFile, words', unwords', insertText ) where import qualified Data.Text as T import Data.Char (toLower) import System.Random import Dissociat...
valderman/dpress
DissociatedPress/Text.hs
mit
4,450
0
16
1,296
1,302
687
615
85
4
module Y2020.M10.D16.Exercise where {-- `sequence` is really cool: a neat trick. The problem is that we have to use it in the first place. The question becomes if the data structure you are using doesn't give you what you need, then you need to move to a better data model. Data.Map isn't bidirecional, and that's fin...
geophf/1HaskellADay
exercises/HAD/Y2020/M10/D16/Exercise.hs
mit
1,113
0
8
186
101
64
37
11
1
{-# LANGUAGE OverloadedStrings #-} module Web.Pocket.Add ( AddReq(..) , makeAddReq , AddRsp(..) ) where -- aeson import Data.Aeson -- text import Data.Text (Text) data AddReq = AddReq { addReqConsumerKey :: Text , addReqAccessToken :: Text , addReqUrl :: Text , addReqTitle :: Maybe Text...
jpvillaisaza/pocket-haskell
src/Web/Pocket/Add.hs
mit
1,140
0
11
327
283
164
119
46
1
{-# OPTIONS_GHC -optc-DPROFILING #-} {-# LINE 1 "libraries/base/GHC/Stack/CCS.hsc" #-} {-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Stack.CCS -- Copyright : (c) The University of Glasgow 2011 -- License : see libraries/bas...
antalsz/hs-to-coq
examples/base-src/gen-files/GHC/Stack/CCS.hs
mit
4,536
0
20
892
861
466
395
-1
-1
{-# LANGUAGE ImplicitParams #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} module Tinc.InstallSpec (spec) where import Helper import MockedEnv import MockedProcess import Test.Mockery.Action import Data.List impor...
robbinch/tinc
test/Tinc/InstallSpec.hs
mit
7,106
0
26
2,086
1,429
729
700
151
1
class Functor f where fmap :: (a -> b) -> f a -> f b instance Functor [] where fmap = map instance Functor Maybe where fmap f (Just x) = Just (f x) fmap f Nothing = Nothing instance Functor Tree where fmap f Empty = Empty fmap f (Node x l r) = Node (f x) (fmap f l) (fmap f r) instance Functor (Eithe...
RAFIRAF/HASKELL
Functors, Applicative Functors, Monoids/functors.hs
mit
1,549
3
13
428
856
434
422
-1
-1
module Feature.QuerySpec where import Test.Hspec import Test.Hspec.Wai import Test.Hspec.Wai.JSON import Network.Wai.Test (SResponse(simpleHeaders)) import SpecHelper spec :: Spec spec = beforeAll (clearTable "items" >> createItems 15) . beforeAll (clearTable "nullable_integer" >> createNullInteger) . before...
framp/postgrest
test/Feature/QuerySpec.hs
mit
4,930
0
20
1,356
885
473
412
-1
-1
{- | Module : $Header$ Description : This applicaton domain command. Copyright : (c) seb! License : MIT Maintainer : sebi|at|sebi.one.pl Stability : experimental Portability : portable -} module Data.Domain.Command (Command(..), getCommand) where -- | Command executable by this domain. data Comma...
a4099181/LearningHaskell
src/Data/Domain/Command.hs
mit
755
0
11
218
171
97
74
11
1
{-# LANGUAGE Rank2Types #-} module Graphics.Pylon.Common where import Graphics.Pylon.Fusion import Graphics.Pylon.Types mkLens :: Copy a => (a -> IO b) -> (b -> a -> IO ()) -> Lens' a b mkLens getter setter f fd = fmap (\n -> setter' n fd) (f $ getter' fd) where setter' n = unstream . (streamSetter $ setter n)...
philopon/pylon
Graphics/Pylon/Common.hs
mit
399
0
12
86
154
81
73
9
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} -- | The constraints on package selection for a new build plan. module Stackage.BuildConstraints ( BuildConstraints (..) , PackageConstraints (..) , TestState (..) ...
k0001/stackage
Stackage/BuildConstraints.hs
mit
8,545
0
17
2,348
1,954
1,028
926
173
2
module Network.Yeller ( sendError , client , defaultClientSettings , YellerClientSettings (..) , ApplicationEnvironment (..) , ApplicationPackage (..) , YellerToken (..) , ExtraErrorInfo (..) , emptyExtraErrorInfo , HTTPRequest (..) , UserInfo (..) , ErrorNotification (..) , StackFrame (.....
yeller/yeller_haskell
Network/Yeller.hs
mit
490
0
5
100
119
83
36
22
0
{- This is my xmonad configuration file. There are many like it, but this one is mine. If you want to customize this file, the easiest workflow goes something like this: 1. Make a small change. 2. Hit "super-q", which recompiles and restarts xmonad 3. If there is an error, undo your change and hit ...
thearthur/.xmonad
xmonad.hs
mit
15,746
0
17
3,427
1,748
1,046
702
145
1
import Text.CSV main = do let fileName = "data/input.csv" input <- readFile fileName let csv = parseCSV fileName input either handleError doWork csv handleError csv = print "not a CSV" doWork csv = print $ filter (\row -> last row == "1") $ rows csv rows csv = filter (\x -> length x == length (head csv)) $ t...
slon1024/haskell_read_data
Csv.hs
mit
328
0
12
71
144
67
77
9
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# OPTIONS_GHC -Wall #-} ----------------------------------------------------------------------------- -- -- Module : Graphics.UI.Editor.Simple -- Co...
leksah/ltk
src/Graphics/UI/Editor/Simple.hs
gpl-2.0
41,133
0
37
15,525
9,492
4,592
4,900
814
7
{- | Module : $EmptyHeader$ Description : <optional short description entry> Copyright : (c) <Authors or Affiliations> License : GPLv2 or higher, see LICENSE.txt Maintainer : <email> Stability : unstable | experimental | provisional | stable | frozen Portability : portable | non-portable (<reason>...
nevrenato/Hets_Fork
Search/SPASS/Intersection.hs
gpl-2.0
2,014
6
13
381
518
264
254
34
2
take' :: [a] -> Int -> [a] take' [] _ = [] take' _ 0 = [] take' (x:xs) y = x:(take' xs (y-1)) drop' :: [a] -> Int -> [a] drop' [] _ = [] drop' xs 0 = xs drop' (x:xs) y = drop' xs (y-1) split :: [a] -> Int -> ([a], [a]) split [] _ = ([], []) split xs y = (take' xs y, drop' xs y)
carlosavieira/self-study
programming/Haskell/99 problems/solutions/17.hs
gpl-3.0
280
0
9
73
230
123
107
11
1
{- Merch.Race.MapGen - Map generator integration. Copyright 2013 Alan Manuel K. Gloria This file is part of Merchant's Race. Merchant's Race 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 t...
AmkG/merchants-race
Merch/Race/MapGen.hs
gpl-3.0
1,375
0
9
217
185
101
84
20
1
-- This file is part of KSQuant2. -- Copyright (c) 2010 - 2011, Kilian Sprotte. All rights reserved. -- 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 3 of the License, or -- (...
kisp/ksquant2
old/Unused.hs
gpl-3.0
1,018
0
11
217
145
79
66
7
1
-- | A @Duration@ is used to represent a period of time. This can be used in -- MTTH, for example. module Duration ( Duration(..), duration ) where import Maker((~@),number) import Control.Applicative((<|>)) -- | A @Duration@ is a period of time. data Duration = Days Double | Months Do...
joelwilliamson/validator
Duration.hs
agpl-3.0
558
0
15
151
128
76
52
11
1