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 #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Rx.Logger.Types ( module Rx.Logger.Types ...
roman/Haskell-Reactive-Extensions
rx-logger/src/Rx/Logger/Types.hs
mit
3,520
0
9
817
598
351
247
80
0
-- Generated by protobuf-simple. DO NOT EDIT! module Types.MessageMsg where import Control.Applicative ((<$>)) import Prelude () import qualified Data.ProtoBufInt as PB import qualified Types.Message newtype MessageMsg = MessageMsg { value :: Types.Message.Message } deriving (PB.Show, PB.Eq, PB.Ord) instance PB....
sru-systems/protobuf-simple
test/Types/MessageMsg.hs
mit
904
0
13
160
303
164
139
21
0
{-# LANGUAGE OverloadedStrings #-} module Lib ( main ) where import Control.Monad import Control.Monad.State.Strict import Data.Foldable import Data.Function import Data.List import qualified Data.Map.Strict as M import qualified Data.Text as T import Population import Text.Printf type M = StateT (M.Map T.Text I...
Javran/misc
apportionment/src/Lib.hs
mit
2,044
0
19
484
651
336
315
51
1
{-# LANGUAGE TupleSections, TemplateHaskell, LambdaCase, TypeSynonymInstances, FlexibleInstances, OverloadedStrings #-} module CodeGen (generate) where import GlobalAst (Inline(..), getSizeFromTSize, nowhere, TerminatorType(..), BinOp(..), UnOp(..), TSize(..)) import NameResolution.Ast (Resolved(..)) import Inference...
elegios/datalang
src/Codegen.hs
mit
26,403
0
20
6,447
9,928
5,004
4,924
-1
-1
-- SimpleJSON.hs -- jsonparser/SimpleJSON.hs -- To compile a moudle we can use "ghc -c" options. which will compile it to -- generate object code. Omitting "-c" option, compiler will try to generate an -- executable which will fail because it doesn't contain main action. We will -- get SimpleJSON.hi, SimpleJSON.o -- ...
gitrookie/functionalcode
code/Haskell/jsonparser/SimpleJSON.hs
mit
1,461
0
9
355
377
207
170
37
1
{-# LANGUAGE OverloadedStrings #-} -- | This provides a simple representation of the request data for a Slack -- /incoming/ integration- the means via which Haskbot replies to Slack. -- Currently only simple text replies are supported, but this will be -- expanded to support fully-Slack-formatted messages in the...
Jonplussed/haskbot-core
src/Haskbot/Incoming.hs
mit
3,360
0
17
768
892
480
412
71
2
{-# LANGUAGE CPP #-} import System.Process (rawSystem) #if CABAL_OS_WINDOWS import Distribution.Simple main = defaultMain #else import Distribution.Simple.I18N.GetText main = do -- manage translations gettextDefaultMain -- install desktop file and icon rawSystem "xdg-icon-resource" ["install", "--s...
emmanueltouzery/imprint
Setup.hs
mit
468
0
5
75
25
16
9
8
1
{-| Module : Data.Algorithm.PPattern.Geometry.Point.List Description : Short description Copyright : (c) Laurent Bulteau, Romeo Rizzi, Stéphane Vialette, 2016-2017 License : MIT Maintainer : vialette@gmaiList.com Stability : experimental Basic manipulation of 'Point' list. -} module Data.Algorithm.PPatt...
vialette/ppattern
src/Data/Algorithm/PPattern/Geometry/Point/List.hs
mit
1,859
0
10
496
397
229
168
26
1
module Graphics.HTurtle.LSystem (Symbol(..), LSystem(..), evalLSystem) where import Control.Monad import Control.Monad.State import Data.Map.Strict as M type Symbol = Char type Term = [Symbol] data LSystem s a = LS { axiom :: Term, rules :: M.Map Symbol Term } type Commands s a = M.Map Symbol (State s a) evalLSyste...
rolph-recto/HTurtle
src/Graphics/HTurtle/LSystem.hs
mit
993
0
17
318
420
221
199
26
3
{-| Module : Language.X86.Core Description : Abstract representation of x86 assembly Copyright : (c) Jacob Errington and Frederic Lafrance, 2016 License : MIT Maintainer : goto@mail.jerrington.me Stability : experimental Monad that represents an abstract form of x86 with labels. -} {-# LANGUAGE DeriveFu...
djeik/goto
libgoto/Language/X86/Core.hs
mit
27,907
85
17
9,199
7,324
3,782
3,542
629
17
import Control.Exception import System.Environment import System.IO import System.IO.Error main = toTry `catch` handler toTry :: IO() toTry = do (fileName:_) <- getArgs contents <- readFile fileName putStrLn $ "The file has " ++ show (length (lines contents)) ++ " lines!" handler :: IOError -> IO() handl...
limdauto/learning-haskell
cis194/io/TryCatch.hs
mit
418
1
13
84
165
77
88
14
1
isPrime::Integer->Bool isPrime n = null [x | x <- [2..(floor(sqrt(fromInteger n)))], mod n x == 0] main::IO() main = print $ last primeList where primeList = take 10001 [x | x<-[2..], isPrime x ]
neutronest/eulerproject-douby
e7/e7.hs
mit
197
3
14
35
140
64
76
5
1
-- program to list / add / remove todos from a text file. -- usage: -- $ runghc todo.hs <action> <path> <args>, where <action> = add|view|remove -- <path> - path to the todos list import Data.List (delete) import System.Directory (removeFile, renameFile) import System.Environme...
topliceanu/learn
haskell/todos.hs
mit
2,175
3
16
517
727
362
365
46
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE NamedFieldPuns #-} -- | Check interpreter module Control.Biegunka.Check (check) where import Control.Concurrent.Async (async, waitCatch) import Control.Exception (bracket) import Control.Lens import Control.Monad import Control.Monad...
biegunka/biegunka
src/Control/Biegunka/Check.hs
mit
3,310
0
23
1,013
1,032
538
494
85
7
{- Number spiral diagonals Problem 28 Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows: 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 It can be verified that the sum of the numbers on the diagonals is 101. What is the sum of...
bertdouglas/euler-haskell
001-050/28a.hs
mit
753
11
9
189
226
99
127
12
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Coinbase.Exchange.Types.Socket where -----------------------------------------------------...
AndrewRademacher/coinbase-exchange
src/Coinbase/Exchange/Types/Socket.hs
mit
13,459
0
31
5,959
2,532
1,405
1,127
283
3
{-# OPTIONS -w -O0 #-} {- | Module : ATC/DgUtils.der.hs Description : generated Typeable, ShATermLG instances Copyright : (c) DFKI Bremen 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable(overlapping Typeable in...
nevrenato/Hets_Fork
ATC/DgUtils.hs
gpl-2.0
18,913
0
25
4,386
6,065
3,132
2,933
418
1
module Model.Arithmetic (modelEval) where -------------------------------------------------------------------------------- import Math.REPL.Parser.Base (parseNumber) -------------------------------------------------------------------------------- import Control.Applicative ...
sumitsahrawat/calculator
src/Model/Arithmetic.hs
gpl-2.0
1,602
0
14
280
339
185
154
25
2
----------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.Plot.Gtk.UI -- Copyright : (c) Sumit Sahrawat -- License : GPL-2 -- -- Maintainer : sumit.sahrawat.apm13@iitbhu.ac.in -- Stability : provisional -- Portability : portable -- -- Functions...
sumitsahrawat/plot-gtk-ui
lib/Graphics/Rendering/Plot/Gtk/UI/PlotWindow.hs
gpl-2.0
6,610
0
15
1,726
1,485
716
769
108
2
import Network.HaskellNet.IMAP.SSL import System.Environment (getArgs) import System.Directory (getHomeDirectory) main :: IO () main = do args <- getArgs hd <- getHomeDirectory auth <- readFile $ hd ++ "/.mailauth" ic <- connectIMAPSSL . head $ words auth let username = words auth !! 1 pass...
Reyu/MailCheck
Main.hs
gpl-3.0
779
0
15
196
342
166
176
18
2
-- The current commit contains a module `Switch` which is meant to be used to impose a totality check on the functions. -- The basic idea is described in the `total` library on hackage. While the trick is not really needed since the compiler -- is able to issue a warning if a function is not total, it is nonetheless of...
artuuge/xmonad-configuration
doc/switchCover.hs
gpl-3.0
4,308
53
10
945
778
440
338
57
3
module Prolog.Parser ( consult, consultString, parseQuery , program, whitespace, comment, clause, terms, term, bottom, vname ) where import Import hiding (many,try,cons, (<|>) ,try,head,tail,last, parseQuery) import qualified Prelude (head,tail,last) import Text.Parsec import Text.Parsec.Expr hiding (Assoc(....
nishiuramakoto/logiku
prolog/Prolog/Parser.hs
gpl-3.0
5,100
2
16
1,456
1,770
924
846
93
3
{-# LANGUAGE TupleSections, OverloadedStrings #-} module Handler.Home where import Yesod.Auth import Import import Handler.DB getHomeR :: Handler Value getHomeR = do (Entity _ u) <- requireAuth mug <- runDB $ get $ userDefaultUserGroupId u return $ object [ "user" .= object [ "na...
tlaitinen/sms
backend/Handler/Home.hs
gpl-3.0
616
0
17
211
157
81
76
17
1
{-# LANGUAGE NoImplicitPrelude, RecordWildCards, RankNTypes, OverloadedStrings #-} module Graphics.UI.Bottle.View ( View(..) , empty , size, animFrame , width, height , pad, assymetricPad , Size, R , augmentAnimId, backgroundColor , translate, scale ) where import Prelude....
rvion/lamdu
bottlelib/Graphics/UI/Bottle/View.hs
gpl-3.0
1,905
0
9
428
620
343
277
52
1
-- | Re-export Explorer functionality. module RSCoin.Explorer ( module Exports ) where import RSCoin.Explorer.Error as Exports import RSCoin.Explorer.Launcher as Exports import RSCoin.Explorer.Server as Exports
input-output-hk/rscoin-haskell
src/RSCoin/Explorer.hs
gpl-3.0
271
0
4
84
37
27
10
6
0
{-# LANGUAGE NoOverloadedStrings #-} -- | -- Module : Main -- Copyright : (c) 2012 Brendan Hay <brendan@soundcloud.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or --...
brendanhay/numbersd
src/Main.hs
mpl-2.0
1,487
0
16
359
329
167
162
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.ResourceManager.Types -- Copyright : (c) 2015-2016 Bre...
rueshyna/gogol
gogol-resourcemanager/gen/Network/Google/ResourceManager/Types.hs
mpl-2.0
4,834
0
7
1,200
504
350
154
134
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.GroupsSettings.Types -- Copyright : (c) 2015-2016 Bren...
brendanhay/gogol
gogol-groups-settings/gen/Network/Google/GroupsSettings/Types.hs
mpl-2.0
3,010
0
7
603
288
195
93
83
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-toolresults/gen/Network/Google/Resource/ToolResults/Projects/Histories/Executions/List.hs
mpl-2.0
5,462
0
17
1,225
578
344
234
92
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -------------------------------------------------------------------------------- -- See end of this file for licence information. -------------------------------------------------------------------------------- -- | -- Mod...
DougBurke/swish
src/Swish/GraphMem.hs
lgpl-2.1
5,773
0
13
1,383
1,073
606
467
77
1
import System.Environment import Text.Regex main :: IO() main = do args <- getArgs let s = (args !! 0) let r = (args !! 1) i <- readFile (args !! 2) putStrLn (subRegex (mkRegex s) i r)
risgk/haskell_hamamatsu_2013
sed.hs
unlicense
206
0
11
58
104
51
53
9
1
module Git.Command.Daemon (run) where run :: [String] -> IO () run args = return ()
wereHamster/yag
Git/Command/Daemon.hs
unlicense
84
0
7
15
42
23
19
3
1
fact :: Int -> Int fact 0 = 1 fact n = n * fact (n - 1)
tonilopezmr/Learning-Haskell
Exercises/1/Exercise2.hs
apache-2.0
55
0
8
17
40
20
20
3
1
module Main (main) where import Criterion.Main import Data.Int import Data.Time import Data.Time.Clock.POSIX import Data.Time.Zones.Internal utc2int64Naive :: UTCTime -> Int64 utc2int64Naive ut = floor $ utcTimeToPOSIXSeconds ut utc2int64Floor :: UTCTime -> Int64 utc2int64Floor (UTCTime (ModifiedJulianDay d) t) = ...
nilcons/haskell-tz
benchmarks/benchConv.hs
apache-2.0
2,181
0
11
440
703
362
341
53
1
{-| This module contains specification of approximate field. -} module Data.Approximate.ApproximateField ( RoundingMode (..), Stage (..), anti, precDown, precUp, prec, ApproximateField (..), DyadicField (..) ) where -- | The rounding mode tells us whether we sho...
comius/haskell-fast-reals
src/Data/Approximate/ApproximateField.hs
bsd-2-clause
3,969
0
12
997
871
477
394
57
2
-- 1582 nn = 200 -- lots of help from http://www.mathblog.dk/project-euler-122-efficient-exponentiation/ -- search all sub-paths recursively genPath [] _ _ = error "genPath: empty" genPath _ [] ds = ds genPath xs ys ds = genPath xs (tail ys) ds2 where z = head xs + head ys ds2 = genMult z xs ds -- if p...
higgsd/euler
hs/122.hs
bsd-2-clause
726
5
11
192
288
144
144
16
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module Main where import Data.Proxy (Proxy (Proxy)) import Elm (Spec (Spec), specsToDir, toElmTypeSource, toElmDecoderSource, toElmEncoderSource) import ...
mattjbray/servant-elm-example-app
code-generator/Main.hs
bsd-3-clause
1,142
0
17
334
276
158
118
27
1
{-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE UndecidableSuperClasses #-} module Algebra6 where import LocalPrelude import Prelude (Functor(..), Applicative(..), Monad(..)) import qualified Prelude as P -------------------------------------------------------------------------------- class Semigroup a wher...
mikeizbicki/homoiconic
old/Algebra6.hs
bsd-3-clause
7,593
0
11
1,965
3,318
1,722
1,596
-1
-1
--------------------------------------------------------------- -- | -- Module : hmac_hu -- Copyright : (c) Hitesh Jasani, 2008 -- License : BSD3 -- -- Maintainer : Hitesh Jasani <hitesh.jasani@gmail.com> -- Stability : experimental -- Portability : portable -- -- Created : 2008-02-06 -- Version :...
hiteshjasani/nano-hmac
test/hmac_hu.hs
bsd-3-clause
4,840
0
11
1,646
801
473
328
87
1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Hooks.ICCCMFocus -- License : BSD -- -- Maintainer : Tony Morris <haskell@tmorris.net> -- -- Implemented in your @logHook@, Java swing applications will not misbehave -- when it comes to taking and losing ...
reenberg/XMonadContrib
XMonad/Hooks/ICCCMFocus.hs
bsd-3-clause
1,500
0
13
306
250
137
113
27
1
{-# LANGUAGE OverloadedStrings #-} module Bead.View.ContentHandler ( logMessage , withUserState , runStory , userStory , registrationStory , getParameter , getParameterValues -- Calculates a list of values for the given parameter , getParameterOrError , getOptionalParameter -- Calculates the value ...
pgj/bead
src/Bead/View/ContentHandler.hs
bsd-3-clause
14,903
0
25
3,181
3,509
1,799
1,710
302
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Blockchain.Data.Json where import Control.Monad import Control.Applicative import Blockchain.Data.DataDefs import Blockchain.Data.Address import Blockchain.Data.PersistTypes import Blockchain.Data.Transaction import Blockchain.Data.Code ...
jamshidh/ethereum-data-sql
src/Blockchain/Data/Json.hs
bsd-3-clause
13,703
0
27
4,796
4,194
2,205
1,989
248
2
----------------------------------------------------------------------------- -- -- Module : GameOfLife.Ui.Gui -- Copyright : 2016 Author name here -- License : BSD3 -- -- Maintainer : bnazariy@gmail.com -- Stability : -- Portability : -- -- -- ---------------------------------------------------------...
AM636E/HaskellGameOfLife
src/GameOfLife/Ui/Gui.hs
bsd-3-clause
1,561
0
12
317
555
301
254
32
1
{-# LANGUAGE CPP #-} module Main where import System.IO.Cautious (writeFile) import Prelude hiding (writeFile) import Control.Monad (replicateM, zipWithM_, unless) import System.Directory (removeFile) import System.Environment (getArgs) #ifdef _POSIX import System.Posix.Files (createSymbolicLink, readSymbolicLink) #e...
NicolasT/cautious-file
Test.hs
bsd-3-clause
2,267
0
14
478
488
258
230
32
2
{-# LANGUAGE BangPatterns #-} -- | -- Module : Data.Unicode.Properties.DecomposeHangul -- Copyright : (c) 2016 Harendra Kumar -- -- License : BSD-3-Clause -- Maintainer : harendra.kumar@gmail.com -- Stability : experimental -- module Data.Unicode.Properties.DecomposeHangul (decomposeCharHangul , ...
harendra-kumar/unicode-transforms
Data/Unicode/Properties/DecomposeHangul.hs
bsd-3-clause
3,897
0
11
822
756
429
327
74
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} module ConfigSpec where import Program.Mighty import Test.Hspec spec :: Spec spec = do describe "parseConfig" $ do it "parses example.conf correctly" $ do res <- parseOption "conf/example.conf" res { opt_server_name = "foo" }...
kazu-yamamoto/mighttpd2
test/ConfigSpec.hs
bsd-3-clause
1,533
0
15
397
308
186
122
41
1
-- Testing Wreath.Walk Library Functions -- ---------------------------------- -- {-# LANGUAGE TemplateHaskell #-} module Main where import Wreath.Walk import Test.QuickCheck import Control.Monad(unless) import System.Exit(exitFailure) import Test.QuickCheck.All(quickCheckAll) -- **Property-based Tests** -- -- * If...
bobgru/wreath
tests/qc/walkTests.hs
bsd-3-clause
3,948
0
17
844
719
388
331
42
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Code generation for foreign calls. -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmForeign ( cgForeignCall, emitPrimC...
jstolarek/ghc
compiler/codeGen/StgCmmForeign.hs
bsd-3-clause
19,969
0
21
5,418
3,533
1,812
1,721
287
6
{-# LANGUAGE RankNTypes #-} -- | manage subscriptions module Handler.Subscriptions where import Import import Instagram -- | simply list the existing subscriptions getSubscriptionsR :: Handler RepHtml getSubscriptionsR = defaultLayout $ catchW showSubscriptionList -- | delete a given subscription getDeleteS...
prowdsponsor/ig-testapp
Handler/Subscriptions.hs
bsd-3-clause
3,031
0
18
710
787
391
396
-1
-1
module Utils.Stack(Stack, emptyStack, push, pop, peek, singleton, isEmpty, toList, fromList, stackSize) where import Utils.ErrMsg hiding (isEmpty) ...
rodrigogribeiro/mptc
src/Utils/Stack.hs
bsd-3-clause
1,313
0
9
498
439
236
203
32
1
module BinarySearchTree ( treeLeaf, treeElem, treeFromList ) where import YesNo -- immutable data structure which represents a tree data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq) -- creates a leaf node treeLeaf :: a -> Tree a treeLeaf x = Node x EmptyTree EmptyTree -- prod...
topliceanu/learn
haskell/binarySearchTree.hs
mit
1,362
0
8
303
494
251
243
30
1
{-| Top-Level Pier Management This is the code that starts the IO drivers and deals with communication between the serf, the log, and the IO drivers. -} module Urbit.Vere.Pier ( booted, resumed, getSnapshot, pier, runPersist, runCompute, generateBootSeq ) where import Urbit.Prelude import RIO.Directo...
ngzax/urbit
pkg/hs/urbit-king/lib/Urbit/Vere/Pier.hs
mit
15,737
0
21
4,775
4,736
2,360
2,376
-1
-1
{-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ...
plow-technologies/persistent
persistent-test/src/EntityEmbedTest.hs
mit
739
0
5
112
45
34
11
14
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {- Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu> 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 ...
fibsifan/pandoc
src/Text/Pandoc/Readers/RST.hs
gpl-2.0
43,968
9
28
11,987
12,549
6,273
6,276
894
28
{-# language TypeSynonymInstances #-} module SAT.Wert where import SAT.Types import Autolib.FiniteMap import Control.Monad ( mzero ) class Wert a where wert :: a -> Belegung -> Maybe Bool instance Wert Variable where wert v b = lookupFM b v instance Wert Literal where wert (Pos v) b = wert v b w...
florianpilz/autotool
src/SAT/Wert.hs
gpl-2.0
683
8
13
199
280
140
140
24
0
{-# LANGUAGE FlexibleInstances #-} {- | Module : ./Common/Lib/RelCheck.hs Description : a couple of test cases mainly for intransKernel Copyright : (c) Uni Bremen 2003-2005 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-po...
spechub/Hets
Common/Lib/RelCheck.hs
gpl-2.0
3,757
0
18
1,186
1,503
841
662
68
1
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : $Header$ Copyright : DFKI GmbH 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : codruta.liliana@gmail.com Stability : experimental Portability : portable -} module ExtModal.AS_ExtModal where import Common.Id import Common.AS_Annotati...
keithodulaigh/Hets
ExtModal/AS_ExtModal.der.hs
gpl-2.0
4,989
0
12
1,190
594
331
263
51
0
-- BNF Converter: Error Monad -- Copyright (C) 2004 Author: Aarne Ranta -- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. module ErrM where -- the Error monad: like Maybe type with error msgs data Err a = Ok a | Bad String deriving (Read, Show, Eq) instance Monad Err where return = Ok ...
johnjcamilleri/maltese-functional-morphology
lib-1.1/ErrM.hs
lgpl-3.0
362
0
7
93
85
45
40
7
0
{-# LANGUAGE OverloadedStrings #-} module LoaderTests (main) where import Control.Lens import Control.Monad (forM_) import Control.Monad.Trans.Except import Data.Functor (void) import Data.Text (Text, pack) import qualified Data.Text.IO as TIO import Ermine.Loader.Core import Ermine.Loader.Filesystem import System.Fil...
PipocaQuemada/ermine
tests/unit-tests/LoaderTests.hs
bsd-2-clause
2,198
0
15
400
624
326
298
49
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Network.URI.Json where import Network.URI import Data.Aeson import qualified Data.Text as T import Control.Monad instance ToJSON URI where toJSON uri = String $ T.pack $ uriToString id uri "" instance FromJSON URI where parseJSON (String str) = case parseURI (T.unpac...
rootzlevel/sansa
src/Network/URI/Json.hs
bsd-2-clause
401
0
10
77
127
67
60
13
0
{-# OPTIONS_GHC -Wall #-} module Transform.Substitute (subst) where import Control.Arrow (second, (***)) import qualified Data.Set as Set import AST.Annotation import AST.Expression.General (Expr'(..)) import qualified AST.Expression.Canonical as Canonical import qualified AST.Pattern as Pattern import qualified AST....
avh4/elm-compiler
src/Transform/Substitute.hs
bsd-3-clause
2,365
0
17
817
841
418
423
63
23
{-# LANGUAGE OverloadedStrings #-} {- | Module : Network.MPD.Commands.Output Copyright : (c) Ben Sinclair 2005-2009, Joachim Fasting 2012 License : MIT (see LICENSE) Maintainer : joachifm@fastmail.fm Stability : stable Portability : unportable Audio output devices. -} module Network.MPD.Commands.Outpu...
vimus/libmpd-haskell
src/Network/MPD/Commands/Output.hs
mit
1,070
0
8
205
193
112
81
18
1
-- | The functions from this module specify the geometry -- of the GUI-elements. They tell where to render the elements. -- -- Every element is rectangular. To know where to place the element is -- to know the parameters of the bounding rectangle. All rectangles are -- relative and automatically aligned. -- -- We ha...
isomorphism/csound-expression
src/Csound/Control/Gui/Layout.hs
bsd-3-clause
713
0
4
132
51
38
13
4
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 \section[DataCon]{@DataCon@: Data Constructors} -} {-# LANGUAGE CPP, DeriveDataTypeable #-} module DataCon ( -- * Main data types DataCon, DataConRep(..), HsBang(..), HsSrcBang, HsImplBang, Stri...
forked-upstream-packages-for-ghcjs/ghc
compiler/basicTypes/DataCon.hs
bsd-3-clause
47,246
0
18
13,922
5,061
2,885
2,176
412
4
{-# LANGUAGE CPP, NondecreasingIndentation #-} {-# OPTIONS_GHC -fno-cse #-} -- -- (c) The University of Glasgow 2002-2006 -- -- -fno-cse is needed for GLOBAL_VAR's to behave properly -- | The dynamic linker for GHCi. -- -- This module deals with the top-level issues of dynamic linking, -- calling the object-code lin...
ghc-android/ghc
compiler/ghci/Linker.hs
bsd-3-clause
53,372
6
23
16,572
9,281
4,791
4,490
-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="sq-AL"> <title>Linux WebDrivers</title> <maps> <homeID>top</homeID> <mapref location="m...
thc202/zap-extensions
addOns/webdrivers/webdriverlinux/src/main/javahelp/org/zaproxy/zap/extension/webdriverlinux/resources/help_sq_AL/helpset_sq_AL.hs
apache-2.0
961
77
66
156
407
206
201
-1
-1
module Where2 where g x l_1 l = (ls, rs) where ls = take x l_1 rs = length l f1 :: Int -> [a] -> [a] f1 x l = ls where ls = take x l f2 :: [a] -> Int f2 l = rs where rs = length l
kmate/HaRe
old/testing/merging/Where2AST.hs
bsd-3-clause
207
0
7
79
113
61
52
9
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="ro-RO"> <title>Active Scan Rules - Blpha | ZAP Extension</title> <maps> <homeID>top</homeID...
0xkasun/security-tools
src/org/zaproxy/zap/extension/wavsepRpt/resources/help_ro_RO/helpset_ro_RO.hs
apache-2.0
987
80
67
163
422
213
209
-1
-1
import System.IO (hFlush, stdout) import System.Environment (getArgs) import Control.Monad (mapM) import Control.Monad.Except (runExceptT) import Control.Monad.Trans (liftIO) import qualified Data.Map as Map import qualified Data.Traversable as DT import Readline (readline, load_history) import Types import Reader (re...
0gajun/mal
haskell/step9_try.hs
mpl-2.0
9,522
0
25
3,469
3,370
1,655
1,715
224
22
{-# LANGUAGE DataKinds , PolyKinds , FlexibleContexts , FlexibleInstances , GADTs , MultiParamTypeClasses , OverloadedLabels , ScopedTypeVariables , TypeApplications , TypeOperators , UndecidableInstances #-}...
sdiehl/ghc
testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun07.hs
bsd-3-clause
1,174
0
12
350
452
242
210
-1
-1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1994-1998 \section[UniqSet]{Specialised sets, for things with @Uniques@} Based on @UniqFMs@ (as you would expect). Basically, the things need to be in class @Uniquable@. -} module UniqSet ( -- * Unique set type UniqSet, ...
urbanslug/ghc
compiler/utils/UniqSet.hs
bsd-3-clause
3,686
0
9
916
807
418
389
70
1
{-# LANGUAGE BangPatterns #-} module Main where main :: IO () main = let !_ = (undefined :: ()) in print 2
ezyang/ghc
testsuite/tests/deSugar/should_run/T11572.hs
bsd-3-clause
109
0
10
24
44
23
21
4
1
module B.A where a = 42 :: Int main = print a
urbanslug/ghc
testsuite/tests/cabal/cabal01/B/A.hs
bsd-3-clause
47
0
5
13
22
13
9
3
1
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable, TypeFamilies, Arrows, BangPatterns, TupleSections #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Server.Game.World( WorldMsg(..) , world , module W ) where import Core import Control.Wire.Collection import qualified Data.HashMap.Strict as M import Control...
NCrashed/sinister
src/server/Server/Game/World.hs
mit
2,983
2
20
728
831
447
384
80
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} module Widgets.Commons ( -- * Buttons buttonFlat, buttonFlatDyn , buttonRed , hr -- * Common classes to use , smallMa...
achirkin/qua-view
src/Widgets/Commons.hs
mit
4,705
0
14
1,434
872
468
404
83
2
{-# LANGUAGE FunctionalDependencies, FlexibleInstances #-} {-# LANGUAGE FlexibleContexts, OverloadedStrings #-} module Main where import Control.Applicative import Data.Monoid import Data.Version (showVersion) import Options.Applicative import System.Environment import System.FilePath import System.Directory import Pa...
pxqr/algorithm-wm
src/Main.hs
mit
1,868
0
18
539
487
238
249
60
1
module Main where import Data.Bits import Graphics.UI.WX import Graphics.UI.WXCore.WxcDefs import Graphics.UI.WXCore.Frame import Graphics.UI.WXCore.WxcClassesAL import Graphics.UI.WXCore.WxcClassesMZ import Graphics.UI.WXCore.WxcTypes import Text.Printf main :: IO () main = start simple -- http://stackoverflow.com...
Javran/misc
wxhaskell/Grid.hs
mit
884
0
14
233
283
151
132
24
1
module Language.Erlang.Fold.Identity where import Language.Fold import Language.Erlang.Algebra import Language.Erlang.Fold import Language.Erlang.Syntax identityAlgebra = ErlangAlgebra { programF = Program , moduleF = Module , exportF = Export , importF = Import , defineF = Define , functionF = Functi...
arnihermann/timedreb2erl
src/Language/Erlang/Fold/Identity.hs
mit
1,418
0
6
355
373
246
127
61
1
module Main where import qualified Data.Aeson as JSON import qualified Hasql.Pool as P import qualified Hasql.Transaction.Sessions as HT import Data.Function (id) import Data.List.NonEmpty (toList) import Test.Hspec import PostgREST.App (postgrest) import PostgREST....
steve-chavez/postgrest
test/Main.hs
mit
9,036
0
18
1,953
1,632
868
764
155
1
-- AST(Abstract Syntax Tree)を定義する. -- データ型の定義以外の役割を持たない. module AST where import Type -- 32bitのデータを扱うため import Data.Word -- 変数名を表すノード newtype Var = Var String deriving (Show, Eq) -- 算術式の演算子.今は適当なデータ型を作った. data ArithOperator = And | Xor | Or | Add ...
ryna4c2e/chage
AST.hs
mit
1,633
0
8
637
413
233
180
35
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.Window (js_openDatabase, openDatabase, js_getSelection, getSelection, js_focus, focus, js_blur, blur, js_close, close, js_print, print, js_stop, stop, js_open, open, js_showModalDialog, show...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/Window.hs
mit
61,894
656
13
9,134
11,685
6,139
5,546
817
1
{-# LANGUAGE OverloadedStrings #-} -- | Tiny API client for <https://www.authy.com Authy> two-factor authentication module Authy ( newUser , verify , productionServer , sandboxServer ) where import Data.Aeson ((.:), (.:?), Object, Value(..), withObject) import Data.A...
sheganinans/authy
src/Authy.hs
mit
3,742
0
23
997
735
404
331
63
3
import FPPrac qsort :: [Number] -> [Number] qsort [] = [] qsort (x:xs) = qsort(filter (<x) (x:xs)) ++ filter (==x) (x:xs) ++ qsort(filter (>x) (x:xs))
tcoenraad/functioneel-programmeren
practica/serie2/11.quick-sort.hs
mit
152
0
11
26
114
62
52
4
1
module Main (main) where import FullBatteries (projectName) main :: IO () main = putStrLn ("Benchmarks for " ++ projectName)
vrom911/hs-init
summoner-cli/examples/full-batteries/benchmark/Main.hs
mit
128
0
7
22
42
24
18
4
1
-- Hello World -- How much more simple can you get? -- Enter your code here. Read input from STDIN. Print output to STDOUT hello_world = putStrLn "Hello World" -- Fill up this function -- This part relates to Input/Output and can be used as it is. Do not modify this section main = do hello_world
jmeline/secret-meme
hackerrank/functional_programming/haskell/hello_world.hs
mit
304
0
6
63
22
13
9
3
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Data.FileEmbed (embedStringFile) import Data.Foldable (traverse_) import Data.Text (Text, pack) import qualified Data.Vector as V import qualified Data.Vect...
genos/online_problems
advent_of_code_2016/day12/hask/src/Main.hs
mit
2,648
0
10
695
1,077
564
513
74
2
module Monitor.IOMonitor ( IOMonitor(..) , ioMonitorSel ) where import Control.Monad.IO.Class import Data.List import Monitor import Domain import Utils.Miscellaneous data IOMonitor = IOMonitor instance Monitor IOMonitor where newMonitor = constM IOMonitor updateDepth _ d = printI...
d3sformal/bacon-core
src/Monitor/IOMonitor.hs
mit
1,955
0
12
559
664
319
345
50
4
main = do print $ (1,2) print $ [(1,2), (3,4), (5,6)] --- print $ [(1,2), (3,4), (5,6,7)] print $ fst (1,2) print $ snd (1,2) print $ zip [1,2,3,4,5] [5,5,5,5,5] print $ zip [1 .. 5] ["one", "two", "three", "four", "five"] print $ zip [5,3,2,6,2,7,2,5,4,6,6] ["im","a","turtle"] ...
solvery/lang-features
haskell/tuple_1.hs
gpl-2.0
377
0
9
95
242
140
102
9
1
module Type.Event where import Type.Types import Type.Universe import qualified Data.Foldable as F import qualified Data.Monoid as M data UniverseObject o => Event o = Event Position o deriving (Show) {- instance Functor (Entry k) where fmap f (Entry k v) = Entry k (f v) instance Foldabl...
graninas/Haskell-Algorithms
Prototypes/BigSpace.FingerTreeUnstructured/Type/Event.hs
gpl-3.0
661
2
6
182
61
38
23
7
0
module Examples.Prelude.CDSL (frmTo,permute,reverse,foldl,zipWith,sum, {-forVec,toArr,fromArr,toArrF,-} scalarProd,P.fmap,replicate,append,for,not,and,or,notEql,gt, lte,gte,min,pi,testBit,lsbs,oneBits) where import qualified Prelude as P import QFeldspar.CDSL frmTo :: Dp Word32 -> Dp Word32 -> Vec (Dp Word3...
shayan-najd/QFeldspar
Examples/Prelude/CDSL.hs
gpl-3.0
3,549
0
19
1,500
1,833
967
866
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Estuary.Languages.Hydra.Parser where import Data.Text (Text) import qualified Data.Text as T import Text.Parsec import Text.Parsec.Text import qualified Text.ParserCombinators.Parsec.Token as P import Control.Monad.Identity (Identity) import Estuary.Languages.Hydra.Types im...
d0kt0r0/estuary
client/src/Estuary/Languages/Hydra/Parser.hs
gpl-3.0
10,349
0
16
1,753
2,893
1,470
1,423
266
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/ListJobs.hs
mpl-2.0
8,665
0
12
1,842
950
583
367
96
1
module Monsters.Parts where import Data.Define import Utils.Items import qualified Data.Map as M import Data.Functor ((<$>)) -- | capacity for monster with zero strength baseCapacity :: Int baseCapacity = 50 -- | increase in capacity per unit of strength capacityByStrength :: Int capacityByStrength = 40 -- | capacit...
green-orange/trapHack
src/Monsters/Parts.hs
unlicense
2,593
26
14
526
852
460
392
59
5
-- | module: Network.Riak.CRDT.Types -- copyright: (c) 2016 Sentenai -- author: Antonio Nikishaev <me@lelf.lu> -- license: Apache -- -- Haskell-side view of CRDT -- {-# LANGUAGE OverloadedStrings, PatternGuards, GeneralizedNewtypeDeriving, DeriveGeneric #-} module Network.Riak.CRDT.Types ( ...
k-bx/riak-haskell-client
src/Network/Riak/CRDT/Types.hs
apache-2.0
7,594
0
11
1,994
1,741
981
760
166
1
-- Here we take `foldl` as example, and check the memory usage -- > foldl (+) 0 [1..1000000] -- > 500000500000 -- > (1.12 secs, 161,338,640 bytes) -- > foldr (+) 0 [1..1000000] -- > 500000500000 -- > (0.14 secs, 161,632,384 bytes) import Data.List -- mean , sumlen1 -- sumlen1 is the easist to implement, but with pe...
Oscarzhao/haskell
functional_program_design/ch07_performance/memory_use.hs
apache-2.0
981
0
9
219
385
219
166
13
1
module Data.UUID.Instances where import Data.UUID import Data.Aeson import Data.Text.Encoding as E import qualified Data.ByteString.Char8 as C -- import Data.Aeson.Types import Data.SafeCopy instance FromJSON UUID where parseJSON x = do r <- return . fromString . C.unpack . E.encodeUtf8 =<< parseJSON x ca...
wavewave/uuid-instance
src/Data/UUID/Instances.hs
bsd-2-clause
707
0
14
166
210
110
100
19
0
{-| Algorithm Options for HTools This module describes the parameters that influence the balancing algorithm in htools. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are...
grnet/snf-ganeti
src/Ganeti/HTools/AlgorithmParams.hs
bsd-2-clause
3,424
0
10
732
270
167
103
30
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE NegativeLiterals #-} module FireFlies ( Flies, fliesNeuralInstance ) where import Control.Lens import Graphics.Gloss import Data.List import qualified Data.Vector.Storable as V import Numeric.FastMath() import ...
bmabsout/neural-swarm
src/FireFlies.hs
bsd-3-clause
7,471
0
21
1,706
2,092
1,068
1,024
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} import qualified Data.Text as T import qualified Hakyll.Convert.Blogger as Blogger import Hakyll.Convert.IO import Hakyll.Convert.OutputFormat import qualified Hakyll.Convert.Wordpress as Wordpress import System.Console.CmdArgs import System.Enviro...
kowey/hakyll-convert
app/hakyll-convert.hs
bsd-3-clause
3,112
0
14
718
735
381
354
76
3
module Statistics.Information.Discrete.Entropy where import Data.Function.Memoize import Data.Matrix import Statistics.Information.Utils.List entropy :: Eq a => Int -> Matrix a -> Double entropy = memoize $ \base xs -> -(sum (map elog . hist . toLists $ xs)) / log (fromIntegral base) where elog x | x <= 0.0 =...
eligottlieb/Shannon
src/Statistics/Information/Discrete/Entropy.hs
bsd-3-clause
496
0
15
111
220
111
109
12
3