code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
module Passman.Engine.Generator.Id(GeneratorId(..), mkId) where import qualified Data.UUID as U import Data.Word (Word32) newtype GeneratorId = GeneratorId U.UUID deriving (Show, Eq, Read, Ord) mkId :: Word32 -> Word32 -> Word32 -> Word32 -> GeneratorId mkId a b c d = Gen...
chwthewke/passman-hs
src/Passman/Engine/Generator/Id.hs
bsd-3-clause
351
0
8
94
117
67
50
7
1
{-# LANGUAGE OverloadedStrings #-} module Tools.CreateDB where import Control.Monad import Database.PostgreSQL.Simple import Data.Serialize import qualified Data.ByteString as B import qualified Data.ByteString.Base64 as B64 import PendingActionsTracker myConnectInfo :: B.ByteString myConnectInfo = "dbname=bridgewa...
javgh/bridgewalker
src/Tools/ResetPAS.hs
bsd-3-clause
746
0
11
133
161
89
72
20
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Mafia.Path ( -- * Types Path , File , Directory -- * Filename/directory functions , (</>) , takeFileName , takeBaseName , takeDirectory , dropTrailingPathSeparator , normalise , makeRelative , isAbsolute -- ...
ambiata/mafia
src/Mafia/Path.hs
bsd-3-clause
2,180
0
14
435
587
332
255
58
2
module Toys.Mat.Mat where import Data.List import Toys.Mat.List import Toys.Mat.Field import Toys.Mat.Vector data Matrix f = Mat [Vector f] deriving (Eq, Read, Show) instance (MatGroup f) => MatGroup (Matrix f) where dim (Mat vecs) = length vecs gzero n = Mat (take n $ repeat (gzero n)) gadd (Mat vecs0) (M...
dagezi/ToysMat
src/Toys/Mat/Mat.hs
bsd-3-clause
3,979
0
20
954
1,407
733
674
59
3
-- Copyright : (C) 2009 Corey O'Connor -- License : BSD-style (see the file LICENSE) module Bind.Marshal.Dynamic ( module Bind.Marshal.Dynamic , module Bind.Marshal.Action , module Bind.Marshal.DesAction , module Bind.Marshal.S...
coreyoconnor/bind-marshal
src/Bind/Marshal/Dynamic.hs
bsd-3-clause
567
0
5
196
76
53
23
10
0
module Main where import AdventOfCode import Crypto.Hash import Data.ByteString (ByteString) import qualified Data.Map as M import Data.Maybe (catMaybes) import Data.String (fromString) hashes :: String -> [String] hashes seed = hexMD5 . (seed ++) . show <$> [(0 :: Integer) ..] hexMD5 :: String -> String hexMD5 = sh...
purcell/adventofcode2016
src/Day5.hs
bsd-3-clause
1,168
0
12
281
462
249
213
37
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RebindableSyntax #-} module Cinder.SVG (module Cinder.SVG, module Cinder.DOM, module Cinder.DSL) where import Cinder.DOM hiding (toLower) import Cinder.DSL import Cinder.SVG.Attributes ...
crooney/cinder
src/Cinder/SVG.hs
bsd-3-clause
12,265
0
16
3,397
4,146
2,186
1,960
279
10
{-# LANGUAGE OverloadedStrings, DeriveGeneric #-} module Bower.Types where import Data.Aeson import GHC.Generics import Data.Text import Data.Maybe import Data.Default import Control.Applicative import Data.Possible import Data.Monoid import qualified Data.Vector as V import Data.HashMap.Strict (HashMap (..)) import...
tolysz/y-bower
src/Bower/Types.hs
bsd-3-clause
2,382
0
14
716
507
279
228
49
0
module REPL.Stock ( stock ) where import Data.List (intercalate) import Data.Maybe (fromJust) import Text.Printf import AlbanKnights (toKeyword, getKeywordIndex) import REPL.NPC (npcLookup) import Rating stock :: [String] -> Rating -> Either String Rating stock [] r = Left $ showStock "all" r ...
sandmark/AlbanKnights
src/REPL/Stock.hs
bsd-3-clause
1,755
0
14
345
656
346
310
37
5
{-# language CPP #-} -- | = Name -- -- VK_KHR_get_surface_capabilities2 - instance extension -- -- == VK_KHR_get_surface_capabilities2 -- -- [__Name String__] -- @VK_KHR_get_surface_capabilities2@ -- -- [__Extension Type__] -- Instance extension -- -- [__Registered Extension Number__] -- 120 -- -- [__Revisi...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_KHR_get_surface_capabilities2.hs
bsd-3-clause
36,194
0
19
6,176
4,894
2,853
2,041
-1
-1
module PackageTests.BenchmarkStanza.Check where import PackageTests.PackageTester import Distribution.Version import Distribution.Simple.LocalBuildInfo import Distribution.Package import Distribution.PackageDescription suite :: TestM () suite = do assertOutputDoesNotContain "unknown section type" =<< cab...
randen/cabal
Cabal/tests/PackageTests/BenchmarkStanza/Check.hs
bsd-3-clause
1,121
0
17
365
209
111
98
25
1
module Graphics.Gnuplot.Graph.TwoDimensional ( T, Type, -- deflt, lineSpec, listLines, listPoints, listLinesPoints, listImpulses, listDots, histograms, xErrorBarsRelative, yErrorBarsRelative, xyErrorBarsRelative, xErrorBarsAbsolute, yErrorBarsAbsolute, xyErrorBarsAbsol...
wavewave/gnuplot
src/Graphics/Gnuplot/Graph/TwoDimensional.hs
bsd-3-clause
844
0
5
182
146
100
46
39
0
module GUI.TraceView ( TraceView, traceViewNew, TraceViewActions(..), traceViewSetHECs, traceViewGetTraces, ) where import Events.HECs import GUI.Types import Graphics.UI.Gtk import Data.Tree -- | Abstract trace view object. -- data TraceView = TraceView { tracesStore :: TreeStore (Trac...
ml9951/ThreadScope
GUI/TraceView.hs
bsd-3-clause
7,282
0
19
2,311
2,044
1,040
1,004
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Q3Demo.Loader.MD3 where import Control.Applicative import Control.Monad import Data.Int import Data.Word import Data.Binary as B import Data.Binary.Get as B import Data.Binary.IEEE754 import Data.Vect hiding (Vector) import Data.Vector (Vector) import qualified Data.ByteStrin...
csabahruska/q3demo
src/Q3Demo/Loader/MD3.hs
bsd-3-clause
3,706
1
14
930
1,273
684
589
93
1
{-# LANGUAGE TemplateHaskell #-} import Language.Haskell.TH import Air.Env import Air.TH import Prelude () import Air.Data.Default import System.Nemesis.Titan data Dummy = Dummy { test_field_1 :: String , test_field_2 :: Integer } deriving (Show) mkDefault ''Dummy main = halt
nfjinjing/air
src/Test.hs
bsd-3-clause
298
5
6
58
80
46
34
14
1
-- | Import/Export JSON support {-# LANGUAGE TemplateHaskell, TypeApplications, FlexibleInstances #-} module Lamdu.Data.Export.JSON ( fileExportRepl, jsonExportRepl , fileExportAll, fileExportDef, fileExportTag, fileExportNominal , fileImportAll, Version(..) ) where import qualified Control.Lens as Len...
lamdu/lamdu
src/Lamdu/Data/Export/JSON.hs
gpl-3.0
11,503
0
20
2,807
3,651
1,897
1,754
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/CloneStack.hs
mpl-2.0
21,229
0
13
4,329
2,464
1,523
941
254
1
----------------------------------------------------------------------------- -- | -- Module : Haddock.Backends.Html.DocMarkup -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2009, -- Mark Lentczner 2010 -- License : BSD-like -- -- Maintainer : h...
adamse/haddock
haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
bsd-2-clause
10,735
0
17
3,121
2,486
1,318
1,168
158
10
{-# LANGUAGE RankNTypes #-} -- | Load page contents from the content folder. module Import.Content ( ContentFormat (..) , ContentPath (..) , htmlFormat , unsafeHtmlFormat , markdownFormat , redirectFormat , loadContent , returnContent ) where import Prelude ( (.), ($), IO, Maybe...
wolftune/yesodweb.com
Import/Content.hs
bsd-2-clause
3,887
0
16
880
1,097
622
475
85
3
selfQualify mod rsets = let defs = Set.fromList (map rs_name rsets) in map (descend (f defs)) (map (\RS{..} -> RS{rs_name = qualify mod rs_name, ..}) rsets)
mpickering/ghc-exactprint
tests/examples/ghc710/SlidingRecordSetter.hs
bsd-3-clause
213
0
14
82
90
45
45
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Control.Monad.MC.Sample -- Copyright : Copyright (c) 2010, Patrick Perry <patperry@gmail.com> -- License : BSD3 -- Maintainer : Patrick Perry <patperry@gmail.com> -- Stability : experimental -- module Control.Monad....
beni55/hs-monte-carlo
lib/Control/Monad/MC/Sample.hs
bsd-3-clause
6,415
0
17
1,840
1,787
921
866
116
2
{-# LANGUAGE LambdaCase #-} -- | Auxiliary vector -- -- The kernel's ELF binary loader passes some information to user space into the -- "auxiliary vector" when a program is executed. It is just a key-value array -- stored alongside program parameters and environment. -- -- The libc exports a "getauxval" function that...
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/Linux/Process/Auxiliary.hs
bsd-3-clause
4,302
0
13
1,357
572
332
240
91
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="bs-BA"> <title>Context Alert Filters | ZAP Extension</title> <maps> <homeID>top</homeID> ...
0xkasun/security-tools
src/org/zaproxy/zap/extension/alertFilters/resources/help_bs_BA/helpset_bs_BA.hs
apache-2.0
983
80
66
161
417
211
206
-1
-1
{-# LANGUAGE DataKinds, TypeOperators, OverloadedStrings #-} module LinearRegression50 where import Prelude (print, length, IO) import Language.Hakaru.Syntax.Prelude import Language.Hakaru.Disintegrate import Language.Hakaru.Syntax.ABT import Language.Hakaru.Syntax.AST import Language.Hakaru.Types.DataKind import Lan...
zaxtax/hakaru
haskell/Tests/Unroll/LinearRegression50.hs
bsd-3-clause
10,341
0
211
5,813
3,472
1,801
1,671
170
1
{-# LANGUAGE TemplateHaskell #-} module Auto.T.BigProduct where import Control.DeepSeq import Data.Aeson.TH import Options data BigProduct = BigProduct !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int !Int deriving (Show, ...
dmjio/aeson
benchmarks/bench/Auto/T/BigProduct.hs
bsd-3-clause
630
0
7
226
210
98
112
71
1
import Test.Cabal.Prelude main = cabalTest $ do -- Regression test for #4393 recordMode DoNotRecord $ do -- TODO: Hack; see also CustomDep/cabal.test.hs withEnvFilter (/= "HOME") $ do -- On -v2, we don't have vQuiet set, which suppressed -- the error cabal "ne...
mydaum/cabal
cabal-testsuite/PackageTests/CustomPlain/cabal.test.hs
bsd-3-clause
337
0
15
103
55
29
26
5
1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="pl-PL"> <title>Requester</title> <maps> <homeID>requester</homeID> <mapref location="ma...
kingthorin/zap-extensions
addOns/requester/src/main/javahelp/help_pl_PL/helpset_pl_PL.hs
apache-2.0
960
77
66
155
404
205
199
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="fr-FR"> <title>Server-Sent Events Add-on</title> <maps> <homeID>sse.introduction</homeID> ...
kingthorin/zap-extensions
addOns/sse/src/main/javahelp/org/zaproxy/zap/extension/sse/resources/help_fr_FR/helpset_fr_FR.hs
apache-2.0
988
77
68
157
419
212
207
-1
-1
{-# OPTIONS -fglasgow-exts #-} {-# LANGUAGE MultiParamTypeClasses, OverlappingInstances, UndecidableInstances, FunctionalDependencies, NoMonomorphismRestriction #-} module OrigTiMonad( IM,run,--TI,KI, KEnv, getEnv,getTEnv,getKEnv,getIEnv,getModule,getDefaults,getStdNames, extendts,extend,extend1,extendkts,e...
kmate/HaRe
old/tools/base/TI/OrigTiMonad.hs
bsd-3-clause
5,342
14
18
1,116
2,262
1,210
1,052
130
2
-- GSoC 2015 - Haskell bindings for OpenCog. {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} -- | Simple example on inserting and removing many atoms in a new AtomSpace. import OpenCog.AtomSpace (TruthVal(..),Atom(..),AtomType(..),Gen(..), AtomSpace,runOnNewAtomSpace,get...
rodsol/atomspace
examples/haskell/example_multiple_atoms.hs
agpl-3.0
1,069
0
14
349
318
168
150
22
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Text.Read -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer :...
abakst/liquidhaskell
benchmarks/base-4.5.1.0/Text/Read.hs
bsd-3-clause
2,950
0
11
667
425
249
176
9
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# OPTIONS_GHC -Werror=typed-holes #-} main :: IO () main = undefined data Proxy k = Proxy test1 = _ :: Proxy '( 'True, 'False ) test2 = _ :: Proxy '( '( 'True, 'False ), 'False ) test3 = _ :: Proxy '( '[ 1 ], 'False )
sdiehl/ghc
testsuite/tests/printer/T14343b.hs
bsd-3-clause
277
0
10
59
109
63
46
9
1
module Main (main ) where import Debug.Trace foo :: (a,b) -> a foo (x,y) = x {-# NOINLINE foo #-} wwMe :: Int -> (Int,Int) -> (Int, Int) wwMe 0 p = let a = fst p b = snd p -- This ensures sharing of b, as seen by the demand analyzer in foo p `seq` -- This ensures that wwMe is strict i...
ezyang/ghc
testsuite/tests/simplCore/should_run/T11731.hs
bsd-3-clause
861
0
12
255
269
148
121
21
1
{-# LANGUAGE Safe #-} {-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : System.Environment -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskel...
beni55/haste-compiler
libraries/ghc-7.10/base/System/Environment.hs
bsd-3-clause
13,872
142
17
2,898
2,346
1,283
1,063
138
3
{-# LANGUAGE TypeOperators, DeriveGeneric, TypeFamilies, FlexibleInstances #-} module Main where import GHC.Generics hiding (C, D) import GEq1A -- We should be able to generate a generic representation for these types data C = C0 | C1 deriving Generic data D a = D0 | D1 { d11 :: a, d12 :: (D a) } deriving Gene...
wxwxwwxxx/ghc
testsuite/tests/generics/GEq/GEq1.hs
bsd-3-clause
945
0
10
254
381
213
168
33
1
module Tach.Manager.ImpulseSpec (main,spec) where import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction in typeSpec" $ do it "should have a definition" $ do True `shouldBe` False
smurphy8/tach
apps/tach-manager-impulse/test/Tach/Manager/ImpulseSpec.hs
mit
238
0
13
53
77
41
36
9
1
module Handler.ResetSecurityToken where import Import postResetSecurityTokenR :: Handler () postResetSecurityTokenR = do Entity uid _ <- requireAuth void $ resetSecurityToken uid setMessage "Security token reset" redirect ProfileR
fpco/schoolofhaskell.com
src/Handler/ResetSecurityToken.hs
mit
249
0
8
45
58
27
31
8
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} --module PostgREST.App where module PostgREST.App ( postgrest ) where import Control.Applicative import Data.Bifunctor (first) import qualified Data.ByteString.Char8 as BS import ...
league/postgrest
src/PostgREST/App.hs
mit
17,540
227
26
5,036
4,685
2,486
2,199
323
26
{-# LANGUAGE OverloadedStrings #-} module TileGroup where import qualified Data.Aeson as J import qualified Data.ByteString.Lazy.Char8 as L import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as M import System.FilePath ((</>)) import Tile type TileGroup = HashMap String Tile newTileGroup :...
mietek/map-cutter
src/TileGroup.hs
mit
887
0
9
170
302
176
126
26
1
module Password where import Text.Regex.PCRE import Data.Char (ord, chr) import Data.List (intercalate, mapAccumR, find) findNextPassword = find requirements . drop 1 . iterate inc inc :: String -> String inc = snd . mapAccumR f 1 where f acc x | acc + ord x == ord 'z' + 1 = (1, 'a') | otherwise ...
corajr/adventofcode2015
11/Password.hs
mit
775
0
13
169
338
178
160
20
1
module SalsaAst where type Program = [DefCom] data DefCom = Def Definition | Com Command deriving (Show, Eq) data Definition = Viewdef Ident Expr Expr | Rectangle Ident Expr Expr Expr Expr Colour | Circle Ident Expr Expr Expr Colour | View Ident ...
borgsmidt/adv-prog-2013
src/salsa/SalsaAst.hs
mit
866
0
7
347
253
145
108
27
0
{-# LANGUAGE OverloadedStrings #-} import CFDI (parseCfdiXml, ppXmlParseError, signWith, toXML) import CFDI.PAC (ppStampError, stampWithRetry) import CFDI.PAC.Dummy (Dummy(..)) import CFDI.PAC.Fel (Fel(Fel), FelEnv(..)) import CFDI.PAC.ITimbre (ITimbre(ITimbre), ITimbreEnv(..)) import qualified Data.ByteString as BS (...
yusent/cfdis
stamp/main.hs
mit
3,859
0
34
1,571
878
431
447
85
12
module Main where data Vec3 a = Vec3 a a a deriving (Read, Show) instance Num a => Num (Vec3 a) where (Vec3 a b c) + (Vec3 x y z) = Vec3 (a + x) (b + y) (c + z) (Vec3 a b c) * (Vec3 x y z) = Vec3 (a * x) (b * y) (c * z) abs (Vec3 a b c) = Vec3 (abs a) (abs b) (abs c) fromInteger = fromScalar . fro...
taktoa/SatOpt
orbits.hs
mit
9,415
1
21
3,137
4,153
2,182
1,971
254
4
result :: Integer result = sum [1..100] ^2 - sum (map (^2) [1..100]) main = putStrLn $ show(result)
nbartlomiej/haskeuler
006/problem-006.hs
mit
102
0
9
20
62
33
29
3
1
module UserRoles.UserRole ( findByProductId , createUserRole , updateUserRole , removeUserRole , findUserRole , toUserRoleID , toUserRole , UserRole(..) ) where import Control.Monad.Reader (ask, liftIO) import Data.Int (Int64) import qualified Database.Persist.Postgresql as DB import Database.Types (WithDBPool (..)) i...
gust/feature-creature
legacy/lib/UserRoles/UserRole.hs
mit
1,779
0
12
360
500
266
234
46
1
module Robotics.ArDrone.Repl where import Robotics.ArDrone.Control import Control.Monad import Control.Concurrent import Network.Socket import System.IO.Unsafe import Data.IORef currentCommand :: IORef (Maybe AtCommand) {-# NOINLINE currentCommand #-} currentCommand = unsafePerformIO (newIORef Nothing) -- for REP...
osnr/hs-drone
lib/Robotics/ArDrone/Repl.hs
mit
1,076
0
17
228
339
181
158
26
2
{-# LANGUAGE QuasiQuotes #-} module Data.Aeson.Config.TypesSpec (spec) where import Helper import Data.Aeson.Config.FromValueSpec (shouldDecodeTo, shouldDecodeTo_) import Data.Aeson.Config.FromValue import Data.Aeson.Config.Types spec :: Spec spec = do describe "fromValue" $...
haskell-tinc/hpack
test/Data/Aeson/Config/TypesSpec.hs
mit
1,164
0
24
359
259
141
118
25
1
import Network.IRC import Network.Socket import qualified Network.Socket.ByteString as SBS import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BSC import Network.BSD import Control.Concurrent import System.IO import Control.Monad import qualified Data.Sequence as Seq import Data.Sequence (V...
Javran/misc
irc/TestIRC.hs
mit
1,405
0
15
394
512
253
259
47
2
module Pixs where
ayberkt/pixs
src/Pixs.hs
mit
18
0
2
3
4
3
1
1
0
module LexML.Linker.Estados where import Data.Char import qualified Data.Map as M import qualified Data.Set as S import Data.Map ( (!) ) import LexML.Linker.ParserBase import Control.Monad import Control.Monad.Trans import LexML.URN.Atalhos import LexML.Linker.LexerPrim import Text.Parsec import System.Log.Logger impo...
lexml/lexml-linker
src/main/haskell/LexML/Linker/Estados.hs
gpl-2.0
3,116
0
14
642
1,286
751
535
81
5
{- Copyright (C) 2015 Michael Dunsmuir 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 (at your option) any later version. This program i...
mdunsmuir/routequery-service
src/RoutequeryService/GTFS/Types/TH.hs
gpl-3.0
4,453
0
15
1,017
1,100
576
524
81
4
module Portage.Dependency.PrintSpec (spec) where import Test.Hspec import Control.Monad (forM_) import Data.List (intercalate) import qualified Portage.PackageId as P import qualified Portage.Dependency.Builder as P import qualified Portage.Dependency.Print as P import qualified Portage.Dependency....
gentoo-haskell/hackport
tests/Portage/Dependency/PrintSpec.hs
gpl-3.0
15,104
0
25
9,152
2,831
1,520
1,311
182
1
upCase :: String -> Writer String String upCase s = Writer (map toUpper s, "upCase ")
hmemcpy/milewski-ctfp-pdf
src/content/3.4/code/haskell/snippet19.hs
gpl-3.0
85
0
7
15
37
18
19
2
1
module Typedrat.Templates.Layout (layout) where import Control.Monad import qualified Data.Text as T import Lucid import qualified Web.SpriteIcons as SI import Web.SpriteIcons.TH (toSVG) import Typedrat.Routes import Typedrat.DB import Typedrat.Templates.Types layout :: ( TVContains a "is_authenticated" Bool xs ...
typedrat/typedrat-site
app/Typedrat/Templates/Layout.hs
gpl-3.0
4,936
0
24
1,260
1,141
531
610
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- Module : Khan.Internal.Parser -- Copyright : (c) 2013 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v...
zinfra/khan
khan/src/Khan/Internal/Parser.hs
mpl-2.0
2,782
0
16
805
717
381
336
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Surveys.Types -- Copyright : (c) 2015-2016 Brendan Hay...
brendanhay/gogol
gogol-surveys/gen/Network/Google/Surveys/Types.hs
mpl-2.0
3,976
0
7
973
450
305
145
123
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/List.hs
mpl-2.0
6,083
0
18
1,381
881
510
371
130
1
{- Bustle.Stats: calculates statistics for D-Bus logs Copyright © 2009–2011 Collabora Ltd. This library 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 2.1 of the License, or (at your option...
wjt/bustle
Bustle/Stats.hs
lgpl-2.1
6,158
0
15
2,016
1,704
918
786
127
5
module Text.Web.EscapeTests (escapeTests) where import Data.Char import Test.Framework (testGroup) import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 import Test.HUnit import Test.QuickCheck.Arbitrary impor...
isturdy/web-escape
tests/Text/Web/EscapeTests.hs
unlicense
2,844
0
13
752
864
452
412
62
4
{-# LANGUAGE InstanceSigs #-} module State where newtype Moi s a = Moi { runMoi :: s -> (a, s) } instance Functor (Moi s) where fmap :: (a -> b) -> Moi s a -> Moi s b fmap f (Moi g) = Moi (\s -> ( (f $ fst (g s)), s)) instance Applicative (Moi s) where pure :: a -> Moi s a pure a = Moi (\s -> (a, s)) (<*>...
dmp1ce/Haskell-Programming-Exercises
Chapter 23/Write State for yourself.hs
unlicense
878
0
14
236
392
207
185
16
0
module WebToInk.Converter.Images(getImages) where import WebToInk.Converter.Types import Text.HTML.TagSoup(parseTags, Tag(..), (~==)) import System.FilePath(takeExtension) import Data.List(nub, find) import Data.Maybe(fromJust) import Test.HUnit getImages :: PageContents -> [Url] getImages = nub . getUrls . filterIm...
thlorenz/WebToInk
webtoink-converter/WebToInk/Converter/Images.hs
bsd-2-clause
1,648
0
13
362
342
194
148
30
1
module Train where import Control.Lens import Data.Default ( def ) import qualified Data.HashMap.Strict as M import Data.List ( foldl' ) import qualified Data.Vector as V import qualified Data.Vector.Storable as VS import Data.Number.Erf import Numeric.LBFGSB import ...
mkiefel/trueskill
Train.hs
bsd-2-clause
4,336
1
14
1,821
1,125
595
530
89
1
{-# LANGUAGE OverloadedStrings #-} module Main where -- The Turtle FilePath is deprecated, but unfortunately necessary in this -- module where a bunch of I/O happens through Turtle. Only in this module -- should the standard FilePath be hidden! import Prelude hiding (FilePath) import Control.Arrow (first) import Cont...
kqr/two-wrongs-st
src/Main.hs
bsd-2-clause
2,684
0
13
552
738
367
371
60
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} module Data.AutoStack where import Control.Monad.IO.Class (MonadIO) import Data.Typeable (Typeable) data Component t = forall d. Typeable d => Component { _acquire :: MonadIO m => m d ...
jotrk/autostack
Data/AutoStack.hs
bsd-2-clause
438
0
12
111
123
68
55
11
0
-- * Basic data types module System.Console.ANSI.Common, -- * Cursor movement by character cursorUp, cursorDown, cursorForward, cursorBackward, hCursorUp, hCursorDown, hCursorForward, hCursorBackward, cursorUpCode, cursorDownCode, cursorForwardCode, cursorBackwardCode, -- * Cursor movement by line cursorUpLine, curso...
coreyoconnor/ansi-terminal
includes/Exports-Include.hs
bsd-3-clause
1,507
3
4
137
143
137
6
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Static.Html where import Prelude hiding (head, id, div) import Data.ByteString.Builder (Builder) import Data.String (fromString) import Text.Blaze.Html.Renderer.Utf8 import Text.Blaze.Html5 import Text.Blaze.Html5.Attributes hiding (title) html :: FilePath -> FilePath -> Bui...
rimmington/eclogues-react
Static/Html.hs
bsd-3-clause
758
0
15
158
234
123
111
20
1
module Interpreter where import Common import qualified Data.Map as Map import Data.Maybe import Debug.Trace import Parser instance Eq Val where UnitVal == UnitVal = True (BoolVal x) == (BoolVal y) = x == y (IntVal x) == (IntVal y) = x == y (FloatVal x) == (F...
TerrorJack/erumpo
src/Interpreter.hs
bsd-3-clause
9,987
2
26
4,496
3,546
1,794
1,752
189
27
{-# LANGUAGE RecordWildCards #-} module Frontend.Relation (RArg(RArg,rargTSpec), Rule(Rule,ruleOp,ruleExpr), Relation(Relation, relName, relArg, relRule), Apply(Apply, applyRel, applyArg)) where import Text.PrettyPrint import Pos import Name import Frontend.Expr imp...
termite2/tsl
Frontend/Relation.hs
bsd-3-clause
1,976
0
11
724
598
338
260
65
0
{-# LANGUAGE CPP #-} module READMEUtil where import Text.Printf import qualified Data.Text as T storeData = Stats 3.1 22.6 702728 flatData = Stats 7 30 114841 -- storeData = Stats (encTime flatData/1.5) (decTime flatData/1.5) 231 -- flatData = Stats (1.3) ((5.58-1.3)) 67 -- times in ms, len in bytes data Stats = Sta...
tittoassini/flat
src/READMEUtil.hs
bsd-3-clause
1,881
0
10
292
481
258
223
28
1
#!/usr/bin/env stack -- stack --resolver lts-8.9 --install-ghc runghc --package parsec {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} import Text.Parsec import Control.Monad import Control.Monad.State import Data.Set (Set) import qualified Data.Set as Set import Pipes import qualified Pipes.Prelud...
adbrowne/s3ls-parallel
scripts/find-incomplete.hs
bsd-3-clause
1,148
0
14
281
380
194
186
26
3
-- | Internal utilities. module Math.Probably.Utils where import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe import qualified Data.Vector.Storable as V import Math.Probably.Types import Numeric.LinearAlgebra import Statistics.Distribution import Statistics.Distribution.Normal lookupDefault ::...
glutamate/probably-baysig
src/Math/Probably/Utils.hs
bsd-3-clause
2,110
0
9
366
649
358
291
41
1
{-# language CPP #-} -- | = Name -- -- VK_EXT_image_drm_format_modifier - device extension -- -- == VK_EXT_image_drm_format_modifier -- -- [__Name String__] -- @VK_EXT_image_drm_format_modifier@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 159 -- -- [__Revision__...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_EXT_image_drm_format_modifier.hs
bsd-3-clause
70,240
0
18
10,830
6,951
4,215
2,736
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts, FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {- | Module : Safe.Fail Copyright : (c) Neil Mitchell 2007-2008, Jose Iborra 2009 License : BSD3 Maintainer : pepeiborra@gmail.com S...
pepeiborra/safe-failure
Safe/Failure.hs
bsd-3-clause
6,633
0
12
1,192
1,807
976
831
131
3
module Base.Import( randomHex , hmacSha256 , showText , encodeToText , ID , BaseConnection , Text , UTCTime , fromTime , MonadIO , liftIO , lift , join , ReaderT , runReaderT , ask , asks , local , when , unless , (<>) , Default(..) , fromMaybe , listToMaybe , maybeTo...
leptonyu/mint
corn/src/Base/Import.hs
bsd-3-clause
3,689
0
12
1,052
992
572
420
116
1
module Main where import Prelude hiding (take) import Data.Char import Test.HUnit import Data.Deciparsec import Test.HUnit.Deciparsec main :: IO () main = runTestTT tests >> return () where tests = TestList [primTests] primTests :: Test primTests = "Prim parsers" ~: [ eofTests, failTests, returnTests, unexpe...
d3tucker/deciparsec
test/Test.hs
bsd-3-clause
3,904
0
12
1,489
996
604
392
83
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Database where import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Reader (asks) import Control.Monad.Reader.Class (Mon...
bendiksolheim/listify-backend
src/Database.hs
bsd-3-clause
2,680
0
12
640
897
466
431
79
2
import Prelude hiding (pure) class Arrow a where pure :: (b -> c) -> a b c (>>>) :: a b c -> a c d -> a b d first :: a b c -> a (b, d) (c, d) second :: Arrow a => a b c -> a (d, b) (d, c) second f = pure swap >>> first f >>> pure swap where swap ~(x, y) = (y, x) assoc :: ((a, b), c) -> (a, (b, c)) a...
capn-freako/Haskell_Misc
Arrows_and_Computation/arrow_instances.hs
bsd-3-clause
983
1
13
303
658
364
294
28
1
{-# LANGUAGE ViewPatterns #-} module Transform.Extract.Camera ( extractor ) where import Hoops.Match import Hoops.SyntaxToken import Transform.Extract.Common import Transform.Extract.Util extractor :: BlockKind -> ExtractFunc extractor kind = case kind of "HC_Set_Camera" -> extract _ -> const $ return ...
thomaseding/cgs
src/Transform/Extract/Camera.hs
bsd-3-clause
1,767
0
21
505
635
312
323
39
6
module Logic.Pretty where import Logic.Formula import Prelude hiding (Left,Right) import Text.PrettyPrint.Leijen args as = char '(' <> hcat (punctuate comma as) <> char ')' instance Pretty Var where pretty (Var v) = text v instance Pretty Function where pretty (Function f) = text f instance Pretty Term where ...
bmmoore/logic
Logic/Pretty.hs
bsd-3-clause
3,385
2
13
817
1,323
672
651
73
10
{-# Language FlexibleInstances #-} {-# Language TypeSynonymInstances #-} -- A test where tokens are given in random order to see if the -- algorithm terminates always in a valid state (i.e. not Unexpected). module Main where import Test.Framework (defaultMain, testGroup, Test) import Test.Framework.Providers.HUnit imp...
noteed/syntactical
tests/Permutations.hs
bsd-3-clause
2,793
0
10
661
728
397
331
74
2
{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-} module Mapping ( Numbered (..) , o , unNumbered , number , Traversable () ...
emilaxelsson/ag-graph
src/Mapping.hs
bsd-3-clause
2,683
0
12
685
831
441
390
60
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module GameM where import Control.Category import Control.Lens import qualified Control.Monad.Random as Random import Control.Monad.Reader as Reader import qualified Control.Monad.State as State import qualified Data.IntMap.Strict as IntMap im...
fros1y/umbral
src/GameM.hs
bsd-3-clause
2,219
0
13
392
669
351
318
57
1
----------------------------------------------------------------------------- -- | -- Module : Data.OrgMode.Parse.Attoparsec.Content.List -- Copyright : © 2014 Parnell Springmeyer -- License : All Rights Reserved -- Maintainer : Parnell Springmeyer <parnell@digitalmentat.com> -- Stability : stable --...
digitalmentat/orgmode-parse
src/Data/OrgMode/Parse/Attoparsec/Content/List.hs
bsd-3-clause
4,135
0
15
1,309
783
432
351
56
1
-- | -- Copyright : Anders Claesson 2014, 2015 -- Maintainer : Anders Claesson <anders.claesson@gmail.com> -- License : BSD-3 -- module Freq ( freqMap , freq , distMap , dist ) where import Data.List import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map freqMap :: (Ord k, Nu...
akc/freq
Freq.hs
bsd-3-clause
733
0
10
193
323
177
146
19
1
-- | Test conditional sync. Server has local counter that is synced to clients, -- but value is sent only on certain condition. -- -- Usage: -- -- * Start server: `gore-and-ash-sync-example03 server 5656` -- -- * Start client: `gore-and-ash-sync-example03 client localhost 5656` module Main where import Control.Lens im...
Teaspot-Studio/gore-and-ash-sync
examples/Example03.hs
bsd-3-clause
4,197
0
15
885
1,190
596
594
-1
-1
{-# LANGUAGE DeriveDataTypeable, UndecidableInstances #-} {-# LANGUAGE CPP #-} -- -- (c) The University of Glasgow 2002-2006 -- -- The IO Monad with an environment -- -- The environment is passed around as a Reader monad but -- as its in the IO monad, mutable references can be used -- for updating state. -- module IO...
spacekitteh/smcghc
compiler/utils/IOEnv.hs
bsd-3-clause
7,073
0
13
1,424
1,840
973
867
-1
-1
module HsBot.Plugins.Base where import HsBot.Base.Env import HsBot.Base.State type CallbackFunction = String -> SendMessage -> Env -> IO Env data Plugin a = Plugin { cbPrio :: Integer, cbFunction :: CallbackFunction }
buetow/hsbot
HsBot/Plugins/Base.hs
bsd-3-clause
228
0
8
41
62
38
24
7
0
{-# LANGUAGE QuasiQuotes #-} module Line.Messaging.API.TypesSpecHelper where import Text.RawString.QQ import qualified Data.ByteString.Lazy as BL textMessageableResult :: BL.ByteString textMessageableResult = [r| { "type": "text", "text": "Hello, world" } |] imageMessageableResult :: BL.ByteString imageMess...
noraesae/line
test/Line/Messaging/API/TypesSpecHelper.hs
bsd-3-clause
7,647
0
5
2,646
328
227
101
42
1
{-# LANGUAGE OverloadedStrings #-} -- | Logging to stdout is primarily intended for development purposes or creating command line status tools. -- -- For more meaningful access to statistics, metrics should be sent to something like Librato or Graphite. module Data.Metrics.Reporter.StdOut ( printHealthCheck, printH...
graydon/metrics
src/Data/Metrics/Reporter/StdOut.hs
mit
1,591
0
13
278
281
156
125
26
4
{-- snippet all --} data DivByError a = DivBy0 | ForbiddenDenominator a deriving (Eq, Read, Show) divBy :: Integral a => a -> [a] -> Either (DivByError a) [a] divBy _ [] = Right [] divBy _ (0:_) = Left DivBy0 divBy _ (10:_) = Left (ForbiddenDenominator 10) divBy _ (20:_) = Left (For...
binesiyu/ifl
examples/ch19/divby7.hs
mit
511
0
12
135
223
114
109
12
2
{- | Module :./CMDL/Commands.hs Description : list of all commands of CMDL interface Copyright : uni-bremen and DFKI License : GPLv2 or higher, see LICENSE.txt or LIZENZ.txt Maintainer : r.pascanu@jacobs-university.de Stability : provisional Portability : portable CMDL.Commands contains the description o...
spechub/Hets
CMDL/Commands.hs
gpl-2.0
6,182
0
19
1,067
1,448
741
707
136
10
-- labmate-to-sanity -- By Gregory W. Schwartz -- Takes a csv file and return a new csv file in correct formatting -- Built-in import Data.List -- Cabal import Options.Applicative import qualified Data.List.Split as Split -- Command line arguments data Options = Options { inputSep :: String ...
GregorySchwartz/labmate-to-sanity
src/Main.hs
gpl-2.0
3,128
0
17
1,112
766
393
373
70
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribePlacementGroups.hs
mpl-2.0
4,904
0
10
951
584
358
226
66
1
module Holo.Instances.Named where import Data.Text (Text) import Graphics.Flatland import {-# SOURCE #-} Holo.Classes instance {-# OVERLAPPABLE #-} Named a instance {-# OVERLAPPABLE #-} Named Text
deepfire/mood
src/Holo/Instances/Named.hs
agpl-3.0
271
2
5
99
46
27
19
7
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} module Test04 where import qualified GHC.Generics import WithCli main :: IO () main = withCli run run :: A -> B -> IO () run a b = do print (a, b) data A = A { aa :: String } deriving (Show, GHC.Generics.Generic) instance Generic A in...
kosmikus/getopt-generics
docs/Test04.hs
bsd-3-clause
517
0
8
122
173
92
81
24
1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Util.XUtils -- Copyright : (c) 2007 Andrea Rossato -- 2010 Alejandro Serrano -- License : BSD-style (see xmonad/LICENSE) -- -- Maintainer : andrea.rossato@unibz.it -- Stability : u...
f1u77y/xmonad-contrib
XMonad/Util/XUtils.hs
bsd-3-clause
7,960
0
20
2,312
2,202
1,128
1,074
146
2
{-# LANGUAGE ScopedTypeVariables #-} module Database.Persist.Sql.Run where import Control.Exception (bracket, mask, onException) import Control.Monad (liftM) import Control.Monad.IO.Unlift import Control.Monad.Logger import Control.Monad.Trans.Reader hiding (local) import Control.Monad.Trans.Resource import Data.IORef...
creichert/persistent
persistent/Database/Persist/Sql/Run.hs
mit
7,805
0
23
1,785
1,602
849
753
-1
-1
module Hello2 where main = print "Hello, World!"
charleso/intellij-haskforce
tests/gold/parser/Hello00002.hs
apache-2.0
50
0
5
9
12
7
5
2
1
{-# LANGUAGE TupleSections #-} import CoreSyn import CoreUtils import Id import Type import MkCore import CallArity (callArityRHS) import MkId import SysTools import DynFlags import ErrUtils import Outputable import TysWiredIn import Literal import GHC import Control.Monad import Control.Monad.IO.Class import System.En...
snoyberg/ghc
testsuite/tests/callarity/unittest/CallArity1.hs
bsd-3-clause
9,833
0
25
2,962
4,318
2,384
1,934
201
2
module PrettyUtil (ppWhere,ppContext) where --import SrcLoc import PrettyPrint import PrettySymbols(imp) -- Pretty prints where declaration lists, also used in multiple places. --ppWhere :: [Doc] -> Doc ppWhere [] = empty ppWhere ds = sep [kw "where",letNest (layout ds)] -- Pretty prints contexts, if they are prese...
forste/haReFork
tools/base/pretty/PrettyUtil.hs
bsd-3-clause
409
0
9
70
106
58
48
8
1