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
{-# OPTIONS_GHC -Wall #-} module Reporting.Error.Type where import qualified Data.Map as Map import qualified Data.Maybe as Maybe import Text.PrettyPrint.ANSI.Leijen ( Doc, (<>), (<+>), colon, dullyellow , fillSep, hang, indent, text, underline, vcat ) import qualified AST.Type as Type import qualified AST.Vari...
laszlopandy/elm-compiler
src/Reporting/Error/Type.hs
bsd-3-clause
18,809
0
23
6,691
3,273
1,664
1,609
439
31
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Filter operators for JSON values added to PostgreSQL 9.4 module Database.Persist.Postgresql.JSON ( (@>.) , (<@.) , (?.) , (?|.) , (?&.) , Value() ) where import Data.Aeson (FromJSON, ToJSON, Value, encode, eitherDecodeStrict) ...
naushadh/persistent
persistent-postgresql/Database/Persist/Postgresql/JSON.hs
mit
12,559
0
10
3,289
1,290
835
455
82
3
folder f a xs = foldM f a xs >> return ()
mpickering/hlint-refactor
tests/examples/Monad18.hs
bsd-3-clause
41
0
7
11
29
13
16
1
1
{-# LANGUAGE OverloadedStrings #-} {- A simple HTTP server that serves static source and data files for tests, and additionally supports some dynamic responses: -} module Server (startServer) where import Control.Concurrent import qualified Control.Exception as E import Control.Monad import ...
ryantrinkle/ghcjs
test/Server.hs
mit
8,755
0
29
2,369
2,257
1,151
1,106
156
5
----------------------------------------------------------------------------- -- | -- Module : XMonad.Util.Themes -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 -- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : unportable -- -- A (hopefully) growing collec...
adinapoli/xmonad-contrib
XMonad/Util/Themes.hs
bsd-3-clause
15,650
0
8
7,897
1,462
959
503
220
2
import System.Environment main :: IO () main = do [arg] <- getArgs env <- getEnvironment putStrLn "Running Background App." putStrLn $ " Args: " ++ show arg putStrLn $ "Environment: " ++ show env putStrLn "Stopping Background App."
telser/keter
incoming/foo1_0/worker.hs
mit
265
0
8
71
78
35
43
9
1
{-# LANGUAGE ApplicativeDo #-} f :: Int -> IO Int f x = do y <- return (x + 1) return (y * 2)
sdiehl/ghc
testsuite/tests/ghci.debugger/scripts/break029.hs
bsd-3-clause
99
0
10
29
52
25
27
5
1
module T4007 where f :: IO () f = sequence_ (replicate 10 (putStrLn "yes"))
urbanslug/ghc
testsuite/tests/perf/compiler/T4007.hs
bsd-3-clause
78
0
9
16
36
19
17
3
1
-- Test for trac #1042 import Control.Exception import Data.Int main :: IO () main = do print ((minBound :: Int) `div` (-1)) `myCatch` print print ((minBound :: Int8) `div` (-1)) `myCatch` print print ((minBound :: Int16) `div` (-1)) `myCatch` print print ((minBound :: Int32) `div` (...
urbanslug/ghc
testsuite/tests/numeric/should_run/numrun013.hs
bsd-3-clause
476
0
12
118
221
127
94
10
1
-- | Gearman specific stuff {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Vaultaire.Collector.Nagios.Perfdata.Gearman where import Vaultaire.Collector.Nagios.Perfdata.Process import Vaultaire.Collector.Nagios.Perfdata.Types import Control.Concurrent impor...
anchor/vaultaire-collector-nagios
lib/Vaultaire/Collector/Nagios/Perfdata/Gearman.hs
mit
3,503
0
20
905
867
446
421
62
3
module Main where sum' :: (Num a) => [a] -> a sum' xs = foldl (\acc x -> acc + x) 0 xs sum2 :: (Num a) => [a] -> a sum2 = foldl (+) 0
rglew/lyah
foldl.hs
mit
137
0
8
39
87
49
38
5
1
{-# LANGUAGE OverloadedStrings #-} -- | This module handles all of the scans requested by the user module Scans (attachScanEvents, initScanState, scanShape, ScanState(step,rotations,top,bottom,offset,choice), scansReady, populateTable,dropScan,updateTitle,toFile,MouseState) where import D...
rprospero/PhotoAlign
Scans.hs
mit
14,033
1
32
4,415
4,596
2,368
2,228
279
3
module Functors where import Control.Lens -- items from chapter 12 of Programming in Haskell 2nd Ed by Graham Hutton inc :: [Int] -> [Int] inc [] = [] inc (n:ns) = n+1 : inc ns sqr :: [Int] -> [Int] sqr [] = [] sqr (n:ns) = n^2 : sqr ns map' :: (a -> b) -> [a] -> [b] map' f [] = [] map' f (x:xs) = f x : map ...
brodyberg/LearnHaskell
CaesarCypher.hsproj/Functors.hs
mit
1,404
0
8
421
510
278
232
29
1
module Main where import Control.Applicative import Control.Concurrent.MVar import Control.Concurrent import Data.Time import System.Environment main = do mv <- newEmptyMVar start <- getCurrentTime loop mv =<< read . head <$> getArgs end <- getCurrentTime putStrLn $ "creation time: " ++ show (diffUTCTime en...
nlim/haskell-playground
src/Threads.hs
mit
717
0
13
226
258
121
137
22
1
module Example where import Data.Monoid import Control.Monad import Types import Drum import Play import Dseq beat1 = mconcat [ sequence_ [hi, hi, hi, hi], sequence_ [bd, sn, bd, sn] ] wassup = n2 bd >> n8 bd >> n4 sn >> n2 bd >> n8 bd >> n4 bd >> n2 sn -- Trap Beat -- Tempo: 210 h8 = replica...
reedrosenbluth/Djembe
src/Example.hs
mit
3,677
0
11
1,011
883
439
444
69
1
module GHCJS.DOM.SQLTransactionCallback ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/SQLTransactionCallback.hs
mit
52
0
3
7
10
7
3
1
0
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGAElement (getTarget, SVGAElement(..), gTypeSVGAElement) where import Prelude ((.), (==), (>>=), return, IO, In...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGAElement.hs
mit
1,265
0
10
138
345
224
121
21
1
{-| Module : Text.LParse.TokenStream Description : Underlying data structure for sequential parsing Copyright : (c) Marcus Völker, 2017-2018 License : MIT Maintainer : marcus.voelker@rwth-aachen.de This module contains the `TokenStream` class, an abstraction of lists, similar to `Traversable`, but geared f...
MarcusVoelker/LParse
src/Text/LParse/TokenStream.hs
mit
2,078
0
10
529
617
318
299
37
1
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module BinaryTree2 where -- an experiment to make a Binary tree where the values are stored at the leafs not the nodes. -- trouble is it makes insertion problematic as I can't tell where to insert values in the tree. -- so experiment aborted data BinaryTree2 a = ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter11.hsproj/BinaryTree2.hs
mit
764
0
8
182
63
42
21
6
0
{-# LANGUAGE CPP #-} module GHCJS.DOM.HTMLTableSectionElement ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.HTMLTableSectionElement #else module Graphics.UI.Gtk.WebKit.DOM.HTMLTableSectionElement #endif ) where #if (defined(ghcjs_HOST_OS) && ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/HTMLTableSectionElement.hs
mit
500
0
5
39
33
26
7
4
0
import System.Environment import Data.List main = do args <- getArgs progName <- getProgName putStrLn "The arguments are:" mapM putStrLn args putStrLn "The program name is:" putStrLn progName
fabriceleal/learn-you-a-haskell
09/args.hs
mit
223
0
7
58
56
24
32
9
1
-- Note: we should only depend on libraries that ship with GHC for this. No -- external dependencies! import Control.Monad (when) import Data.List (concat, isPrefixOf) import Data.Version (Version, parseVersion) import Prelude ...
fpco/minghc
minghc-post-install.hs
mit
4,306
0
23
1,779
1,045
548
497
93
4
module E10 where data MyType = TypeOne String | TypeTwo String definition :: TypeOne -> Bool definition (TypeOne aString) = True {- -}
pascal-knodel/haskell-craft
Examples/· Errors/E10.hs
mit
173
0
7
61
42
24
18
5
1
{-# OPTIONS -fallow-overlapping-instances #-} {- arch-tag: Object tests main file Copyright (C) 2005 John Goerzen <jgoerzen@complete.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either versio...
jgoerzen/missingpy
testsrc/Objectstest.hs
gpl-2.0
6,618
0
13
1,827
2,119
1,177
942
124
1
-- DivideVencerasOrdRapida.hs -- Divide y vencerás: ordenación rápida. -- José A. Alonso Jiménez https://jaalonso.github.com -- ===================================================================== module Tema_23.DivideVencerasOrdRapida where -- Hay que elegir una implementación import Tema_23.DivideVenceras -- impor...
jaalonso/I1M-Cod-Temas
src/Tema_23/DivideVencerasOrdRapida.hs
gpl-2.0
887
0
10
215
192
107
85
10
3
module Tema_23c_BEE_Reinas_Spec (main, spec) where import Tema_23.BEE_Reinas import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "valida" $ do it "e1" $ valida [(1,1)] (2,2) `shouldBe` False it "e2" $ valida [(1,1)] (2,3) `shouldBe` True describe "sucesoresNR...
jaalonso/I1M-Cod-Temas
test/Tema_23c_BEE_Reinas_Spec.hs
gpl-2.0
654
0
14
158
377
220
157
23
1
import Multiple main :: IO () main = readLn >>= print . solve solve :: Integer -> Integer solve p = f 3 + f 5 - f 15 where f = multiples_under p
NorfairKing/project-euler
001/haskell/solution.hs
gpl-2.0
159
1
7
48
75
35
40
6
1
-- -*- mode: haskell -*- {-# LANGUAGE TemplateHaskell #-} module NPDA.Property where import NPDA.Type import Condition import Autolib.Reporter import Autolib.Reporter.Type import Autolib.ToDoc import Autolib.Reader import Data.Typeable data Property = Det | Sane | Accept_by Acceptance_Mode ...
florianpilz/autotool
src/NPDA/Property.hs
gpl-2.0
556
0
9
111
143
82
61
18
0
module Main where { import Salsa20; import qualified Data.ByteString.Lazy as Lazy; main :: IO(); -- sadly normal String putStr fails here due to unicode. main = do { fi <- Lazy.getContents; let { (key, salt) = Lazy.splitAt 32 fi }; {-^ We expact exactly 32 + 24 bytes of input -} Lazy.putStr $ Lazy.pack $ xsalsa (Lazy.u...
kenta2/yescrypt
Xsalsa.hs
gpl-3.0
498
0
11
87
117
70
47
8
1
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the Lice...
karamellpelle/grid
designer/source/LevelTools/EditType.hs
gpl-3.0
1,155
0
5
231
82
60
22
17
0
-- This is the alternate command line argument parser frontend. It takes -- arguments compatible with the reference parser for COP5555. It is compatible -- with class requirements. If you're actually looking to use the program, I'd -- recommend the GNU-style frontend. It's better. module Main (main) where import Syst...
bgw/hs-rpal
src/hsRpalCompat.hs
gpl-3.0
1,965
0
12
597
382
212
170
34
2
{-# LANGUAGE TemplateHaskell #-} module THVersion where import Language.Haskell.TH
jplLloyd/pointwise-composition
src/Data/THVersion.hs
gpl-3.0
86
0
4
12
11
8
3
3
0
module Engine.Graphics.Assets.ImageLoader(loadImage) where import Codec.Picture import Codec.Picture.Types import System.Exit (exitFailure) loadImage :: FilePath -> IO (Image PixelRGBA8) loadImage fp = do res <- readPng fp case res of Left err -> do putStrL...
halvorgb/AO2D
src/Engine/Graphics/Assets/ImageLoader.hs
gpl-3.0
752
0
13
211
210
103
107
19
2
module Core.Square ( square ) where square :: Int -> Int square x = x * x
adarqui/ToyBox
haskell/Core/src/Core/Square.hs
gpl-3.0
76
0
5
19
32
18
14
4
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Layers/UnPublish.hs
mpl-2.0
2,670
0
13
641
303
186
117
49
1
{- passman Copyright (C) 2018-2021 Jonathan Lamothe <jonathan@jlamothe.net> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later vers...
jlamothe/passman
test/Spec/PWHasService.hs
lgpl-3.0
1,553
0
8
310
316
188
128
28
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PackageImports #-} {- Copyright 2018 The CodeWorld Authors. 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:...
tgdavies/codeworld
codeworld-base/src/Internal/Text.hs
apache-2.0
3,631
0
11
804
963
548
415
87
1
-- | read-write lock specialized for using LMDB with MDB_NOLOCK option -- module Database.VCache.RWLock ( RWLock , newRWLock , withRWLock , withRdOnlyLock ) where import Control.Monad import Control.Exception import Control.Concurrent.MVar import Data.IORef import Data.IntSet (IntSet) import quali...
bitemyapp/haskell-vcache
hsrc_lib/Database/VCache/RWLock.hs
bsd-2-clause
4,694
0
17
1,057
1,033
545
488
91
2
-- | This module exports the templates for automatic instance deriving of "Transformation.Shallow" type classes. The most -- common way to use it would be -- -- > import qualified Transformation.Shallow.TH -- > data MyDataType f' f = ... -- > $(Transformation.Shallow.TH.deriveFunctor ''MyDataType) -- {-# Language CPP,...
blamario/grampa
deep-transformations/src/Transformation/Shallow/TH.hs
bsd-2-clause
17,642
0
23
4,150
5,883
2,977
2,906
266
6
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QPainterPath.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:35 Warning : this file is machine generated - do ...
keera-studios/hsQt
Qtc/Enums/Gui/QPainterPath.hs
bsd-2-clause
2,596
0
18
543
629
323
306
58
1
module Main (main) where import Test.Framework (defaultMain) import qualified Database.Redis.Tags.Test.Tags main :: IO () main = defaultMain [ Database.Redis.Tags.Test.Tags.tests ]
akaspin/hedis-tags
test/Main.hs
bsd-2-clause
206
0
7
44
55
35
20
6
1
module UniversalSyntax( VarName, DataConName, Literal, Type, var, dataCon, intLit, floatLit, charLit, getVarName, getDataConName) where -- This is a module for syntax elements that are the same across all intermediate -- representations, from the core syntax to the imperative representation data Type = Type...
dillonhuff/AFL
src/UniversalSyntax.hs
bsd-3-clause
832
0
7
191
218
126
92
28
1
{-# LANGUAGE TypeOperators, CPP #-} #include "macros.h" LANGUAGE_UNSAFE module Type.Eq.Higher.Unsafe (module Type.Eq.Unsafe, module Type.Eq.Higher.Unsafe) where import Type.Eq.Unsafe import {-# SOURCE #-} Type.Eq.Higher import Unsafe.Coerce -- | Very unsafe! The same rules apply as for 'unsafeCoerce'. unsafeCoerci...
glaebhoerl/type-eq
Type/Eq/Higher/Unsafe.hs
bsd-3-clause
679
0
8
98
131
73
58
-1
-1
{-# 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...
adamwalker/haskell_cudd
Cudd/Imperative.hs
bsd-3-clause
17,777
0
22
4,358
6,842
3,323
3,519
-1
-1
module Linear.Cassowary.ClSimplexSolver where -- addConstraint :: ClSimplexSolver -> ClConstraint -> IO () -- removeConstraint :: ClSimplexSolver -> ClConstraint -> IO () -- addEditVar :: ClSimplexSolver -> ClVariable -> ClStrength -> IO () -- removeEditVar :: ClSimplexSolver -> ClVariable -> IO () -- beginEdit ...
athanclark/cassowary-haskell
src/Linear/Cassowary/ClSimplexSolver.hs
bsd-3-clause
761
0
3
130
20
18
2
1
0
module Util.Sort (quicksort) where quicksort :: (Ord a) => [a] -> [a] quicksort [] = [] quicksort (x:xs) = quicksort left ++ [x] ++ quicksort right where left = [ y | y <- xs, y <= x ] right = [ y | y <- xs, x < y ]
masateruk/haskell-dev-env
Util/Sort.hs
bsd-3-clause
232
0
9
67
129
70
59
6
1
{-# LANGUAGE OverloadedStrings #-} {- | Description: low-level SMTP communciation. -} module Network.Mail.SMTP.SMTPRaw ( SMTPRaw(..) , smtpConnect , smtpSendCommand , smtpSendCommandAndWait , smtpSendRaw , smtpGetReplyLines , smtpDisconnect ) where import qualified Data.ByteString as B import ...
avieth/smtp-mail-ng
Network/Mail/SMTP/SMTPRaw.hs
bsd-3-clause
2,500
0
11
509
518
278
240
46
1
{-# LANGUAGE CPP, QuasiQuotes, TemplateHaskell #-} -- | -- Template Haskell to generate defaultMain with a list of "Test" from -- \"doc_test\", \"case_\<somthing\>\", and \"prop_\<somthing\>\". -- -- An example of source code (Data/MySet.hs): -- -- > {-| Creating a set from a list. O(N log N) -- > -- > >>> empty == fr...
kazu-yamamoto/test-framework-th-prime
Test/Framework/TH/Prime.hs
bsd-3-clause
4,160
0
15
934
349
231
118
35
2
module AI.MathTmp where import Data.List -- Math functions copied from Math.Statistics because the whole thing wouldn't compile mean :: Floating a => [a] -> a mean x = fst $ foldl' (\(m, n) x -> (m+(x-m)/(n+1),n+1)) (0,0) x -- mean x = fst $ foldl' (\(!m, !n) x -> (m+(x-m)/(n+1),n+1)) (0,0) x -- |A...
mikeizbicki/Classification
src/AI/MathTmp.hs
bsd-3-clause
1,562
0
13
482
534
279
255
23
2
{-# LANGUAGE MultiParamTypeClasses , TemplateHaskell , ScopedTypeVariables , FlexibleInstances , FlexibleContexts , UndecidableInstances #-} module Spire.Canonical.Checker where import Control.Monad.Except import Unbound.LocallyNameless hiding ( Spine ) import Spire.Canonical.Types import Spire.Canonic...
spire/spire
src/Spire/Canonical/Checker.hs
bsd-3-clause
11,060
0
17
2,804
5,091
2,404
2,687
316
2
module Parser where import Control.Applicative import Control.Monad import Data.Char newtype Parser a = Parser (String -> [(a, String)]) apply :: Parser a -> String -> [(a, String)] apply (Parser f) s = f s parse :: Parser a -> String -> a parse m s = one [x | (x, t) <- apply m s, t== ""] where one [] = error...
bzhkl/MonadTry
LibParser/Parser.hs
bsd-3-clause
2,792
0
14
727
1,026
536
490
70
3
{-# LANGUAGE BangPatterns #-} module Network.DNS.Cache.Cache ( CacheRef , newCacheRef , lookupCacheRef , insertCacheRef , pruneCacheRef ) where import Control.Applicative ((<$>)) import Data.IORef (newIORef, readIORef, atomicModifyIORef', IORef) import Data.OrdPSQ (OrdPSQ) import qualified Data.OrdPSQ a...
kazu-yamamoto/concurrent-dns-cache
Network/DNS/Cache/Cache.hs
bsd-3-clause
957
0
11
162
334
184
150
24
1
-- generated by derive.hs module Prose.Internal.GraphemeBreakTest where graphemebreaktest = [ [" "," "], [" \776"," "], [" ","\r"], [" \776","\r"], [" ","\n"], [" \776","\n"], [" ","\SOH"], [" \776","\SOH"], [" \768"], [" \776\768"], [" \2307"], [" \776\2307"], [" ","...
llelf/prose
Prose/Internal/GraphemeBreakTest.hs
bsd-3-clause
9,759
0
6
2,079
3,613
2,409
1,204
404
1
-- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow, 2011 -- -- Generate code to initialise cost centres -- -- ----------------------------------------------------------------------------- module ProfInit (profilingInitCode) where import GhcPrelude imp...
sdiehl/ghc
compiler/profiling/ProfInit.hs
bsd-3-clause
2,228
0
17
556
482
245
237
43
2
module Graphics.Volume.MarchingCubes where import Graphics.Volume.MarchingCubesTables import Numeric.ScalarField import Control.Lens import Data.Bits import qualified Data.Vector as V import Linear -- | Calculates the isosurface of a scalar field in three dimensional euclidian space. ma...
fatho/volume
src/Graphics/Volume/MarchingCubes.hs
bsd-3-clause
3,878
0
14
1,190
1,305
710
595
-1
-1
module IA.GA ( GenoType , GenoTypes , PhenoType , Population , Select , CrossOver , Mutate , Fitness , FitnessType(..) , mkFitness , mkSelect , mkCrossOver , mkMutate , binaryTournament , runGA , randomRSt , randomSt , GeneBits(..) , muta...
dlgd/GA
src/IA/GA.hs
bsd-3-clause
5,977
0
14
1,741
2,478
1,274
1,204
169
2
{-# LANGUAGE CPP #-} module Distribution.Simple.UUAGC.UUAGC(uuagcUserHook, uuagcUserHook', uuagc, uuagcLibUserHook, uuagcFromString ...
norm2782/uuagc
cabal-plugin/src/Distribution/Simple/UUAGC/UUAGC.hs
bsd-3-clause
12,604
0
22
3,846
3,085
1,630
1,455
240
3
module TestFactorial where import Factorial import TestUtil ff :: Int --ff = 2 ^ 27 ff = 6 run :: IO () run = do putStrLn ("factorial1 " ++ show ff ++ " = " ++ show (factorial1 ff)) putStrLn ("factorial2 " ++ show ff ++ " = " ++ show (factorial2 ff))
pmilne/algebra
test/TestFactorial.hs
bsd-3-clause
275
0
12
77
102
52
50
9
1
{- Copyright James d'Arcy 2010 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the followi...
jamesdarcy/DicomH
src/Data/Dicom/Tag.hs
bsd-3-clause
2,638
0
5
438
200
124
76
37
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Error-checking and other utilities for @deriving@ clauses or declarations. -} {-# LANGUAGE TypeFamilies #-} module TcDerivUtils ( DerivM, DerivEnv(..), DerivSpec(..), pprDerivSpec, DerivSpecMechan...
shlevy/ghc
compiler/typecheck/TcDerivUtils.hs
bsd-3-clause
36,389
0
17
10,504
5,233
2,826
2,407
-1
-1
{-# LANGUAGE PatternSynonyms #-} module QueryArrow.FileSystem.Builtin where import QueryArrow.Syntax.Term import QueryArrow.Syntax.Type import QueryArrow.Syntax.Utils pattern FilePathPredName ns = QPredName ns [] "FILE_PATH" pattern DirPathPredName ns = QPredName ns [] "DIR_PATH" pattern FileIdPredName n...
xu-hao/QueryArrow
QueryArrow-db-filesystem/src/QueryArrow/FileSystem/Builtin.hs
bsd-3-clause
5,033
0
12
700
1,550
738
812
49
0
module ML ( module ML.Num , module ML.V2 , module ML.V3 , module ML.V4 , module ML.M2 , module ML.M3 , module ML.M4 , module ML.Q ) where import ML.Num import ML.V2 import ML.V3 import ML.V4 import ML.M2 import ML.M3 import ML.M4 import ML.Q
jxv/ml-hs
src/ML.hs
bsd-3-clause
280
0
5
82
94
60
34
17
0
module LeapYearKata.Day2 (isLeapYear) where isLeapYear :: Int -> Bool isLeapYear year = (isDivisibleByFour $ div year 100) && isDivisibleByFour year where isDivisibleByFour :: Int -> Bool isDivisibleByFour num = num `mod` 4 == 0
Alex-Diez/haskell-tdd-kata
old-katas/src/LeapYearKata/Day2.hs
bsd-3-clause
270
0
8
75
76
41
35
5
1
{-# LANGUAGE TupleSections #-} module Language.Haskell.Liquid.Bare.RTEnv ( makeRTEnv ) where import Prelude hiding (error) import Data.Graph hiding (Graph) import Data.Maybe import qualified Control.Exception as Ex import qualified Data.HashMap.Strict as M import qualified Data.List as L import L...
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Bare/RTEnv.hs
bsd-3-clause
5,742
0
15
1,716
2,160
1,106
1,054
132
21
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module React.Flux.Mui.DropDownMenu where import Protolude import Data.Aeson import Data.Aeson.Casing import Data.String (String) import React.Flux import React.Flux.Mui.Util data DropDownMenu = DropDownMenu { dropDownMenuAnimated :: !(Maybe Bool) ...
pbogdan/react-flux-mui
react-flux-mui/src/React/Flux/Mui/DropDownMenu.hs
bsd-3-clause
1,216
0
11
194
313
173
140
48
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleContexts #-} module Data.PList.Binary ( PList(..) , _PBool , _PInt ...
tkonolige/haskell-bplist
src/Data/PList/Binary.hs
bsd-3-clause
12,833
0
23
4,684
3,699
1,877
1,822
278
25
module System.Mesos.Raw.MasterInfo where import System.Mesos.Internal type MasterInfoPtr = Ptr MasterInfo foreign import ccall unsafe "ext/types.h toMasterInfo" c_toMasterInfo :: Ptr CChar -- infoID -> CInt -- infoIDLen -> CUInt -- infoIP -> Ptr CUInt -- infoPort -> Ptr CChar -- pid -> CInt -- p...
Atidot/hs-mesos
src/System/Mesos/Raw/MasterInfo.hs
mit
2,231
0
18
510
767
380
387
59
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} module Rackspace.MailGun ( Message (..) , sendMessage , sendWith ) where import Control.Monad.Cat...
AndrewRademacher/mailgun
src/Rackspace/MailGun.hs
mit
2,765
0
13
958
718
387
331
65
2
{-# LANGUAGE BangPatterns #-} {-| Implementation of the Ganeti Query2 server. -} {- Copyright (C) 2012, 2013 Google Inc. 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 Li...
dblia/nosql-ganeti
src/Ganeti/Query/Server.hs
gpl-2.0
10,460
0
18
2,672
2,342
1,217
1,125
187
5
module Main where import qualified Api.Server as S main :: IO () main = S.main
Geeroar/ut-haskell
src/Main.hs
apache-2.0
81
0
6
17
29
18
11
4
1
{-| Module : Models.TimedAutomaton Description : A (simplified) type for Timed Automata (TA) extended as in the UPPAAL tool (and XTA format). Copyright : (c) 2017 Pascal Poizat License : Apache-2.0 (see the file LICENSE) Maintainer : pascal.poizat@lip6.fr Stability : experimental Portability : unknown -} ...
pascalpoizat/veca-haskell
src/Models/TimedAutomaton.hs
apache-2.0
15,955
0
15
4,389
4,347
2,344
2,003
333
2
<?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="fil-PH"> <title>Ang Port Scan | ZAP Extension</title> <maps> <homeID>top</homeID> <map...
veggiespam/zap-extensions
addOns/scripts/src/main/javahelp/org/zaproxy/zap/extension/scripts/resources/help_fil_PH/helpset_fil_PH.hs
apache-2.0
989
85
52
163
406
213
193
-1
-1
{-# LANGUAGE PatternGuards, ViewPatterns, TypeSynonymInstances, FlexibleInstances, Rank2Types #-} module Core.Syntax where import Core.Data (DataCon) import Name import Utilities import StaticFlags type Var = Name data PrimOp = Add | Subtract | Multiply | Divide | Modulo | Equal | LessThan | LessThanEqual ...
batterseapower/mini-ghc
Core/Syntax.hs
bsd-3-clause
11,795
0
17
2,991
4,334
2,191
2,143
178
9
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} import SDL.Pal import Graphics.GL.Pal import Halive.Utils import Control.Monad.Reader import Data.Time import Data.Foldable -- import System.Random data Uniforms = Uniforms { uMVP :: UniformLocation (M44 GLflo...
lukexi/gl-pal
test/TestInstanced.hs
bsd-3-clause
2,380
3
18
625
636
306
330
46
1
{-# LANGUAGE CPP, FlexibleInstances, IncoherentInstances, NamedFieldPuns, NoImplicitPrelude, OverlappingInstances, TemplateHaskell, UndecidableInstances #-} {-| Module: Data.Aeson.TH Copyright: (c) 2011-2015 Bryan O'Sullivan (c) 2011 MailRank, Inc. License: Apache Stability: experimen...
abbradar/aeson
Data/Aeson/TH.hs
bsd-3-clause
41,015
0
24
15,314
9,613
5,206
4,407
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ScopedTypeVariables #-} module Language.Haskell.Liquid.GhcInterface ( -- * extract all information neede...
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/GhcInterface.hs
bsd-3-clause
15,977
0
20
4,263
4,325
2,204
2,121
287
4
module GoToSymbolFunction_SymbolOnDeclaration where test :: Int test = let s<caret>even = 7 in seven + 1
charleso/intellij-haskforce
tests/gold/codeInsight/GoToSymbolFunction_SymbolOnDeclaration.hs
apache-2.0
112
2
9
23
38
19
19
-1
-1
{-| Some utility functions, based on the Confd client, providing data in a ready-to-use way. -} {- Copyright (C) 2013 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 met: 1. Redistributions of...
yiannist/ganeti
src/Ganeti/Confd/ClientFunctions.hs
bsd-2-clause
3,572
0
13
616
530
275
255
41
3
{-# LANGUAGE CPP #-} {- | Module : $Header$ Description : cpp choice between "GUI.ProofManagement" and "GUI.GtkProverGUI" Copyright : (c) C. Maeder, Uni Bremen 2002-2005 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-porta...
keithodulaigh/Hets
GUI/ProverGUI.hs
gpl-2.0
1,379
0
14
235
116
74
42
16
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Data.Array.Accelerate.CUDA.CodeGen.Mapping -- Copyright : [2008..2014] Manuel M T Chakravarty, Gabriele Keller ...
flowbox-public/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/Mapping.hs
bsd-3-clause
2,221
0
14
686
329
197
132
27
1
module Concat () where import Language.Haskell.Liquid.Prelude ------------------------------------------------------------ ------------ Longer Version of neg/polypred.hs ------------- ------------------------------------------------------------ foo :: [[Int]] foo = [[choose 1], [choose 2]] -- concatmap f ls = conca...
mightymoose/liquidhaskell
tests/neg/concat1.hs
bsd-3-clause
797
0
8
157
221
125
96
15
1
{-# LANGUAGE FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, OverlappingInstances, UndecidableInstances #-} module Main where import Control.Applicative class (Monad m) => MonadIO m where -- | Lift a computation from the 'IO' monad. liftIO :: IO a -> m a instance MonadIO IO where liftIO ...
manyoo/ghcjs
test/ghc/typecheck/t5751.hs
mit
1,085
1
10
245
323
163
160
-1
-1
module Parser ( parseExpr , parseExprList ) where import Control.Applicative ((<$>), (<*>), (<|>)) import Text.ParserCombinators.Parsec hiding (spaces, (<|>)) import Types spaces :: Parser () spaces = skipMany1 space symbol :: Parser Char symbol = oneOf "!#$%&|*+-/:<=>?@^_~" parseExpr :: Parser LispVal p...
frasertweedale/wyas
src/Parser.hs
mit
1,553
0
15
355
555
279
276
58
3
-- Phone Directory -- https://www.codewars.com/kata/56baeae7022c16dd7400086e module Codewars.G964.Phonedir(phone) where import Data.Char(isDigit) import Data.List(intercalate) import Data.Maybe(listToMaybe, mapMaybe) import Control.Applicative((<|>)) import Text.ParserCombinators.ReadP(readP_to_S, satisfy, get, many,...
gafiatulin/codewars
src/5 kyu/Phonedir.hs
mit
1,841
0
21
456
756
415
341
25
4
-- Generated by protobuf-simple. DO NOT EDIT! module Types.UInt64Msg where import Control.Applicative ((<$>)) import Prelude () import qualified Data.ProtoBufInt as PB newtype UInt64Msg = UInt64Msg { value :: PB.Word64 } deriving (PB.Show, PB.Eq, PB.Ord) instance PB.Default UInt64Msg where defaultVal = UInt64M...
sru-systems/protobuf-simple
test/Types/UInt64Msg.hs
mit
844
0
13
157
296
159
137
20
0
series = [x^x|x<-[1..1000]] ans = sum series
stefan-j/ProjectEuler
q48.hs
mit
51
1
8
12
37
18
19
2
1
-- This file is covered by an MIT license. See 'LICENSE' for details. -- Author: Bertram Felgenhauer {-# LANGUAGE OverloadedStrings #-} module Confluence.Direct.HuetToyamaOostrom ( confluent ) where import Text.PrettyPrint.ANSI.Leijen import Data.Rewriting.CriticalPair as C import Data.Rewriting.Rules import Co...
haskell-rewriting/confluence-tool
src/Confluence/Direct/HuetToyamaOostrom.hs
mit
2,344
0
15
706
735
357
378
56
3
{-# htermination realToFrac :: (Ratio Int) -> Float #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_realToFrac_4.hs
mit
56
0
2
9
3
2
1
1
0
{-# LANGUAGE OverloadedStrings #-} import qualified Data.Char as Char import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.IO as IO import qualified Numeric main = do strings <- Text.lines <$> IO.getContents let stringLiterals = map encode strings let sizeOfStringLiterals = sum ...
SamirTalwar/advent-of-code
2015/AOC_08_2.hs
mit
709
1
12
123
211
107
104
19
3
module Web.TSBot.ClientQuery.PrettyPrintSpec (spec) where import Web.TSBot.ClientQuery.PrettyPrint () import Test.Hspec spec :: Spec spec = it "is" pending
taktoa/TSBot
test-suite/Web/TSBot/ClientQuery/PrettyPrintSpec.hs
mit
159
0
5
20
43
27
16
5
1
module TypeChecksAssignment where --- Person data Person = Person Bool deriving Show printPerson :: Person -> IO() printPerson person = putStrLn( show person ) --- Mood data Mood = Blah | Woot deriving (Show, Eq) settleDown x = if x == Woot then Blah else x --- Sentenc...
Lyapunov/haskell-programming-from-first-principles
chapter_6/typechecks.hs
mit
771
0
7
197
247
138
109
25
2
-- A solution, but incredibly slow. One to work on. module Main where import Data.List main :: IO () main = do putStrLn $ show $ largestPrimeFactor 600851475143 factorize :: Int -> [Int] factorize n = filter (\x -> (n `mod` x == 0)) [1 .. n] largestPrimeFactor :: Int -> Int largestPrimeFactor n = maximum $ fil...
Praenomen/My-Project-Euler
Haskell/Problem003.hs
mit
366
0
10
74
144
79
65
9
1
{- Copyright (c) 2015 Nils 'bash0r' Jonsson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
project-horizon/framework
src/lib/Language/PolyDSL/Transformation/JavaScript/MainModule.hs
mit
2,550
0
15
488
255
141
114
22
0
{-# LANGUAGE BangPatterns #-} module Main where import Control.Monad.State import Control.Monad.Writer import Control.Monad.Reader import Control.Monad.MonteCarlo import Control.Monad.Loops import Control.DeepSeq import Control.Exception import System.Random.TF import Transport.NISTData import Data.List (foldl') imp...
icasperzen/hs-carbon-examples
examples-src/Transport/Transport.hs
mit
4,020
0
14
939
1,383
750
633
99
2
-- Homework01.hs -- -- EECS 776, Homework 1 -- Author: Stefan Mendoza -- Date: 25 September 2015 -- Email: stefanmendoza.dev@gmail.com module Main where import Data.Char rot13 :: String -> String rot13 = map rotateChar rotateChar :: Char -> Char rotateChar c | c `elem` ['A'..'Z'] = if (ord c) + 13 > (or...
stefanmendoza/EECS-776
Homework01.hs
mit
664
0
10
214
245
129
116
20
3
module Main where import Data.List main :: IO () main = putStrLn $ show result --result :: Integer --result = foldr (*) 1 [1 .. 100000] result :: Integer result = foldl' (*) 1 [1 .. 100000]
hnfmr/beginning_haskell
profiling-example/src/Main.hs
mit
195
0
6
42
58
34
24
6
1
module FuzzyMatch where matchingCount xs ys = length $ filter (uncurry (==)) $ zip xs ys bigrams [] = [] bigrams [_] = [] bigrams xs@(_:xs') = take 2 xs : bigrams xs' intersection [] _ = [] intersection (x:xs) ys = if x `elem` ys then x : intersection xs ys else inte...
dewaka/fuzzy_string_match
Text/FuzzyMatch.hs
mit
1,258
0
11
313
494
250
244
29
2
module Proteome.Test.MultiTagsTest where import Hedgehog ((===)) import Path (File, Rel, parseAbsDir, parseRelDir, relfile, toFilePath, (</>)) import Path.IO (doesFileExist) import Ribosome.Config.Setting (updateSetting) import Ribosome.Nvim.Api.IO (bufferGetOption, vimGetCurrentBuffer) import Ribosome.Test.Run (UnitT...
tek/proteome
packages/test/test/Proteome/Test/MultiTagsTest.hs
mit
1,902
0
12
252
580
312
268
-1
-1
module TiposAbstratosPolimorfismoParametricoLimitado where import ExpressoesLambdaComposicaoLazyness -- Voltando agora para o exercício de expressões de ExpressoesLambdaComposicaoLazyness, -- a representação de expressões como triplas não é tão adequada (representa expressões -- binárias, não expressões em geral), ...
pauloborba/plc
src/TiposAbstratosPolimorfismoParametricoLimitado.hs
cc0-1.0
5,798
0
10
1,203
911
507
404
50
1
{- An example yi.hs that uses the Vim keymap with these additions: - Always uses the VTY UI by default. - The color style is darkBlueTheme - The insert mode of the Vim keymap has been extended with a few additions I find useful. -} import Yi.Prelude import Prelude () import Yi import Yi.Keymap.Vim i...
codemac/yi-editor
src/Yi/Users/Corey.hs
gpl-2.0
4,927
0
21
1,912
753
402
351
73
3