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 DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/BackendServices/Delete.hs
mpl-2.0
4,461
0
16
965
477
287
190
76
1
module Main where import Graphics.UI.Gtk (initGUI, mainGUI) import System.Gnome.GConf import Monad (when) import System.Exit (exitFailure) import List (intersperse) main = do -- connect to gconf conf <- gconfGetDefault -- for the purposes of this demo check for key and display usage message exists <- conf `...
thiagoarrais/gtk2hs
demo/gconf/GConfDemo.hs
lgpl-2.1
6,494
0
18
1,111
1,134
572
562
-1
-1
{-# LANGUAGE DataKinds , ExplicitNamespaces , TypeFamilies , TypeOperators , UndecidableInstances #-} module VinylTypeLits ( NatToLit , LitToNat ) where import Data.Vinyl.TypeLevel as V (Nat(Z, S)) import GHC.TypeLits as G (Nat, type (+), type (-)) type family Nat...
cumber/havro
src/VinylTypeLits.hs
lgpl-3.0
525
0
10
155
167
101
66
16
0
{-# LANGUAGE NoMonomorphismRestriction #-} module Jaek.Render.Tree ( drawTree ) where import Jaek.Tree import Diagrams.Prelude hiding (First (..)) import Diagrams.Backend.Cairo import Data.Monoid import Data.Tree (Tree (..)) drawTree :: HTree -> QDiagram Cairo R2 (First TreePath) drawTree = drawTree' -- adding ...
JohnLato/jaek
src/Jaek/Render/Tree.hs
lgpl-3.0
1,194
0
14
263
262
141
121
22
2
{- Created : 2013 Oct 01 (Tue) 14:46:30 by carr. Last Modified : 2014 Mar 05 (Wed) 13:25:38 by Harold Carr. -} module FP03ObjSetsTweetSetTest where import FP03ObjSetsTweetData import FP03ObjSetsTweetReader import FP03ObjSetsTweetSet import Test.HUnit import Test...
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2013-11-coursera-fp-odersky-but-in-haskell/FP03ObjSetsTweetSetTest.hs
unlicense
3,582
0
15
1,039
955
506
449
59
1
{-# Language TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {- | This module aims to make mapping between algebraic data types and bson documents easy. You can also generate documents with 'selectFields', which takes a list of functions names that of type a -> b and returns a function of type a -> Document. ...
bitonic/bson-mapping
src/Data/Bson/Mapping.hs
apache-2.0
9,004
6
25
2,725
1,995
1,073
922
115
12
{-# LANGUAGE NoMonomorphismRestriction, QuasiQuotes #-} import Control.Arrow import Control.Monad import NeuralNetwork import Numeric.LinearAlgebra.HMatrix import Text.Printf.TH import VisualizeFunction andDataSet = map (vector *** vector) [ ([0,0], [0]), ([0,1], [0]), ([1,0], [0]), ([1,1], [1]) ] ...
aweinstock314/neural-networks
TestNeuralNetwork.hs
apache-2.0
1,043
4
15
185
506
289
217
28
1
-- |'nodeIx' is exported for the buildGraph function in ListM. module Data.InductiveGraph.ListImpl (InductiveGraph, Node, newVertex, vertexValue, updateVertex, insertEdge, deleteEdge, isEdgePresent, reverseEdges, vertexSuccs, graphFold, removeToEdges, emptyGraph, nodeIx, firstVertex, combineVertices, foldVerticesM...
brownplt/ovid
src/Data/InductiveGraph/ListImpl.hs
bsd-2-clause
12,483
0
19
2,829
3,483
1,788
1,695
167
7
module Test.Day22 where import Day22 import Data.Function (on) import Data.List (minimumBy) import Test.Tasty import Test.Tasty.HUnit day22 :: TestTree day22 = testGroup "Wizard Simulator 20XX" [part1, part2] part1 :: TestTree part1 = testGroup "Part 1" [...
taylor1791/adventofcode
2015/test/Test/Day22.hs
bsd-2-clause
1,726
0
12
375
654
358
296
46
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QLCDNumber_h.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:30 Warning : this file is machine generated - do ...
uduki/hsQt
Qtc/Gui/QLCDNumber_h.hs
bsd-2-clause
56,978
0
18
12,269
18,819
9,078
9,741
-1
-1
module Main where import Control.Applicative ((<$>)) import Data.Char import Data.Bits import Data.List (group) newtype Bit = Bit Bool deriving (Eq) instance Show Bit where show (Bit True) = "0" show (Bit False) = "00" main :: IO () main = do input <- group . concatMap (reverse . bitsTo7Bit . ord) <$> getLine :...
epsilonhalbe/Sammelsurium
Codingame/ChuckNorris/ChuckNorris.hs
bsd-3-clause
767
0
16
203
354
184
170
21
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} module Main where import Protolude.Lifted hiding ((<>), catch, find, pred, try) import Inspector import Inspector.Cli.Args import Options.Applicative hiding (header) withInfo :: Parser a -> Text -> ParserInfo a wit...
pbogdan/ngx-cache-inspector
app/Main.hs
bsd-3-clause
922
0
16
258
243
130
113
27
4
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Config.LXQt -- Description : Config for integrating xmonad with LXQt. -- Copyright : (c) Petr Shevtsov <petr.shevtsov@gmail.com> -- License : BSD -- -- M...
xmonad/xmonad-contrib
XMonad/Config/LXQt.hs
bsd-3-clause
1,207
0
9
242
145
97
48
13
1
-- | Main Program reads the command line options, checks the supplied -- sif file, and pushes the dot version out to STDOUT. {-# LANGUAGE DeriveDataTypeable #-} module Main (main) where import System.Console.CmdArgs import System.Environment (getArgs, withArgs) import System.IO import System.FilePath import System.Exi...
jfdm/ottar
src/Main.hs
bsd-3-clause
3,297
0
25
1,344
629
318
311
74
7
module Game.Pong.Logic where import System.Random import Data.Maybe import Game.Event import Game.Vector import Game.Pong.Core shiftLineToEdgeOnAxis :: Vec2f -> Vec2f -> (Vec2f,Vec2f) -> (Vec2f,Vec2f) shiftLineToEdgeOnAxis axis size (cStart,cEnd) = (start,end) where start ...
Ginto8/Pong-Haskell
src/Game/Pong/Logic.hs
bsd-3-clause
7,138
0
19
3,132
1,848
992
856
141
7
module CallByName.Data where import Control.Monad.Trans.State.Lazy import qualified Data.Map as M import Data.Maybe (fromMaybe) type Try = Either String type Environment = M.Map String DenotedValue empty :: Environment empty = M.empty initEnvironment ::...
li-zhirui/EoplLangs
src/CallByName/Data.hs
bsd-3-clause
4,351
0
13
1,015
1,595
832
763
116
3
-- Find all incomplete tasks in my personal notes. -- -- Original author: David Banas <capn.freako@gmail.com> -- Original date: January 31, 2018 -- -- Copyright (c) 2018 David Banas; all rights reserved World wide. {-# LANGUAGE RecordWildCards #-} module Main where import Control.Arrow ((&&&)) import Control....
capn-freako/Haskell_Misc
NotesParse/get_tasks.hs
bsd-3-clause
2,398
0
21
662
684
350
334
61
3
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Queries.Uninterpreted -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Testing uninterpreted value extraction ------------------...
josefs/sbv
SBVTestSuite/TestSuite/Queries/Uninterpreted.hs
bsd-3-clause
1,168
0
11
233
237
127
110
22
1
-- This handles the `!version` command. module Network.Ribot.Irc.Part.Version ( versionPart , versionCommand ) where import Data.Version (showVersion) import Network.IRC.Bot.BotMonad (BotMonad(..), maybeZero) import Network.IRC.Bot.Commands (PrivMsg(..), askSenderNickName, ...
erochest/ribot
src/Network/Ribot/Irc/Part/Version.hs
bsd-3-clause
1,311
0
15
376
318
177
141
24
1
{-# LANGUAGE DeriveFunctor, CPP, Trustworthy, GeneralizedNewtypeDeriving #-} -- | See "Data.Compositions.Snoc" for normal day-to-day use. This module contains the implementation of that module. module Data.Compositions.Snoc.Internal where import qualified Data.Compositions as C import Prelude hiding (sum, drop, take, ...
liamoc/composition-tree
Data/Compositions/Snoc/Internal.hs
bsd-3-clause
9,218
0
16
1,759
1,138
651
487
44
1
{-# LANGUAGE RecordWildCards #-} -- {-# LANGUAGE DeriveFunctor #-} module Test.Cluster ( doCluster , fsmw ) where import FV.Types ( VHMeas(..) , HMeas(..) , Prong(..) ...
LATBauerdick/fv.hs
src/Test/Cluster.hs
bsd-3-clause
15,886
0
64
5,576
3,872
2,033
1,839
235
11
module Colors (RGBColor (RGBTuple, RGBString), toggleRGBdescription) where data RGBColor = RGBTuple (Float, Float, Float) | RGBString String deriving Show toggleRGBdescription :: RGBColor -> RGBColor toggleRGBdescription (RGBTuple (x, y, z)) = RGBString $ "#" ++ to2digitHex x ...
garykl/Horg
Colors.hs
bsd-3-clause
1,887
0
11
821
512
278
234
50
17
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Ordinal.CA.Corpus ( corpus ) where import Data.String impo...
facebookincubator/duckling
Duckling/Ordinal/CA/Corpus.hs
bsd-3-clause
3,071
0
9
1,492
557
322
235
93
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.SGIX.PixelTiles -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/SGIX/PixelTiles.hs
bsd-3-clause
886
0
4
99
58
45
13
10
0
{-# LANGUAGE CPP, ScopedTypeVariables, GADTs, RecordWildCards, TemplateHaskell, MultiParamTypeClasses #-} module Llvm.Pass.DataUsage where import Data.Maybe import qualified Data.Set as S import qualified Data.Map.Strict as M import Llvm.Query.HirCxt import qualified Compiler.Hoopl as H import Compiler.Hoopl import L...
mlite/hLLVM
src/Llvm/Pass/DataUsage.hs
bsd-3-clause
37,166
0
39
12,666
11,383
5,819
5,564
639
134
#!/usr/bin/env runhaskell module Main where import Control.Monad (forever) import Data.List (sortOn) import Lib import System.Environment import System.IO (hFlush, stdout) alphabet :: String alphabet = ['a'..'z'] main :: IO () main = do args <- getArgs dict <- getDict args case length args of 2 -> printOr...
rashack/alpha-words.hs
app/Main.hs
bsd-3-clause
1,890
0
16
376
649
319
330
56
2
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} module NHorn.NaturalHornExts ( AxiomRule, Trans, axim, trans ) where import Text.PrettyPrint.Leijen import NHorn.LaCarte import NHo...
esengie/algebraic-checker
src/NHorn/NaturalHornExts.hs
bsd-3-clause
1,784
2
12
525
743
372
371
45
1
module Cryptol.ModuleM ( ModuleM , liftCmd , io , runModuleM , checkExpr , evalExpr , satProve , loadModuleByPath , loadPrelude , getEvalEnv , getPrimMap , renameInteractive , typeCheckInteractive ) where import Cryptol.ModuleSystem (ModuleCmd, initialModuleEnv) import Cryptol.ModuleSystem....
GaloisInc/cryfsm
Cryptol/ModuleM.hs
bsd-3-clause
2,329
0
12
384
736
412
324
59
2
module Shared.String ( substring ) where substring :: String -> String -> Bool substring _ [] = False substring xs ys | prefix xs ys = True | substring xs (tail ys) = True | otherwise = False prefix :: String -> String -> Bool prefix [] _ = True prefix _ [] = False prefix (x:xs) (y:ys) = (x == y) && pre...
Rydgel/advent-of-code-2016
src/Shared/String.hs
bsd-3-clause
330
0
10
82
163
82
81
12
1
import Control.Monad (replicateM_) import qualified Network.Transport.TCP as TCP import Control.Distributed.Process import Control.Distributed.Process.Internal.Types (NodeId(..)) import Control.Distributed.Process.Node import Control.Concurrent (newEmptyMVar, takeMVar, putMVar) import Control.Concurrent.Async import Pi...
bgamari/tpar
Benchmark.hs
bsd-3-clause
2,329
2
14
603
634
308
326
56
1
module Main where import System.Environment import Zipper import Execution sourceToList :: [Char] -> [Term] sourceToList source = foldr charToTermList [] source where charToTermList :: Char -> [Term] -> [Term] charToTermList '+' tail' = (Incr : tail') charToTermList '-' tail' = (Decr : tail') ...
rodneyp290/Brainfunc
app/Main.hs
bsd-3-clause
1,022
0
17
308
339
173
166
29
9
----------------------------------------------------------------------------- -- | -- Copyright : (c) 2012 Duncan Coutts, Bernie Pope, Mikolaj Konarski -- License : BSD-style -- Maintainer : florbitous@gmail.com -- Stability : experimental -- Portability : ghc -- -- A tool to help profiling a Haskell program u...
Mikolaj/haskell-linux-perf
ghc-events-perf/ghc-events-perf.hs
bsd-3-clause
3,706
0
11
759
569
314
255
56
1
module Test.SymExec where import Program.List (nil, revAcco, reverso) import Program.Programs (doubleAppendo) import Syntax import Transformer.SymbolicExecution dA = Program doubleAppendo $ fresh ["x", "y", "z", "r"] (call "doubleAppendo" [V "x", ...
kajigor/uKanren_transformations
test/auto/Test/SymExec.hs
bsd-3-clause
596
0
10
159
225
118
107
12
1
{- (c) The University of Glasgow 2006-2012 (c) The GRASP Project, Glasgow University, 1992-1998 -} -- | This module defines classes and functions for pretty-printing. It also -- exports a number of helpful debugging and other utilities such as 'trace' and 'panic'. -- -- The interface to this module is very similar to ...
shlevy/ghc
compiler/utils/Outputable.hs
bsd-3-clause
44,912
0
20
11,499
10,622
5,669
4,953
-1
-1
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} module Development.Shake.Install.Utils where import Control.Lens import Control.Monad (when) import Development.Shake as Shake (Action, traced) import Development.Shake.Install.PersistedEnvironment as Shake import Development.Shake.Install.RequestRespon...
alphaHeavy/shake-install
Development/Shake/Install/Utils.hs
bsd-3-clause
4,343
0
15
882
1,078
574
504
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | This module is improved version of Nettle.OpenFlow.StrictPut -- I hope we'll merge changes someday. -- -- This module provides a monad for serializing data into byte strings. -- It provide...
ARCCN/hcprobe
src/Network/Openflow/StrictPut.hs
bsd-3-clause
8,499
0
15
1,943
2,350
1,273
1,077
168
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Concurrent import System.Exit import Types import UI import IM import Util main = do putStrLn "Welcome To PeMo Messenger!" mSession <- mkSession case mSession of Nothing -> do put...
zydeon/PeMo
src/Main.hs
bsd-3-clause
735
0
12
279
159
79
80
22
2
module System.Mesos.Raw.TaskInfo where import System.Mesos.Internal import System.Mesos.Raw.CommandInfo import System.Mesos.Raw.ContainerInfo import System.Mesos.Raw.DiscoveryInfo import System.Mesos.Raw.ExecutorInfo import System.Mesos.Raw.HealthCheck import ...
Atidot/hs-mesos
src/System/Mesos/Raw/TaskInfo.hs
mit
4,590
0
23
1,310
1,489
711
778
125
0
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Test.AWS.Gen.KMS -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay...
fmapfmapfmap/amazonka
amazonka-kms/test/Test/AWS/Gen/KMS.hs
mpl-2.0
13,353
0
7
2,924
1,549
911
638
269
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/UnassignInstance.hs
mpl-2.0
3,531
0
9
714
363
224
139
48
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="sr-CS"> <title>SOAP Scanner | ZAP Extension</title> <maps> <homeID>top</homeID> <mapre...
veggiespam/zap-extensions
addOns/soap/src/main/javahelp/org/zaproxy/zap/extension/soap/resources/help_sr_CS/helpset_sr_CS.hs
apache-2.0
974
85
52
160
398
210
188
-1
-1
module Foundation where import Prelude import Yesod import Yesod.Static import Yesod.Auth import Yesod.Auth.BrowserId import Yesod.Auth.GoogleEmail import Yesod.Default.Config import Yesod.Default.Util (addStaticContentExternal) import Network.HTTP.Conduit (Manager) import qualified Settings import Settings.Developmen...
puffnfresh/yesod-buildpack-demo
Foundation.hs
bsd-2-clause
6,140
0
17
1,293
824
455
369
-1
-1
module Graphics.UI.Threepenny.Canvas ( -- * Synopsis -- | Partial binding to the HTML5 canvas API. -- * Documentation Canvas , Vector, Point , Color(..), ColorStop, Gradient, FillStyle , drawImage, clearCanvas , solidColor, htmlColor , linearGradient, horizontalLinearGradient, verti...
duplode/threepenny-gui
src/Graphics/UI/Threepenny/Canvas.hs
bsd-3-clause
10,542
0
16
2,373
1,972
1,082
890
157
6
{- partDefault :: [(Part, a)] -> Group (Part, a) partDefault xs = groupDefault $ fmap (\(p,x) -> (p^._instrument,(p,x))) xs -}
FranklinChen/music-score
sketch/partDefault.hs
bsd-3-clause
132
0
2
24
3
2
1
1
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Distribution.Types.Benchmark ( Benchmark(..), emptyBenchmark, benchmarkType, benchmarkModules, benchmarkModulesAutogen ) where import Prelude () import Distribution.Compat.Prelude import Distribution.Types.BuildInfo import ...
sopvop/cabal
Cabal/Distribution/Types/Benchmark.hs
bsd-3-clause
2,157
0
15
525
435
244
191
47
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module ToDoList where import Control.Arrow ((&&&)) import Control.Lens ((.=)) import Data.Maybe import Data.Traversable (for) import Francium import Francium.CSS hiding (filter) import Franci...
bitemyapp/Francium
todo-mvc/ToDoList.hs
bsd-3-clause
5,558
8
27
2,653
1,011
594
417
136
1
-- {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} module ShouldSucceed where class C a where op1 :: a -> a class (C a) => B a where op2 :: a -> a -> a instance (B a) => B [a] where op2 xs ys = xs instance C [a] where op1 xs = xs {- This was passed by the prototype, but failed hard in the new typechecker w...
rahulmutt/ghcvm
tests/suite/typecheck/compile/tc045.hs
bsd-3-clause
369
0
8
83
104
56
48
9
0
-- | Pretty printer utilities. -- -- This is a re-export of Daan Leijen's pretty printer package (@wl-pprint@), -- but with a `Pretty` class that includes a `pprPrec` function. module DPH.Base.Pretty ( module Text.PrettyPrint.Leijen , Pretty(..) , pprParen -- * Rendering , ...
mainland/dph
dph-plugin/DPH/Base/Pretty.hs
bsd-3-clause
3,184
0
11
950
793
425
368
72
8
{-# LANGUAGE Haskell98, CPP, DeriveDataTypeable, ForeignFunctionInterface, TypeSynonymInstances #-} {-# LINE 1 "dist/dist-sandbox-261cd265/build/Network/Socket/Internal.hs" #-} {-# LINE 1 "Network/Socket/Internal.hsc" #-} {-# LANGUAGE CPP #-} {-# LINE 2 "Network/Socke...
phischu/fragnix
tests/packages/scotty/Network.Socket.Internal.hs
bsd-3-clause
7,393
0
9
1,452
671
403
268
87
1
module Language.ABCdiff (abcdiff) where -- -- $Id$ import Language import Autolib.Set import Autolib.Util.Zufall import Control.Monad ( guard ) import Data.List ( sort, nub ) abcdiff :: Language abcdiff = Language { abbreviation = "{ a^i b^j c^k : i /= j, j /= k, k /= i }" , nametag = "ABCdif...
florianpilz/autotool
src/Language/ABCdiff.hs
gpl-2.0
952
6
15
299
371
201
170
28
1
module Uni.SS04.Serie5 where -- $Id$ import SAT.Quiz import SAT.Types import SAT.Param ( p ) import Inter.Types generate :: [ IO Variant ] generate = [ return $ Variant $ SAT.Quiz.quiz "SAT" "QUIZ" $ p 10 ]
Erdwolf/autotool-bonn
src/Uni/SS04/Serie5.hs
gpl-2.0
220
0
9
49
75
43
32
8
1
{- 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.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Ye-Yong-Chi/codeworld
codeworld-base/src/Control/Monad/ST/Lazy/Unsafe.hs
apache-2.0
771
0
4
136
29
23
6
4
0
{-# LANGUAGE DataKinds, NoImplicitPrelude #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} module Tests.Function (allTests) where import Prelude ((.), id, ($), asTypeOf) import Language.Hakaru.Syntax.Prelude import Language.Hakaru.Types.DataKind import Language.Hakaru.Syntax.AST (Term) import Language.Hakaru.Syntax.ABT (ABT...
zachsully/hakaru
haskell/Tests/Function.hs
bsd-3-clause
959
0
17
243
350
194
156
-1
-1
module HsDeclPretty (ppContext,ppFunDeps) where import HsDeclStruct import HsIdentPretty() import HsAssocPretty() import PrettySymbols(el,rarrow) import PrettyPrint import PrettyUtil(ppWhere,ppContext) import HsGuardsPretty(ppRhs) instance (PrintableOp i,Printable e, Printable p, Printable ds, Printable t, Printa...
forste/haReFork
tools/base/AST/HsDeclPretty.hs
bsd-3-clause
3,241
24
19
971
1,375
686
689
66
1
-- | Internal types to the library. module Stack.Types.Internal where import Control.Concurrent.MVar import Control.Monad.Logger (LogLevel) import Data.Text (Text) import Network.HTTP.Client.Conduit (Manager,HasHttpManager(..)) import Stack.Types.Config -- | Monadic environment. data Env config = Env {envConfig ::...
mathhun/stack
src/Stack/Types/Internal.hs
bsd-3-clause
1,997
0
11
356
545
293
252
66
0
import Module (message) main = putStrLn $ "Main.hs: " ++ message
mydaum/cabal
cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/pkg/Main.hs
bsd-3-clause
66
1
6
12
25
12
13
2
1
-- | Miscellaneous utiliy functions. -- {-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables, BangPatterns #-} module Dfterm3.Util ( newFinalizableIORef , newFinalizableFinRef , finalizeFinRef , touchFinRef , FinRef() , safeFromIntegral , forkDyingIO , forkExceptionTaggedIO , excep...
Noeda/dfterm3
src/Dfterm3/Util.hs
isc
3,642
0
13
817
919
467
452
74
1
{-# LANGUAGE ForeignFunctionInterface #-} module AGLGUI.Raw ( WVPtr , JSValPtr , JSArrPtr , Callback , FunPtr , aglguiInit , aglguiQuit , aglguiUpdate , aglguiApiReg , aglguiMakeWebView , aglguiLoadURL , aglguiTexture , mkCallback , freeCallback , aglguiInjectMouseMove , aglguiInjectMouseDown , aglguiInjectMouseUp , a...
tcsavage/hsaglgui
src/AGLGUI/Raw.hs
mit
3,019
0
10
486
676
369
307
86
1
import Data.List import qualified Data.Map as M import Picologic.AST import Picologic.Pretty import Picologic.Solver import Picologic.Tseitin import System.Exit (exitFailure) import System.IO.Unsafe (unsafePerformIO) import Test.QuickCheck instance Arbitrary Expr where arbitrary = sized $ \n -> tree (round $ sq...
sdiehl/picologic
tests/Test.hs
mit
2,943
0
15
922
1,200
606
594
91
2
module Prelude.CompatSpec (main, spec) where import Test.Hspec import Prelude () import Prelude.Compat main :: IO () main = hspec spec spec :: Spec spec = do describe "($!)" $ do it "is infixr 0" $ do -- #54 (succ $! succ $! 0) `shouldBe` (2 :: Int) (succ $! 2 *** 2) ...
haskell-compat/base-compat
base-compat-batteries/test/Prelude/CompatSpec.hs
mit
398
0
16
125
160
92
68
15
1
data People = Person String Int jogi :: People jogi = Person "Joachim Löw" 50 isAdult :: People -> Bool isAdult (Person name age) = (age >= 18)
MartinThoma/LaTeX-examples
documents/Programmierparadigmen/scripts/haskell/algebraic-datatypes.hs
mit
145
0
7
28
59
31
28
5
1
module Test.Vision.Image.Storage.PGM.Internal ( testInternal, pgmFile, pgm ) where import Vision.Image.Storage.PGM.Internal as I import Test.Hspec import Test.QuickCheck import Data.Functor ((<$>)) import Data.Monoid (mconcat) import Data.Either (isRight) import Data.Binary (Word8) import Data.List (intersperse)...
hughfdjackson/friday-pgm
test/Test/Vision/Image/Storage/PGM/Internal.hs
mit
1,988
0
16
358
729
398
331
51
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} {-# LANGUAGE TemplateHaskell, QuasiQuotes #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE CPP #-} {- | Module : Snap.Routes Copyright : (c) Anupam Jain 2...
ajnsit/snap-routes
src/Snap/Routes.hs
mit
10,571
0
15
2,170
2,380
1,281
1,099
166
10
{- Tests for connection establishment and athorization. It is assumed than these tests being executed with different settings in pg_hba.conf -} import Control.Exception (finally) import Data.Monoid ((<>)) import Data.Foldable import qualified Data.ByteString as B import System.Process (callCommand) import Test.Ta...
postgres-haskell/postgres-wire
tests_connection/test.hs
mit
2,272
0
13
531
474
259
215
49
1
import Grammar (parseExpr) import Data.Tree.Pretty (drawVerticalTree) import Nodes main :: IO () main = putStrLn . drawVerticalTree . ast . parsed $ "2 + 2\n(3 + 1) + 2\n" parsed = parseExpr
milankinen/cbhs
src/Main.hs
mit
200
0
8
41
59
33
26
7
1
module PrintLasm where import Data.Char import Data.Map hiding (map, foldr) import Prelude hiding (lookup) import Control.Monad.State import Debug.Trace import AbsLasm data LEnv = Env type EnvState = State LEnv -- Printer printLASM :: LProgram -> String printLASM prog = render progDoc where progDoc = evalState (...
davidsundelius/JLC
src/PrintLasm.hs
mit
8,821
0
15
3,148
3,805
1,877
1,928
197
4
{-# LANGUAGE QuasiQuotes #-} module Data.String.InterpolateSpec (main, spec) where import Test.Hspec import Test.QuickCheck import Data.String.Interpolate main :: IO () main = hspec spec spec :: Spec spec = do describe "[i|...|]" $ do it "interpolates an expression of type Int" $...
beni55/interpolate
test/Data/String/InterpolateSpec.hs
mit
1,170
0
19
293
283
158
125
24
1
{- - By Yue Wang 13.12.2014 - proj02 Given a list, find the first and last occurrences of the largest element. - -} firstAndLast :: (Ord a) => [a] -> (Int,Int) firstAndLast [] = error "empty list" firstAndLast xs = (fstMax xs, lstMax xs) where fstMax seq@(y:ys) = if y == maximum seq then 0 ...
Mooophy/DMA
ch02/proj02.hs
mit
459
0
10
137
156
81
75
5
3
{-# LANGUAGE OverloadedStrings #-} {- | Wai middleware for request throttling. Basic idea: on every (matching) request a counter is incremented. If it exceeds given limit, request is blocked and error response is sent to client. Request counter resets after defined period of time. The `throttle' function limits requ...
maximkulkin/wai-throttler
Network/Wai/Middleware/Throttler.hs
mit
4,815
0
24
1,367
888
482
406
71
3
{-# LANGUAGE BangPatterns #-} module Galua.OpcodeInterpreter(execute) where import Control.Exception hiding (Handler) import Control.Monad import Data.Foldable import Data.IORef import qualified Data.Vector as Vector import qualified Data.Vector.Mutable as IOVector import ...
GaloisInc/galua
galua/src/Galua/OpcodeInterpreter.hs
mit
15,024
0
29
5,206
4,419
2,106
2,313
328
58
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} module Xml.LibrarySpec (spec) where import Lastfm import Lastfm.Library import Test.Hspec import Text.Xml.Lens import SpecHelper spec :: Spec spec = do it "addAlbum" $ shouldHaveXml_ . privately $ addAlbum (pure (albumItem <*> artist "Franz F...
supki/liblastfm
test/api/Xml/LibrarySpec.hs
mit
1,530
0
14
321
453
214
239
-1
-1
-- Copyright 2015-2016 Yury Gribov -- -- Use of this source code is governed by MIT license that can be -- found in the LICENSE.txt file. module Board (Board, genrand, size, pretty_print, pretty_read, solve, to_cnf) where import qualified System.Random import qualified Data.List import qualified Data.Maybe import q...
yugr/sudoku
src/Board.hs
mit
8,721
0
15
2,466
3,319
1,767
1,552
-1
-1
-- Copyright © 2013 Julian Blake Kongslie <jblake@jblake.org> -- Licensed under the MIT license. {-# OPTIONS_GHC -Wall -Werror #-} module Language.GBAsm.Relative where import Data.Generics.Uniplate.Operations import Language.GBAsm.Types -- |Transform operands by replacing relative addressing with subtraction opera...
jblake/gbasm
src/Language/GBAsm/Relative.hs
mit
931
0
12
222
300
158
142
14
6
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.NavigatorID (getAppCodeName, getAppName, getAppVersion, getPlatform, getProduct, getProductSub, getUserAg...
ghcjs/jsaddle-dom
src/JSDOM/Generated/NavigatorID.hs
mit
4,241
0
11
746
937
533
404
74
1
module TuringMachine where import Alphabet import State import Tape as T import Movement import Util -- |Transition function type Transition s a = State s -> Alphabet a -> (State s, Alphabet a, Movement) -- |Turingmachine containing the current state, the transition table and the k -- tapes. data TuringMachine s a =...
carabolic/huring
src/Data/TuringMachine.hs
gpl-2.0
1,343
0
10
278
421
215
206
26
1
module Ch_09 (boundedMin ) where boundedMin :: (Double -> Double) -- ^ function -> Double -- ^ leftmost point -> Double -- ^ rightmost point -> Double -- ^ error bound -> Double -- ^ result within bound boundedMin func a b err | abs (x3 - x0) <= err = (x0 + x3) / 2 | func x1 > func x2 = boundedMin func...
Marcus-Rosti/numerical-methods
src/ch_09/Ch_09.hs
gpl-2.0
496
0
11
158
211
111
100
16
1
-- BNF Converter: Error Monad -- Copyright (C) 2004 Author: Aarne Ranta -- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. module Amath.Expr.ErrM where -- the Error monad: like Maybe type with error msgs import Control.Monad (MonadPlus(..), liftM) data Err a = Ok a | Bad String deriving (Read,...
arnizamani/SeqSolver
Amath/Expr/ErrM.hs
gpl-2.0
586
0
8
153
169
91
78
15
0
{-# LANGUAGE DeriveDataTypeable #-} module DataStructures.Sets where import qualified Data.Set as S import System.Random import System.IO.Unsafe import Control.Exception import Data.Typeable type Set a = S.Set a data SetsException = EmptySet | IndexOutOfRange Int deriving (Show, Typeable) instance ...
ricardopenyamari/ir2haskell
clir-parser-haskell-master/src/DataStructures/Sets.hs
gpl-2.0
2,318
0
19
615
876
454
422
53
2
module Util ( unwordsList ) where unwordsList :: (Show a) => [a] -> String unwordsList = unwords . map show
mhrheaume/hskme
Util.hs
gpl-2.0
110
2
7
22
44
25
19
4
1
{- | 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
GMP/Proof.hs
gpl-2.0
6,140
0
15
1,626
2,265
1,202
1,063
103
2
{-# LANGUAGE DeriveDataTypeable,OverloadedStrings #-} module Ampersand.Prototype.GenFrontend (doGenFrontend) where import Ampersand.Basics import Ampersand.Classes.Relational import Ampersand.ADL1 import Ampersand.Core.ShowAStruct import Ampersand.FSpec.FSpec import ...
AmpersandTarski/ampersand
src/Ampersand/Prototype/GenFrontend.hs
gpl-3.0
27,492
3
31
10,017
5,175
2,659
2,516
410
12
module Examples.Windowing.QDSL where import Prelude hiding (Int,pi,div,foldl,map,replicate,zipWith) import QFeldspar.QDSL import Examples.Prelude.QDSL windowingVec :: Qt (Vec (Complex Float) -> Vec (Complex Float)) windowingVec = [|| \ (Vec ll f) -> let l = ll in $$zipWith (*) ($...
shayan-najd/QFeldspar
Examples/Windowing/QDSL.hs
gpl-3.0
608
4
18
192
249
134
115
-1
-1
module Database.Sedna where import Database.SednaBindings import Database.SednaTypes import Control.Exception import Data.ByteString.Char8 import Data.Text (Text) import qualified Data.Text as Text ----------------------------------------------------------------------...
ExternalReality/SednaDBXML
src/Database/Sedna.hs
gpl-3.0
1,713
0
10
472
328
168
160
27
1
{-# LANGUAGE RecordWildCards, OverloadedStrings #-} import Prelude hiding (takeWhile) import Control.Concurrent (forkIO) import Control.Monad (forever, (>=>), void) import Data.Default (Default(def)) import Data.List (partition) import Data.Maybe import System.Environment (getArgs) import System.Timeout (timeout) impo...
etandel/filter52
src/Main.hs
gpl-3.0
4,633
0
18
1,362
1,338
687
651
104
4
module State where import Spieler import Wurf import Bank import Chart import Data.Acid import Control.Concurrent.STM import Control.Monad ( guard ) import Data.Time import qualified Data.Map as M import qualified Data.Set as S import Text.PrettyPrint.HughesPJ message_queue_length = 1000 protocol_messages_display_l...
jwaldmann/mex
src/State.hs
gpl-3.0
2,948
0
18
1,060
876
451
425
81
6
type Lst a = forall i. Monoid i => (a -> i) -> i
hmemcpy/milewski-ctfp-pdf
src/content/3.11/code/haskell/snippet04.hs
gpl-3.0
48
0
9
13
31
17
14
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Reports/List.hs
mpl-2.0
4,621
0
18
1,119
727
421
306
101
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-adsense/gen/Network/Google/Resource/AdSense/Metadata/Metrics/List.hs
mpl-2.0
2,489
0
12
528
226
141
85
42
1
module SumFusion where import Either sumFusionLeft, sumFusionRight :: (c -> d) -> (a -> c) -> (b -> c) -> Either a b -> d sumFusionLeft f g h = f . Either.either g h sumFusionRight f g h = Either.either (f . g) (f . h) sfl,sfl',sfr,sfr' :: Int sfl = sumFusionLeft ((*10) . read) (show) ...
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2019-Program_Design_by_Calculation-Oliveira/2015-05-LambdaConf/SumFusion.hs
unlicense
592
0
9
173
288
162
126
10
1
module Git.Command.Branch (run) where run :: [String] -> IO () run args = return ()
wereHamster/yag
Git/Command/Branch.hs
unlicense
84
0
7
15
42
23
19
3
1
module Coins.A263135 (derivative, a263135) where import Helpers.ListHelpers (concatReplicate) a263135 :: Int -> Integer a263135 n = a263135_list !! n a263135_list :: [Integer] a263135_list = [0,0,1,2,3,4] ++ list where list = scanl (+) 6 $ concatMap f derivative where f k = replicate k 1 ++ [2] derivative :: [...
peterokagey/haskellOEIS
src/Coins/A263135.hs
apache-2.0
554
0
10
114
246
136
110
15
1
#!/usr/bin/env stack -- stack runghc --resolver ghc-7.10.3 {-# LANGUAGE OverloadedStrings #-} import System.Environment (getArgs) import qualified Data.ByteString.Char8 as S main :: IO () main = getArgs >>= mapM_ go go :: FilePath -> IO () go fp = S.readFile fp >>= S.writeFile fp . S.unlines . go' . S.lines . S.filte...
maxigit/yesodweb.com-content
book/tools/strip-article-info.hs
bsd-2-clause
484
0
11
82
192
102
90
11
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Controller ( withMySite , withDevelApp ) where import MySite import Settings import Yesod.Helpers.Static import Yesod.Auth import Database.Persist.GenericS...
Tarrasch/Nollform
Controller.hs
bsd-2-clause
1,622
0
12
261
281
156
125
30
1
module Drasil.GamePhysics.Unitals where import Language.Drasil import Language.Drasil.ShortHands import Data.Drasil.SI_Units(kilogram, metre, m_2, newton, second) import qualified Data.Drasil.Concepts.Physics as CP (rigidBody) import qualified Data.Drasil.Quantities.Physics as QP (acceleration, angularAccel, angula...
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/GamePhysics/Unitals.hs
bsd-2-clause
15,407
0
14
3,216
4,843
2,685
2,158
245
1
{- Directive to allow Text and String to be mixed -} {-# LANGUAGE OverloadedStrings #-} module Dropbox.Types.Content (Content(..)) where import Data.Aeson ((.:), (.:?), decode, eitherDecode, FromJSON(..), Value(..)) import Control.Applicative ((<$>), (<*>)) import Data.Attoparsec.Number (Number(..)) {- ...
tinkhaven/haskell-dropbox-api
Dropbox/Types/Content.hs
bsd-3-clause
2,015
0
18
1,034
313
192
121
31
0
{-# LANGUAGE Rank2Types #-} ----------------------------------------------------------------------------- -- | -- Module : Codec.Compression.Zlib.Lens -- Copyright : (C) 2012-14 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : p...
hvr/lens
src/Codec/Compression/Zlib/Lens.hs
bsd-3-clause
6,583
0
12
1,149
1,221
725
496
119
1
{-# LANGUAGE OverloadedStrings #-} module Main where import CodeGen import Prelude hiding (take, drop, head, tail) import Data.Text hiding (reverse, zip, filter) import System.Environment import Language.Haskell.Exts as HS hiding (prettyPrint) -- main main :: IO () main = do args <- getArgs case args of [x] -...
mxswd/swift-gen
main/Main.hs
bsd-3-clause
539
0
14
115
151
85
66
16
2
{-# LANGUAGE RankNTypes #-} {-| An ST Monad based interface to the CUDD BDD library This is a straightforward wrapper around the C library. See <http://vlsi.colorado.edu/~fabio/CUDD/> for documentation. Exampe usage: > import Control.Monad.ST > import Cudd.Imperative > > main = do > res <- stToIO $ withManager...
maweki/haskell_cudd
Cudd/Imperative.hs
bsd-3-clause
16,491
0
22
3,951
6,344
3,090
3,254
-1
-1
module Rotate where import Tip.Prelude import qualified Prelude rotate :: Nat -> [a] -> [a] rotate Z xs = xs rotate (S _) [] = [] rotate (S n) (x:xs) = rotate n (xs ++ [x]) rotlen xs = rotate (length xs) xs === xs
danr/emna
examples/Rotate.hs
bsd-3-clause
229
0
8
60
123
66
57
8
1
import Control.Concurrent import Control.Monad import Data.Time import Hypervisor.Console import System.CPUTime import System.Environment import Data.Time.Format main :: IO () main = do con <- initXenConsole args <- getArgs let count = case args of [arg] | take 6 arg == "count=" -> read $ drop 6 a...
GaloisInc/HaLVM
examples/Core/Time/Time.hs
bsd-3-clause
603
0
17
168
193
92
101
20
2