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 Transformations (identity_t, trans_t, scale_t, uscale_t, rotatex_t, rotatey_t, rotatez_t, applyTransform, applyMatrixToPoint, applyMatrixToVector) where import Types identity :: Matrix identity = ((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), ...
jchl/jtrace
src/Transformations.hs
mit
4,212
0
12
1,452
1,883
1,092
791
117
1
-- file: ch4/InteractWith.hs -- Save this in a source file, e.g. Interact.hs import System.Environment (getArgs) interactWith function inputFile outputFile = do input <- readFile inputFile writeFile outputFile (function input) main = mainWith myFunction where mainWith function = do args <- getArgs ...
friedbrice/RealWorldHaskell
ch4/InteractWith.hs
gpl-2.0
555
0
12
141
115
57
58
11
2
{-# LANGUAGE TemplateHaskell, FlexibleInstances, MultiParamTypeClasses, DeriveFunctor #-} module LanguageDef.Data.Relation where import Utils.All import LanguageDef.Utils.LocationInfo import LanguageDef.Utils.ExceptionInfo import LanguageDef.Utils.Checkable import LanguageDef.Utils.Grouper import LanguageDef.Data.Ru...
pietervdvn/ALGT2
src/LanguageDef/Data/Relation.hs
gpl-3.0
7,844
211
20
1,383
2,094
1,128
966
134
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Fs (adbFSOps, LogFunction, PathQualification(..), qualifyPath, emptyDirContents) ...
7ocb/fuse_adb_fs
lib/Fs.hs
gpl-3.0
26,575
8
24
9,508
6,618
3,513
3,105
470
5
module OhBool.Utils where import Data.Bits (Bits, shiftR, xor, popCount) import Data.List (sortBy) import Data.Function (on) import Codec.Binary.Gray.Bits (binary) safeHead :: [a] -> Maybe a safeHead [] = Nothing safeHead (x:_) = Just x grayify :: (Ord a, Eq a) => [a] -> [a] grayify xs = map snd $ sortBy (compare `...
RomainGehrig/OhBool
src/OhBool/Utils.hs
gpl-3.0
970
0
10
254
458
250
208
22
2
{-# LANGUAGE TypeFamilies #-} module Data.FromTuple where class FromTuple a where type Tuple a :: * fromTuple :: Tuple a -> Either String a -- toTuple :: a -> Tuple a
wavewave/qft
old/lib/Data/FromTuple.hs
gpl-3.0
178
0
8
42
41
23
18
5
0
module GeometryTest where import Test.QuickCheck import Control.Monad import Geometry -- | A data structure which both represents the "point list" as well -- as the randomly selected parameters used to generate the list data DottedLine = DottedLine Point Point Double [(Point, Point)] deriving Show in...
SneakingCat/fay-ticker
test/GeometryTest.hs
gpl-3.0
2,300
0
15
529
663
355
308
37
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-securitycenter/gen/Network/Google/Resource/SecurityCenter/Organizations/Sources/TestIAMPermissions.hs
mpl-2.0
6,082
0
16
1,261
779
455
324
120
1
-- Copyright 2010 Leonid Movshovich <event.riga@gmail.com> -- This file is part of SPIM. -- SPIM is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your opti...
event/spim
AddPILink.hs
agpl-3.0
1,647
0
16
409
233
128
105
20
2
module Uint(Int, Word, dflt_size) where import qualified Prelude import Data.Int(Int) import Data.Word(Word) import qualified Data.Bits dflt_size :: Prelude.Integer dflt_size = Prelude.toInteger (bitSize_aux (0::Word)) where bitSize_aux :: (Data.Bits.Bits a, Prelude.Bounded a) => a -> Int bitSize_...
jwaldmann/ceta-postproc
CeTA-2.39/generated/Haskell/Uint.hs
lgpl-3.0
344
0
9
59
113
67
46
9
1
{- Copyright 2014 David Farrell <shokku.ra@gmail.com> - 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...
shockkolate/lambdircd
plugins.old/MaxChannels.hs
apache-2.0
1,288
0
12
242
207
116
91
17
3
module NinetyNine where isPalindrome :: Eq a => [a] -> Bool isPalindrome xs = foldr cmp True zipped where zipped = zip xs (reverse xs) cmp (a, b) acc = acc && (a == b)
naphthalene/haskell-99onthewall
ten/6.hs
bsd-2-clause
179
0
9
46
83
44
39
5
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Handler.File where import Import import Handler.Utils import Codec.Archive.Streaming import Control.Monad import Data.Digest.CRC32 (crc32) import Data.Int (Int64) import Data.Text.Encoding.Error import Data.Text.Format import Data.Time import Data.Time.C...
Tener/personal-library-yesod
Handler/File.hs
bsd-2-clause
8,791
0
18
2,068
2,206
1,109
1,097
-1
-1
{-# OPTIONS_GHC -Wwarn #-} {-# LANGUAGE CPP, ScopedTypeVariables, Rank2Types #-} {-# LANGUAGE LambdaCase #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2010, -- ...
randen/haddock
haddock-api/src/Haddock.hs
bsd-2-clause
20,662
0
23
4,904
4,500
2,328
2,172
335
6
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module Propellor.Types.Dns where import Propellor.Types.OS (HostName) import Propellor.Types.Empty import Propellor.Types.Info import Data.Word import Data.Monoid import qualified Data.Map as M import qualified Data.Set as S import Data.List import Data...
np/propellor
src/Propellor/Types/Dns.hs
bsd-2-clause
5,132
36
13
939
1,464
791
673
112
2
---------------------------------------------------------------------------- -- | -- Module : ANoExportList -- Copyright : (c) Sergey Vinokurov 2018 -- License : BSD3-style (see LICENSE) -- Maintainer : serg.foo@gmail.com ---------------------------------------------------------------------------- {-# ...
sergv/tags-server
test-data/0012resolve_reexport_import_cycles/ANoExportList.hs
bsd-3-clause
957
0
9
204
216
124
92
28
1
-- | -- Module : $Header$ -- Copyright : (c) 2013-2014 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE PatternGuards #-} module Cryptol.Symbolic where import Control.Applicativ...
TomMD/cryptol
src/Cryptol/Symbolic.hs
bsd-3-clause
16,295
232
23
4,814
4,655
2,505
2,150
318
18
{-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Hooks.WindowHistory -- Copyright : (c) 2013 Dmitri Iouchtchenko -- License : BSD3-style (see LICENSE) -- -- Maintainer : Dmitri Iouchtchenko <johnnyspoon@gmail.com> ...
eb-gh-cr/XMonadContrib1
XMonad/Hooks/MyWindowHistory.hs
bsd-3-clause
2,753
0
15
716
403
235
168
33
2
-- | Data structures for an item (post or comment) and the -- overall structure in terms of parents and children. module Blog.Model.Entry where import qualified Blog.FrontEnd.Urls as U import Utilities import qualified Blog.Constants as C import Maybe import List ( sortBy, isPrefixOf, intersperse) import qualified Da...
prb/perpubplat
src/Blog/Model/Entry.hs
bsd-3-clause
13,296
219
17
4,595
3,632
1,987
1,645
220
3
{-# LANGUAGE FlexibleContexts, FlexibleInstances, RankNTypes #-} module Common.DataStructure.UnionFind ( UFSet , make , find , union ) where import Control.Monad (liftM2) import Control.Monad.Primitive import qualified Common.MonadRef as R import qualified Data.Vector.Unboxed as V import qualifi...
foreverbell/project-euler-solutions
lib/Common/DataStructure/UnionFind.hs
bsd-3-clause
1,127
0
12
289
471
244
227
35
2
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module FreeAgent.Server.ScheduleSpec (main, spec) where import FreeAgent.AgentPrelude import FreeAgent.Process import FreeAgent.Core.Internal.Lenses...
jeremyjh/free-agent
core/test/FreeAgent/Server/ScheduleSpec.hs
bsd-3-clause
4,117
0
18
1,478
937
445
492
77
1
module System.Process.Safe where import Control.Applicative import Control.Concurrent import qualified Control.Exception as C import Control.Monad import Control.Monad.Error import Data.Maybe import GHC.IO.Exception import System.Exit import ...
zhuangzi/genrei
src/System/Process/Safe.hs
bsd-3-clause
2,875
0
20
961
486
259
227
44
3
module Main where import IncrementalQuery ( initializeCache, updateCache, Cache, initializeCache2, updateCache2, Cache2, Row(Order, LineItem), salesDomain, sales) import Data.Monoid ( Sum) import Criterion.Main ( defaultMain, bgroup, bench, whnf, nf, Benchmark, env) main :: IO () main = defaultMain [ bgr...
phischu/incremental-query
bench/Main.hs
bsd-3-clause
1,558
0
12
243
545
292
253
39
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE DataKinds #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Geometry.Instances.Real -- Copyright : Copyright (C) 2015 Artem M. Chirkin <chirkin@arch.ethz.ch> -- License : BSD3 -- -- Maintainer : Arte...
achirkin/fastvec
src/Data/Geometry/Instances/Real.hs
bsd-3-clause
4,861
0
8
815
338
192
146
68
1
{-# LANGUAGE MultiParamTypeClasses #-} module Tower.Bool ( Bool(..) , And(..) , Or(..) , Xor(..) ) where import Protolude (Bool(..)) import qualified Protolude as P import Tower.Ordering import Tower.Magma newtype And = And Bool newtype Or = Or Bool newtype Xor = Xor Bool instance Magma And where ...
tonyday567/tower
src/Tower/Bool.hs
bsd-3-clause
1,248
0
9
265
497
254
243
-1
-1
{-# LANGUAGE CPP, TypeFamilies, OverloadedStrings, DeriveDataTypeable, FlexibleContexts, GeneralizedNewtypeDeriving, RecordWildCards, TemplateHaskell, MultiParamTypeClasses, FlexibleInstances #-} module Data.Grob.Acid where import Control.Monad.State (get, put) import Control.Monad.Reade...
ixmatus/grob
src/Data/Grob/Acid.hs
bsd-3-clause
1,350
0
12
376
324
180
144
30
1
module Language.AVR.Shared where import Control.Monad.Cont import Control.Monad.Identity import Control.Monad.State import Data.Array (Ix(..)) import Data.SBV import qualified Data.Map as M data Register = R0 | R1 | R2 | R3 | R4 | R5 | R6 ...
davnils/avr-asm-dsl
avr-lib/Language/AVR/Shared.hs
bsd-3-clause
2,079
0
12
1,009
529
311
218
74
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} module Main where import Control.Monad import Happstack.Server import System.Environment handlers :: ServerPart Response handlers = msum [ dir "pong" $ ok (toResponseBS "text/plain" "pong") , serveFile (asContentType "image/png") "FiringGeometry.png" ...
aslatter/happstack-wai
bench/SimpleHttp.hs
bsd-3-clause
494
0
12
91
149
78
71
14
2
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeInType #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# ...
kosmikus/records-sop
src/Generics/SOP/Record.hs
bsd-3-clause
10,526
0
13
1,997
1,809
1,073
736
-1
-1
{-# LANGUAGE FlexibleContexts #-} module Gun where import Rumpus majorScale = map (+60) [0,2,4,7,9] randomNote = do i <- randomRange (0, length majorScale - 1) return (majorScale !! i) start :: Start start = do removeChildren setRepeatingAction (1/5) $ do note <- randomNote ...
lukexi/rumpus
util/DevScenes/Shoo/Gun.hs
bsd-3-clause
787
0
17
294
273
135
138
24
1
{-# LANGUAGE OverloadedStrings, PostfixOperators, NamedFieldPuns #-} module Language.Naga.Prim where import MPS.Env hiding ((<), (>), (+), (*), (/), Int, String, (^), apply, return, Bool) import Prelude () import Language.Naga.Type import qualified Prelude as P import qualified Data.ByteString.UTF8 as B import Data....
nfjinjing/naga
src/Language/Naga/Prim.hs
bsd-3-clause
1,502
2
14
361
559
333
226
45
2
-- Quasicrystals demo. -- -- Based on code from: -- http://hackage.haskell.org/package/repa-examples -- http://mainisusuallyafunction.blogspot.com/2011/10/quasicrystals-as-sums-of-waves-in-plane.html -- module Main where import Config import Data.Word import Data.Label import Foreign.Ptr import Control.Monad imp...
blambo/accelerate-examples
examples/crystal/Main.hs
bsd-3-clause
6,039
0
16
1,898
1,442
779
663
96
2
-- TP1 main :: IO() main = undefined --Question 3 sommeDeXaY :: Int -> Int -> Int sommeDeXaY x y = if x > y then 0 else x + sommeDeXaY (x+1) y -- Question 4 somme :: [Int] -> Int somme [] = 0 somme (x:xs) = x + somme xs ...
jecisc/TP_PF_L3
PF-TP1/src/Main.hs
mit
1,642
0
9
532
740
393
347
42
2
module SmallLibraryForMaybe where -- Write the following functions. This may -- take some time. -- 1. Simple boolean checks for Maybe values -- isJust (Just 1) -- True -- isJust Nothing -- False isJust :: Maybe a -> Bool isJust Nothing = False isJust _ = True -- isNothing (Just 1) -- False -- isNothing No...
brodyberg/Notes
ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/SmallLibraryForMaybeChapter12.hs
mit
2,152
0
12
559
513
289
224
40
4
module End.Util.Animation where import Graphics.UI.SDL import Graphics.UI.SDL.Image import Data.Word import End.Collection import End.Collection.Header loadImage :: String -> Maybe (Word8, Word8, Word8) -> IO Surface loadImage filename colorKey = load filename >>= displayFormat >>= setColorKey' colorKey setColorKey'...
kwrooijen/sdl-game
End/Util/Animation.hs
gpl-3.0
775
0
9
133
220
120
100
13
1
-- | -- Module : Crypto.PubKey.RSA.Types -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : Good -- {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Crypto.PubKey.RSA.Types ( Error(..) , Blinde...
vincenthz/cryptonite
Crypto/PubKey/RSA/Types.hs
bsd-3-clause
3,283
0
13
770
569
347
222
59
1
module Cauterize.Dynamic.Meta ( module M ) where import Cauterize.Dynamic.Meta.Gen as M import Cauterize.Dynamic.Meta.Pack as M import Cauterize.Dynamic.Meta.Unpack as M import Cauterize.Dynamic.Meta.Types as M
reiddraper/cauterize
src/Cauterize/Dynamic/Meta.hs
bsd-3-clause
216
0
4
28
49
37
12
6
0
import Database.HaskellDB.FlatDB import System.Environment import System.IO main :: IO () main = do args <- getArgs case args of [f] -> newDB f _ -> hPutStrLn stderr "Usage: flatdb-create <file>"
chrisdone/haskelldb-demo
lib/haskelldb/driver-flat/tools/flatdb-create.hs
bsd-3-clause
233
0
10
67
69
35
34
8
2
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} -- | Docker configuration module Stack.Config.Docker where import Stack.Prelude import Data.List (find) import qualified Data.Text as T import Distribution.Version (...
juhp/stack
src/Stack/Config/Docker.hs
bsd-3-clause
4,233
0
19
1,049
831
423
408
87
5
-------------------------------------------------------------------------------- -- | Module dealing with HTTP: request data types, encoding and decoding... {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} module Network.WebSockets.Http ( Headers , RequestHead (..) , Request (..) ...
nsluss/websockets
src/Network/WebSockets/Http.hs
bsd-3-clause
9,189
0
14
1,825
1,647
919
728
147
2
{-# LANGUAGE ScopedTypeVariables, EmptyDataDecls, DoRec #-} import FRP.Sodium import Control.Applicative import Control.Monad import Control.Monad.Trans import Data.Char import Data.IORef import Test.HUnit event1 = TestCase $ do (ev, push) <- sync newEvent outRef <- newIORef "" sync $ do push '?' ...
kevintvh/sodium
haskell/examples/tests/unit-tests.hs
bsd-3-clause
18,660
0
20
5,253
7,718
3,717
4,001
502
3
{-| Module : Idris.PartialEval Description : Implementation of a partial evaluator. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE FlexibleContexts, PatternGuards #-} module Idris.PartialEval( partial_eval, getSpecApps, specType , mkPE_TyDecl, mkPE_TermDecl, PEArgType(.....
markuspf/Idris-dev
src/Idris/PartialEval.hs
bsd-3-clause
17,181
2
20
5,699
5,481
2,833
2,648
275
24
-- -- Pretend long copyright notice is here. -- module Comment1 where main = print "Hello, complicated world!"
charleso/intellij-haskforce
tests/gold/parser/Comment00001.hs
apache-2.0
115
0
5
20
15
10
5
2
1
module Tinc.GhcInfo where import System.Process import Tinc.GhcPkg import Tinc.Types import Tinc.Fail data GhcInfo = GhcInfo { ghcInfoPlatform :: String , ghcInfoVersion :: String , ghcInfoGlobalPackageDb :: Path PackageDb } deriving (Eq, Show) getGhcInfo :: IO GhcInfo getG...
haskell-tinc/tinc
src/Tinc/GhcInfo.hs
bsd-3-clause
845
0
16
199
227
115
112
23
1
{- Copyright (C) 2007 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 the License, or (at your option) any later version. This program is distr...
kowey/pandoc-old
src/Text/Pandoc/Writers/Man.hs
gpl-2.0
14,294
0
22
3,856
4,273
2,118
2,155
258
7
<?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>Requester</title> <maps> <homeID>requester</homeID> <mapref location="ma...
thc202/zap-extensions
addOns/requester/src/main/javahelp/help_bs_BA/helpset_bs_BA.hs
apache-2.0
960
92
29
155
389
208
181
-1
-1
import Control.Concurrent import GHC.Conc import Debug.Trace -- <<main main = do t <- myThreadId labelThread t "main" m <- newEmptyMVar t <- forkIO $ putMVar m 'a' labelThread t "a" t <- forkIO $ putMVar m 'b' labelThread t "b" traceEventIO "before takeMVar" takeMVar m takeMVar m -- >>
prt2121/haskell-practice
parconc/mvar4.hs
apache-2.0
308
1
9
70
114
49
65
14
1
-- GSoC 2015 - Haskell bindings for OpenCog. {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} -- | Simple example on using the Pattern Matcher. import OpenCog.AtomSpace (AtomSpace,insert,get,remove,cogBind, debug,runOnNewAtomSpace,printAtom, ...
inflector/atomspace
examples/haskell/example_pattern_matcher.hs
agpl-3.0
1,517
2
11
575
320
161
159
35
2
{-# LANGUAGE CPP, BangPatterns #-} ----------------------------------------------------------------------------- -- | Separate module for HTTP actions, using a proxy server if one exists ----------------------------------------------------------------------------- module Distribution.Client.HttpUtils ( DownloadResu...
thoughtpolice/cabal
cabal-install/Distribution/Client/HttpUtils.hs
bsd-3-clause
26,445
0
23
7,972
5,589
2,938
2,651
502
5
{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} import Network.Wai.Application.Static ( StaticSettings (..), staticApp, defaultMimeType, defaultListing , defaultMimeTypes, mimeTypeByExt ) import Network.Wai.Handler.Warp (run) import System.Environment (getArgs) import System.Console.CmdArgs import Text...
ygale/yesod
yesod-static/test/unicode/warp.hs
mit
1,658
18
13
359
480
266
214
42
4
module Sudoku ( Sudoku, solve, isSolved, pPrint ) where import Data.Maybe import Data.List import Data.List.Split type Sudoku = [Int] solve :: Sudoku -> Maybe Sudoku solve sudoku | isSolved sudoku = Just sudoku | otherwise = do index <- elemIndex 0 sudoku let sudokus = [nextTest sudoku index i | ...
kyoungrok0517/linguist
samples/Haskell/Sudoku.hs
mit
2,061
0
15
599
795
390
405
40
1
-- Copyright (c) 2000 Galois Connections, Inc. -- All rights reserved. This software is distributed as -- free software under the license in the file "LICENSE", -- which is included in the distribution. module RayTrace(module Illumination, module Surface) where import Illumination import Surface
olsner/ghc
testsuite/tests/programs/galois_raytrace/RayTrace.hs
bsd-3-clause
300
0
4
46
24
18
6
3
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception ( bracket, catch ) import Control.Monad ( forever ) import System.Socket import System.Socket.Family.Inet6 import System.Socket.Type.Stream import System.Socket.Protocol.TCP main :: IO () main = bracket ( socket :: IO (Socket Inet6 Strea...
lpeterse/haskell-socket
examples/HelloWorldServer.hs
mit
977
0
13
212
329
169
160
30
1
{-# htermination listToFM :: [(Ordering,b)] -> FiniteMap Ordering b #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_listToFM_11.hs
mit
89
0
3
12
5
3
2
1
0
module MaybeLib where import Data.Maybe as M (fromJust) -- >>> isJust (Just 1) -- True -- >>> isJust Nothing -- False isJust :: Maybe a -> Bool isJust Nothing = False isJust (Just _) = True -- >>> isNothing (Just 1) -- False -- >>> isNothing Nothing -- True isNothin...
mikegehard/haskellBookExercises
chapter12/MaybeLib.hs
mit
1,760
0
8
559
412
227
185
28
2
{-# LANGUAGE OverloadedStrings #-} module SoOSiM.Examples.Parser where import Data.Aeson ((.:),eitherDecode,FromJSON(..),Value (..)) import Data.ByteString.Lazy as BS import Data.Maybe (fromJust) import Control.Applicative ((<$>),(<*>)) import Control.Monad (mzero) import SoOSiM.Components...
christiaanb/SoOSiM-components
src/SoOSiM/Examples/Parser.hs
mit
838
0
11
167
247
140
107
25
1
module Proteome.System.Path where import Path (Abs, File, Path, parseRelFile) import Path.IO (findExecutable) import Proteome.Data.GrepError (GrepError) import qualified Proteome.Data.GrepError as GrepError (GrepError(NoSuchExecutable, NotInPath)) findExe :: MonadIO m => MonadDeepError e GrepError m => Text ->...
tek/proteome
packages/proteome/lib/Proteome/System/Path.hs
mit
578
0
11
101
169
92
77
-1
-1
import Drawing import Exercises import Geometry (find,beyond,line_circle,circle_circle) import Geometry.Utils (coarse_ne) main = drawPicture myPicture myPicture = version1 {-- grain = 0.02 left = -10 next = left + grain right = -left --} version1 points = drawPoints circle & drawPoints parabola & mes...
alphalambda/k12math
prog/demo/ex17visible.hs
mit
564
1
14
187
176
94
82
15
1
-- | -- Module: Main -- License: MIT -- -- Run like: -- >$ cabal-graphdeps mypackage | tred | dot -Tpng > ~/mypackage.png module Main where import Control.Applicative import Control.Exception import Control.Monad (foldM, forM_) import Data.Char (isSpace) import Data.Li...
jmillikin/cabal-graphdeps
src/Main.hs
mit
7,535
363
10
1,400
2,113
1,198
915
152
4
module FrontEnd.SrcLoc where import Control.Applicative import Control.Monad.Identity import Control.Monad.Writer import Data.Foldable import Data.Traversable import Data.Binary import Data.Generics import PackedString data SrcLoc = SrcLoc { srcLocFileName :: PackedString, srcLocLine :: {-# UNPACK #-...
dec9ue/jhc_copygc
src/FrontEnd/SrcLoc.hs
gpl-2.0
3,318
0
10
732
1,082
554
528
84
1
{-# LANGUAGE RecordWildCards, PatternGuards #-} module ParseHints where import Types import Arches import AtomIndex import qualified IndexSet as IxS import Data.List.Split import System.IO import Data.Functor import System.FilePath import System.Directory import qualified Data.ByteString.Char8 as BS import Data.Mayb...
nomeata/sat-britney
ParseHints.hs
gpl-2.0
6,038
0
16
1,393
1,703
914
789
116
11
{----------------------------------------------------------------- (c) 2009-2014 Markus Dittrich, Pittsburgh Supercomputing Center & Carnegie Mellon University This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 ...
haskelladdict/simgi
src/RpnCalc.hs
gpl-3.0
3,791
0
15
1,054
558
297
261
38
5
module Utils.Numeric ( compareDouble ) where compareDouble :: Double -> Double -> Double -> Bool compareDouble a b eps | a == b = True -- shortcut, handles infinities | a == 0 || b == 0 || diff < minValue -- a or b is zero or both are extremely close to it -- relative error is less me...
thalerjonathan/phd
thesis/code/sir/src/test/Utils/Numeric.hs
gpl-3.0
684
0
12
230
235
124
111
19
1
module Ampersand.Core.ShowAStruct (AStruct(..)) where import Ampersand.Basics import Ampersand.Core.A2P_Converters import Ampersand.Core.AbstractSyntaxTree import Ampersand.Core.ShowPStruct class AStruct a where showA :: a -> String instance AStruct A_Context where showA = showP . aCtx2pCtx instance AStruct Exp...
AmpersandTarski/ampersand
src/Ampersand/Core/ShowAStruct.hs
gpl-3.0
1,157
0
12
281
341
174
167
33
0
-- Solutions for the exercises of the SLIDES "Programming In Haskell" by Graham Hutton: CHAPTER 4 (Defining Functions) {-- (1) Consider a function safetail that behaves in the same way as tail, except that safetail maps the empty list to the empty list, whereas tail gives an error in this case. Define safetail using:...
thalerjonathan/phd
coding/learning/haskell/grahambook/src/Slides/Chapter4.hs
gpl-3.0
1,364
0
8
297
239
130
109
15
3
module Scheme.Evaluator.IOPrimitivesSpec where import Test.Hspec hiding (shouldThrow) spec = do describe "" $ do it "" $ pending
Altech/haScm
test/Scheme/Evaluator/IOPrimitivesSpec.hs
gpl-3.0
139
0
11
28
43
23
20
5
1
{-# LANGUAGE OverloadedStrings #-} module ProperDemo where import qualified Data.Map.Strict as M import Control.Monad.IO.Class (liftIO) import Control.Monad.State (modify, get) import Visnov import VisnovDesc import Sound type Affinity = Int main = do putStrLn "Ok." world <- loadWorld runVisnov game world 0 ...
exitmouse/proper
src/ProperDemo.hs
gpl-3.0
2,763
0
12
753
732
360
372
78
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-androiddeviceprovisioning/gen/Network/Google/Resource/AndroidDeviceProvisioning/Customers/Devices/List.hs
mpl-2.0
5,411
0
18
1,278
879
508
371
120
1
{-# LANGUAGE DeriveDataTypeable, RecordWildCards, ExistentialQuantification, FlexibleContexts #-} module Main where -- standard modules import Prelude hiding (catch) import Control.Exception import Control.Monad import Control.Parallel.Strategies import qualified Data.Char as Char import Data.List import Data.Maybe im...
spatial-reasoning/zeno
src/compareAndAdjust.hs
bsd-2-clause
10,467
0
22
3,194
2,212
1,135
1,077
204
20
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} module Ermine.Parser where import Control.Applicative import Control.Lens import Control.Monad import Data.Foldable import Data.Monoid import qualified Data.Set as Set import Data.Set (Set...
PipocaQuemada/ermine
src/Ermine/Parser.hs
bsd-2-clause
7,320
0
19
1,933
2,815
1,428
1,387
192
16
-- #hide ----------------------------------------------------------------------------- -- | -- Module : Network.CGI.Multipart -- Copyright : (c) Peter Thiemann 2001,2002 -- (c) Bjorn Bringert 2005-2006 -- License : BSD-style -- -- Maintainer : Anders Kaseorg <andersk@mit.edu> -- Stabilit...
andersk/haskell-cgi
Network/CGI/Multipart.hs
bsd-3-clause
7,530
0
15
2,163
1,870
997
873
123
5
module Language.Slambda.Read ( parseTerm , readTerm , parseProgram , readProgram ) where import Language.Slambda.Types import Language.Slambda.Util import Control.Monad (liftM, liftM2, when) import Data.Char import Data.List import qualified Data.Map as Map import Data.Map (Map) imp...
pgavin/secdh
lib/Language/Slambda/Read.hs
bsd-3-clause
4,937
0
18
1,704
1,813
882
931
191
5
module Util.JSON where import Error import Util.HandleIO import qualified Data.Aeson as A import qualified Data.ByteString.Lazy as BS decodeFile :: A.FromJSON a => FilePath -> IO a decodeFile f = io errMsg . errorDecode =<< BS.readFile f where errMsg = "couldn't parse file '" ++ f ++ "' to JSON" errorDecode ::...
kylcarte/wangtiles
src/Util/JSON.hs
bsd-3-clause
405
0
8
73
125
68
57
10
1
data X data Y data Z xz :: X -> Z xz = undefined yz :: Y -> Z yz = undefined xform :: (X, Y) -> (Z, Z) xform (x, y) = (xz x, yz y)
pdmurray/haskell-book-ex
src/ch5/ch5.9.6.hs
bsd-3-clause
134
0
6
40
85
49
36
-1
-1
{-# LANGUAGE RankNTypes , ScopedTypeVariables #-} module Linear.Grammar ( (.+.) , (.*.) , (.==.) , (.<=.) , (.>=.) , module Linear.Grammar.Types.Inequalities )where import Linear.Grammar.Types.Syntax (LinAst (EAdd, ECoeff)) import Linear.Grammar.Types.Expressions (makeLinExpr) import qualified L...
athanclark/cassowary-haskell
src/Linear/Grammar.hs
bsd-3-clause
1,050
0
11
217
427
238
189
29
1
module Onedrive.Internal.Response (json, lbs) where import Control.Monad (void) import Control.Monad.Catch (MonadThrow(throwM)) import Control.Monad.IO.Class (MonadIO(liftIO)) import Data.Aeson (FromJSON) import Data.ByteString (empty) import Data.ByteString.Lazy (ByteString) import Network.HTTP.Conduit (HttpExceptio...
asvyazin/hs-onedrive
src/Onedrive/Internal/Response.hs
bsd-3-clause
1,829
0
14
337
554
297
257
40
4
import Control.Concurrent import Control.Monad import Hypervisor.Debug import System.CPUTime import Data.Time.Format main :: IO () main = showTime 32 showTime :: Int -> IO () showTime 0 = return () showTime x = do cputime <- getCPUTime writeDebugConsole $ "[" ++ show x ++ "] Now is: \n" writeDebugConsole $ " ...
GaloisInc/HaLVM
examples/Core/SimplerTime/SimplerTime.hs
bsd-3-clause
397
0
9
79
143
70
73
15
1
import Text.Printf import Vec3 main :: IO () main = do let r0 = Vec3 150e09 0.0 0.0 let r1 = Vec3 0.0 0.0 0.0 let v0 = Vec3 0.0 29.658e03 0.0 let v1 = Vec3 0.0 0.0 0.0 let m0 = 5.98e24 let m1 = 1.98855e30 let n = 720 :: Int let dt = (365.0*24.0*60.0*60.0) / fromIntegral n :: Double printf "%12s, %12s...
jguillaumes/orbit-examples
haskell/orbits.hs
bsd-3-clause
1,340
0
16
411
693
346
347
46
1
{-# LANGUAGE RecursiveDo, RankNTypes, NamedFieldPuns, RecordWildCards #-} module Distribution.Server.Features.RecentPackages ( RecentPackagesFeature(..), RecentPackagesResource(..), initRecentPackagesFeature, ) where import Distribution.Server.Framework import Distribution.Server.Features.Core import Di...
snoyberg/hackage-server
Distribution/Server/Features/RecentPackages.hs
bsd-3-clause
6,753
0
18
1,830
1,111
623
488
94
2
------------------------------------------------------------------------------- {- LANGUAGE CPP #-} #if OVERLOADED_STRINGS {-# LANGUAGE FlexibleInstances #-} {- LANGUAGE TypeSynonymInstances #-} #endif #define DO_TRACE 0 #if ABBREV_WN_AND_TN_CONCRETE_SYNTAX_TO_NUMBER_ALONE__SAFE_ONLY_TO_DEPTH_19 && ABBREV_WN_A...
phunehehe/deepseq-bounded
src/Control/DeepSeq/Bounded/Compile.hs
bsd-3-clause
21,725
0
17
5,148
4,099
2,252
1,847
179
15
module Repository where import Common (PackageName,VersionNumber,SourceRepository) import Data.Version (showVersion,Version(Version)) import Distribution.Hackage.DB (readHackage') import System.Directory ( doesFileExist,createDirectoryIfMissing,doesDirectoryExist) import System.Cmd (rawSystem) import Control.M...
phischu/hackage-analysis
src/Repository.hs
bsd-3-clause
5,029
0
27
985
1,273
697
576
110
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative hiding (many) import Data.Monoid import Data.List (foldl') import Data.Attoparsec import Data.Attoparsec.Char8 (char8) import Test.QuickCheck import qualified Network.IRC.Message as I import System.Random (Random(..), RandomGen) import Dat...
bernstein/ircfs
tests/Tests.hs
bsd-3-clause
3,403
0
14
748
1,272
700
572
83
1
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module Guesswork.Estimate where import Control.Arrow import Data.Ord import Data.List import Guesswork.Types import Guesswork.Math.Statistics import qualified Guesswork.Transform as TRANSFORM data (Sample a) => Estimated a = Estimated { truths ...
deggis/guesswork
src/Guesswork/Estimate.hs
bsd-3-clause
887
0
11
240
251
146
105
22
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} module Language.Whippet.Typecheck ( module Language.Whippet.Typecheck.Errors , module Language.Whippet.Typecheck.Lenses , module Language.Whippet.Typecheck.Types , Checkable (..) , TypeCheck , typecheck ) where import ...
chrisbarrett/whippet
src/Language/Whippet/Typecheck.hs
bsd-3-clause
4,047
0
14
1,112
899
475
424
-1
-1
------------------------------------------------------------------------------- ---- | ---- Module : Main ---- Copyright : (c) Stefan Berthold 2014-2015 ---- License : BSD3-style (see LICENSE) ---- ---- Maintainer : stefan.berthold@gmx.net ---- Stability : unstable ---- Portability : ---- ---- Alte...
ZjMNZHgG5jMXw/smallcaps
src/twocase/twocase.hs
bsd-3-clause
1,403
0
10
295
264
158
106
23
1
{-# Language RankNTypes #-} {-# Language PatternSynonyms #-} {-# Language TypeApplications #-} {-# Language DataKinds #-} {-# Language GADTs #-} {-# Language OverloadedStrings #-} module Mir.Compositional where import Data.Parameterized.Context (pattern Empty, pattern (:>)) import Data.Parameterized.NatRepr import Da...
GaloisInc/saw-script
crux-mir-comp/src/Mir/Compositional.hs
bsd-3-clause
5,038
0
16
914
1,367
663
704
100
1
import System.Environment (getArgs) main :: IO () main = do [inpFile] <- getArgs input <- readFile inpFile putStr . unlines . map (show . sum . map (read . (:[]))) $ lines input
nikai3d/ce-challenges
easy/sum_digits.hs
bsd-3-clause
191
0
16
46
94
47
47
6
1
module Main where main :: IO () main = putStrLn "Hi from app"
cdodev/scintilla
app/Main.hs
bsd-3-clause
63
0
6
14
22
12
10
3
1
module GrMain where import qualified System.Environment as S import Data.Map (toList) import Control.Monad (forM_) import GraphReduction.Compiler (runProgram, compile) import GraphReduction.Machine (eval, code, dump, stack, heap) import Util.Heap (objects) import Core.LambdaLift (lambdaLift) import Core.Parser (parse...
WraithM/CoreCompiler
src/GrMain.hs
bsd-3-clause
1,421
0
21
395
396
196
200
38
2
module UntypedSpec where import Untyped.Eval import Untyped.Syntax import Untyped.Builtins import Control.Monad.State import Control.Monad.Except import Test.Hspec toplevel' :: [String] -> StateT Context Error String toplevel' [] = return "empty expressions" toplevel' [x] = do expr <- parseExpr x ...
zjhmale/Ntha
test/UntypedSpec.hs
bsd-3-clause
1,014
0
10
299
276
138
138
24
1
{-# LANGUAGE RankNTypes, TypeOperators, ScopedTypeVariables, DataKinds, TypeFamilies, PolyKinds, GADTs #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} ----------------------------------------------------------------------------- -- | -- Module : Language.Glambda.Eval -- Copyright :...
ajnsit/glambda
src/Language/Glambda/Eval.hs
bsd-3-clause
3,594
0
15
1,024
1,333
661
672
56
6
{-# LANGUAGE OverloadedStrings , BangPatterns #-} import System (getArgs) import Data.List (groupBy, foldl', intercalate) import Data.Maybe (fromJust, listToMaybe) import Control.Applicative ((<$>)) import Control.Monad (forM_, msum) import Data.Binary (Binary, put, get, encodeFile) import qualified Data.M...
kawu/nerf-misc
util/Lmf2Map.hs
bsd-3-clause
2,084
0
12
508
731
397
334
-1
-1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE PackageImports #-} module Main where import Control.Concurrent.Async import Control.Monad import System.Environment import qualified Data.Primitive as P import Control.Concurrent import Control.Concurrent.Chan import Control.Concurrent.STM import Control.Concurrent.STM.TQ...
jberryman/chan-benchmarks
MainN.hs
bsd-3-clause
24,888
0
28
9,459
4,211
2,160
2,051
208
2
-- | Module containing the template data structure -- {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Hakyll.Web.Template.Internal ( Template (..) , TemplateElement (..) ) where import Control.Applicative ((<$>)) import Data.Binary (Binary, get, getWord8, put, putWord8) import Data....
sol/hakyll
src/Hakyll/Web/Template/Internal.hs
bsd-3-clause
1,193
0
12
309
303
171
132
28
0
{-# Language QuasiQuotes, OverloadedStrings #-} {-| Module : Client.Hook.Snotice Description : Hook for sorting some service notices into separate windows. Copyright : (c) Eric Mertens 2019 License : ISC Maintainer : emertens@gmail.com These sorting rules are based on the solanum server notices. -} module...
glguy/irc-core
src/Client/Hook/Snotice.hs
isc
11,326
0
16
2,469
2,647
1,882
765
174
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} module Database.Persist.Quasi ( parse , PersistSettings (..) , upperCaseSettings , lowerCaseSettings , nullable #if TEST , Token (..) , tokenize , parseFieldType #endif ...
psibi/persistent
persistent/Database/Persist/Quasi.hs
mit
20,226
0
20
6,166
6,362
3,285
3,077
401
13
module Sound.Tidal.Blofeld where import Sound.Tidal.Stream (makeI, makeF) import Sound.Tidal.MIDI.Control keys :: ControllerShape keys = ControllerShape {params = [ mCC "portamento" 5, mCC "expression" 11, CC "lfoshape" 15 (0, 5) 0 passThr...
kindohm/tidal-midi
Sound/Tidal/MIDI/Blofeld.hs
gpl-3.0
2,958
0
9
1,221
679
361
318
65
1
module Main where import HplProducts.Test hiding (main) main :: IO () main = do return ()
alessandroleite/hephaestus-pl
src/meta-hephaestus/HplDrivers/LoadTest.hs
lgpl-3.0
92
0
8
18
38
21
17
4
1
-- | Example of defining FFI functions. -- -- The `ffi' method is currently incompatible with 'RebindableSyntax', -- so these are defined in another module. module FFIExample where import Data.Text (Text) import DOM import FFI onKeyUp :: Element -> Fay () -> Fay () onKeyUp = ffi "%1.onkeyup=%2" setInnerHTML :: Elem...
lubomir/dot-race
fay/FFIExample.hs
bsd-3-clause
379
0
8
64
81
45
36
8
1
{-# LANGUAGE TypeFamilies, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, RankNTypes, GADTs, ScopedTypeVariables, FunctionalDependencies, RecursiveDo, UndecidableInstances, GeneralizedNewtypeDeriving, StandaloneDeriving, EmptyDataDecls, NoMonomorphismRestriction, TypeOperators, DeriveDataTypeable, PackageI...
k0001/reflex
test/Reflex/Test/CrossImpl.hs
bsd-3-clause
11,406
0
25
2,840
5,250
2,754
2,496
-1
-1