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
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright (C) 2014 2015, Julia Longtin (julial@turinglace.com) -- Released under the GNU GPL, see LICENSE -- A module of math utilities. module Graphics.Implicit.MathUtil (rmax, rmin, rmaximum, rminimum, distFromLineSeg, pack, box3sWithin) where...
silky/ImplicitCAD
Graphics/Implicit/MathUtil.hs
gpl-2.0
4,209
0
19
1,382
1,504
854
650
83
4
--file project-euler/P16.hs import Data.Char main = do putStrLn $ show $ sumDigits (2^1000) sumDigits n = sum $ map digitToInt $ show n
NaevaTheCat/Project-Euler-Haskell
P16.hs
gpl-2.0
141
0
10
28
55
27
28
4
1
{-# LANGUAGE TemplateHaskell, EmptyDataDecls #-} module Tile ( Tile(..) , Tile.id , charRepr , TileRepr(..) ) where import Counter import Control.Lens.Getter import Control.Lens.TH import Actor(Actor) import StaticElement(StaticElement) import qualified Actor import qua...
svenkeidel/gnome-citadel
src/Tile.hs
gpl-3.0
798
0
9
192
222
126
96
25
0
{- | Module : FMP.RedBlack Copyright : (c) 2003-2010 Peter Simons (c) 2002-2003 Ferenc Wágner (c) 2002-2003 Meik Hellmund (c) 1998-2002 Ralf Hinze (c) 1998-2002 Joachim Korittky (c) 1998-2002 Marco Kuhlmann Licen...
peti/funcmp
FMP/RedBlack.hs
gpl-3.0
6,226
0
15
3,251
1,146
586
560
73
1
-- | -- Copyright : (c) 2010-2012 Simon Meier, Benedikt Schmidt -- contributing in 2019: Robert Künnemann, Johannes Wocker -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : portable -- -- Parsing Standard and Guarded Formulas module Theory.Text....
tamarin-prover/tamarin-prover
lib/theory/src/Theory/Text/Parser/Formula.hs
gpl-3.0
3,448
0
14
939
806
434
372
65
2
main = show "hello, world"
roberth/uu-helium
test/correct/ShowString1.hs
gpl-3.0
27
0
5
5
9
4
5
1
1
module TB.Data.ByteString.Misc ( bsToHex, bsToOctal ) where import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.Word import Numeric -- | Convert a bytestring to a hex string -- -- >>> bsToHex "hi" -- "6968" bsToHex :: ByteString -> String --bsToHex =...
adarqui/ToyBox
haskell/haskell/bytestring/src/TB/Data/Bytestring/Misc.hs
gpl-3.0
666
0
10
149
164
95
69
13
1
module Tests.BoardTest where import Wordify.Rules.Board.Internal import Wordify.Rules.Pos import Data.Maybe import Wordify.Rules.Square import Wordify.Rules.Tile import Wordify.Rules.Square import qualified Data.Map as M import Wordify.Rules.Pos.Internal import Test.HUnit.Base i...
Happy0/haskellscrabble
test/Tests/BoardTest.hs
gpl-3.0
6,733
0
16
1,724
2,032
1,108
924
112
2
{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-} -- | -- Copyright : (c) 2010-2012 Simon Meier, Benedikt Schmidt -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : portable -- -- Parsing protocol theories. See the MANUAL for a high-level description of -- the syn...
rsasse/tamarin-prover
lib/theory/src/Theory/Text/Parser.hs
gpl-3.0
37,032
1
18
10,576
8,583
4,316
4,267
582
16
{-# LANGUAGE FlexibleContexts , FlexibleInstances , RecordWildCards #-} module Texture.Sampler ( hitAndRunSlice , HRSCfg (..) , defaultCfg ) where import Data.IORef import Linear.Vect import System.Random import Texture.Orientation -- | Function to obtain a linear shoter. class HasRandomDir a where...
lostbean/sledge
src/Texture/Sampler.hs
gpl-3.0
4,808
5
26
1,536
1,501
765
736
110
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-run/gen/Network/Google/Resource/Run/Namespaces/DomainmAppings/Delete.hs
mpl-2.0
6,844
0
21
1,573
1,028
595
433
145
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-surveys/gen/Network/Google/Resource/Surveys/Surveys/Update.hs
mpl-2.0
3,131
0
13
699
387
234
153
61
1
{-# LANGUAGE OverloadedStrings #-} module View.Periodic ( htmlPeriodic ) where import Action.Types import View.Form import {-# SOURCE #-} Controller.Periodic htmlPeriodic :: RequestContext -> FormHtml f htmlPeriodic = htmlForm "run periodic" postPeriodic () (field "weekly" $ inputCheckbox False) (const m...
databrary/databrary
src/View/Periodic.hs
agpl-3.0
327
0
8
54
77
42
35
12
1
-- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } import Test (longbindingNameThatoverflowsColum) import Test (Long(List, Of, Things))
lspitzner/brittany
data/Test486.hs
agpl-3.0
199
0
6
19
26
18
8
2
0
{-# LANGUAGE MultiParamTypeClasses, ScopedTypeVariables #-} -- | This module provides the 'Buffer' type class that abstracts the array type that is being used for I\/O. For concrete instances see for example the /hsndfile-vector/ package <http://hackage.haskell.org/package/hsndfile-vector>. module Sound.File.Sndfile.Bu...
kaoskorobase/hsndfile
Sound/File/Sndfile/Buffer.hs
lgpl-2.1
2,916
0
13
655
739
400
339
49
2
import Data.List import Text.Printf main :: IO () main = interact $ unlines . zipWith output [1..] . map (solve.words) . tail . lines output :: Int -> Double -> String output testCase res = printf "Case #%d: %.10f" testCase res solve :: [String] -> Double solve (cmd: x) | cmd == "mean" = sum a / (fromIntegral $ ...
indy256/codejam-templates
template.hs
unlicense
437
1
10
103
214
104
110
13
1
{-# LANGUAGE BangPatterns #-} {-# OPTIONS -O2 -with-rtsopts=-A64m #-} import qualified Data.ByteString.Char8 as C import qualified Data.Set as Set import Data.Set(Set) import Data.Maybe(fromJust) import Data.Int import Data.Bits import Data.Char import Data.List import Text.Printf newtype SInt = SInt Int64 ...
wangbj/haskell
mchaos.hs
bsd-2-clause
2,863
6
17
1,049
1,189
641
548
91
1
-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> module Photoname.Common ( Ph, runRename -- Re-exporting: , MonadError , ask, asks , liftIO , throwError ) where import Control.Monad.Error import Control.Monad.Reader import Photoname....
tkawachi/photoname
src/Photoname/Common.hs
bsd-3-clause
505
0
9
105
127
74
53
12
1
module System.Timeout.Resettable.CPS ( TimeoutCallback , Key , register , pause , reset , whilePaused , cancel ) where --------------------------------------------------------------------- -- Imports --------------------------------------------------------------------- import Control.E...
basvandijk/resettable-timeouts
System/Timeout/Resettable/CPS.hs
bsd-3-clause
2,011
0
9
622
492
254
238
47
1
module Lib.Task78 where import Data.Array.Unboxed import Data.Array.ST import Control.Monad.ST import Control.Monad import Data.STRef task78 =head $ runST$ (lookup n) where n = 100000::Int lookup n = do res <- (newSTRef []) aR <- ((newArray (0,n) 1)::ST s (STUArray s Int Int...
Austrotaxus/EulerProj
src/Lib/Task78.hs
bsd-3-clause
799
0
21
376
292
153
139
23
2
module Main where triplets :: [(Int, Int, Int)] triplets = [(x, y, 1000-x-y) | x <- [1..1000], y <- [x..1000-x]] pythagoean :: [(Int, Int, Int)] -> [(Int, Int, Int)] pythagoean trs = filter isPitagorean trs where isPitagorean (a, b, c) = a*a + b*b == c*c multiply :: [(Int, Int, Int)] -> [Int] multiply ps =...
tomob/euler
009/009.hs
bsd-3-clause
477
0
14
117
263
148
115
11
1
module ZuriHac.Plays.Protocol where import ZuriHac.Plays.TH import ZuriHac.Plays.Prelude {- { "client": <uuid>, "event": { "KeyPress": <key-code> } } OR { "client": <uuid>, "event": { "KeyRelease": <key-code> } } -} type KeyCode = Text data Event = EventKeyPress KeyCode | EventKeyRelease...
bitonic/zurihac-plays
src/ZuriHac/Plays/Protocol.hs
bsd-3-clause
533
0
7
103
110
62
48
-1
-1
-- |Module containing all main Haskoop types. module Haskoop.Types where -- |A 'KeyValue' is any type that can be used as a key or as a value. class (Show a, Read a, Eq a) => KeyValue a where -- |Read the value from a string. readKeyValue :: String -> a readKeyValue = read -- |Transform the value into a string. s...
jejansse/Haskoop
src/Haskoop/Types.hs
bsd-3-clause
1,976
4
9
408
555
311
244
-1
-1
{-# LANGUAGE ViewPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.RotateSome -- Description : Rotate some elements around the stack. -- Copyright : (c) 2020 Ivan Brennan <ivanbrennan@gmail.com> -- License : BSD3-style (see LICENSE...
xmonad/xmonad-contrib
XMonad/Actions/RotateSome.hs
bsd-3-clause
5,871
0
16
1,398
857
475
382
50
2
{-# LANGUAGE DeriveDataTypeable #-} module WhileParser where import Data.Data import System.IO import Control.Monad import Text.Parsec (Parsec, runP) import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr import Text.ParserCombinators.Parsec.Language import qualified Text.ParserCombinators.Parse...
PiffNP/HaskellProject
src/WhileParser.hs
bsd-3-clause
9,831
0
16
2,888
3,097
1,550
1,547
265
8
{-# LANGUAGE RankNTypes #-} module Options.Applicative.Extra ( -- * Extra parser utilities -- -- | This module contains high-level functions to run parsers. helper, hsubparser, execParser, execParserMaybe, customExecParser, customExecParserMaybe, execParserPure, getParseResult, handleParseResult...
d12frosted/optparse-applicative-kb
Options/Applicative/Extra.hs
bsd-3-clause
6,423
0
19
1,475
1,495
791
704
129
9
module Day2Golf where -- code getKeyPad (s, (x, y)) = s !! y !! x moveKeyPad (s, c@(x, y)) i = (s, (if validCase then c' else c)) where c'@(x', y') = case i of 'U' -> (x, y - 1) 'D' -> (x, y + 1) 'L' -> (x - 1, y) 'R' -> (x + 1, y) validCase = y' >= 0 && y' < length s...
guibou/AdventOfCode2016
src/Day2Golf.hs
bsd-3-clause
927
0
15
347
362
200
162
18
5
{-# LANGUAGE OverloadedStrings, PackageImports #-} module Splice.Site where import Data.Aeson import qualified Data.Text as T import qualified Data.Text.Encoding as T import Data.ByteString.Lazy (toStrict) import Data.Monoid import qualified Data.Map as M import "mtl" Control.Monad.Trans (lift) import Snap.Snaplet.H...
dbp/positionsites
src/Splice/Site.hs
bsd-3-clause
1,025
0
19
193
318
170
148
29
1
{-# LANGUAGE FlexibleContexts #-} module RandomUtil.RandomMatrix ( selectRandomMatrixElement , randomMatrixIndex , randomizeRandomMatrixElement , addGaussianNoiseToMatrixElement , addGaussianNoiseToRandomMatrixElement , randomNMatrixElements , RandomMatrixMutation ) where import System.Random impo...
eklinkhammer/neural-algorithms
src/RandomUtil/RandomMatrix.hs
bsd-3-clause
2,290
0
13
589
718
382
336
46
1
-- © 2001, 2002, 2006 Peter Thiemann -- |Implements coding of non-alphanumeric characters in URLs and CGI-requests. module WASH.Utility.URLCoding (encode, decode) where import Data.Char import WASH.Utility.Hex -- |Perform URI encoding of a list of bytes. See -- <http://www.w3.org/International/O-URL-code.html> -- To...
nh2/WashNGo
WASH/Utility/URLCoding.hs
bsd-3-clause
985
6
11
182
265
141
124
24
2
module Handler.EntryNew where import Import import Handler.EntryEdit (entryForm, formatCategories, updateRelationships) getEntryNewR :: CampaignId -> Handler Html getEntryNewR cid = do Entity uid _ <- requireAuth camp <- runDB $ get404 cid unless (uid == ...
sulami/hGM
Handler/EntryNew.hs
bsd-3-clause
1,231
0
15
340
356
167
189
31
2
{----------------------------------------------------------------------------- reactive-banana-wx Example: Currency Converter ------------------------------------------------------------------------------} {-# LANGUAGE ScopedTypeVariables #-} -- allows "forall t. Moment t" import Data.Maybe import Text.Pr...
logicchains/bao
Main.hs
bsd-3-clause
1,872
0
21
566
436
217
219
-1
-1
module PFE_HTML where import Prelude hiding(putStrLn,writeFile) --import Maybe(fromJust) import Monad(when,unless) --import HsName(ModuleName(Module)) --import ScopeModule(scopeModule) import ConvRefsTypes(simplifyRefsTypes') import HLex2html(hlex2html') import HsLexerPass1(line,column) -- hmm import PFE0(findFile,n...
forste/haReFork
tools/pfe/PFE_HTML.hs
bsd-3-clause
1,728
21
15
269
342
218
124
35
1
{-# LANGUAGE OverloadedStrings, NoMonomorphismRestriction, GADTs, TemplateHaskell #-} module Main where ---------------------------------------------------------- -- Section 0: Imports. -- ---------------------------------------------------------- import Control.Applicative import Co...
dbp/snap-testing
test/Main.hs
bsd-3-clause
4,910
0
16
1,285
1,343
662
681
95
5
module System.LXC ( module System.LXC.Container , module System.LXC.AttachOptions ) where import System.LXC.AttachOptions import System.LXC.Container
konn/lxc-dummy
src/System/LXC.hs
bsd-3-clause
187
0
5
51
34
23
11
4
0
{-# LANGUAGE RankNTypes #-} module Jerimum.Tests.Unit.PostgreSQL.Types.Helpers ( TypeInfoG(..) , ValidDayG(..) , InvalidDayG(..) , ValidTimeG(..) , InvalidTimeG(..) , ValidTzG(..) , InvalidTzG(..) , RangeG(..) , runEncoder , runDecoder ) where import qualified Codec.CBOR.Encoding a...
dgvncsz0f/nws
test/Jerimum/Tests/Unit/PostgreSQL/Types/Helpers.hs
bsd-3-clause
4,716
0
14
1,290
1,566
855
711
147
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Main where import Control.Monad import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as BS import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict ...
futuresystems/ldapget
app/Main.hs
bsd-3-clause
3,820
0
20
1,469
1,032
522
510
116
1
module Haskell99Pointfree.P55 ( ) where data Tree a = Empty | Branch a (Tree a) (Tree a) p55_1 :: Int -> [Tree a] p55_1 =
SvenWille/Haskell99Pointfree
src/Haskell99Pointfree/P55.hs
bsd-3-clause
133
1
9
36
56
32
24
-1
-1
{-# LANGUAGE TupleSections #-} module Haskell99Pointfree.P95 (p95, p95' ) where import Data.List import Data.Char import Data.Bifunctor import Control.Arrow import Data.Bool.HT import Control.Applicative import Control.Monad import Control.Monad.Extra --crashes on negative numbers p95 :: Int -> String p95 = l...
SvenWille/Haskell99Pointfree
src/Haskell99Pointfree/P95.hs
bsd-3-clause
1,816
1
16
404
798
470
328
25
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} import qualified Control.Exception as E import Data.Conduit import Data.Conduit.Network import Network (withSocketsDo) import Options.Applicative import Util opts :: ParserInfo Serv...
tanakh/echo
conduit-server.hs
bsd-3-clause
746
0
17
184
207
109
98
20
1
-- -- UART/DMA.hs --- DMA UART Driver -- -- Copyright (C) 2015, Galois, Inc. -- All Rights Reserved. -- module Ivory.BSP.STM32F427.UART.DMA ( dmaUART1, dmaUART2, dmaUART3, dmaUART4, dmaUART5, dmaUART6, dmaUART7, dmaUART8 ) where import Ivory.BSP.STM32.Peripheral.DMA.Peripheral import Ivory.BSP.STM32.Peripheral.U...
GaloisInc/ivory-tower-stm32
ivory-bsp-stm32/src/Ivory/BSP/STM32F427/UART/DMA.hs
bsd-3-clause
2,668
0
7
562
538
333
205
63
1
import Calypso import Data.Function (on) import Data.List (groupBy) import System.Random (mkStdGen) {- In this example, we'd like to use Calypso to find the minimum of the function f (x,y) = x^2 + y^2. This is a basic overview of Calypso usage. -} f :: (Double, Double) -> Double f (x,y) = x^2 + y^2 {- We see from ...
brianshourd/haskell-Calypso
example1.hs
bsd-3-clause
3,207
0
13
722
438
243
195
22
1
import Codec.Mbox (fromQuoting) import qualified Data.ByteString.Lazy.Char8 as C (getContents,putStr) import Control.Applicative ((<$>)) import System.Environment (getArgs) import System.IO (hPutStrLn,stderr) main :: IO () main = do args <- getArgs case args of ["quot"] -> C.putStr =<< fromQuoting (+1) <$> C...
np/mbox-tools
mbox-quoting.hs
bsd-3-clause
472
0
15
81
165
93
72
12
3
-- Copyright (c) 2014-present, Facebook, Inc. -- All rights reserved. -- -- This source code is distributed under the terms of a BSD license, -- found in the LICENSE file. {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE Ba...
facebook/Haxl
Haxl/Core/Fetch.hs
bsd-3-clause
26,660
28
29
7,074
6,542
3,323
3,219
513
6
-- qq.hs module Math.QQ where -- replacement implementation of rationals -- preferred to Prelude version because improved show functions data QQ = Q Integer Integer deriving Eq -- rationals - Q x y means x/y instance Show QQ where show (Q x y) | y == 1 = show x | otherwise = show x ++ "/" ++ ...
nfjinjing/bench-euler
src/Math/QQ.hs
bsd-3-clause
1,100
0
10
350
566
279
287
28
1
-- #!/usr/bin/env runghc -- (,st') in parse -- {-# LANGUAGE TupleSections #-} -- {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} -- {-# OPTIONS_GHC -cpp -DPiForallInstalled #-} -------------------------------------------------------------------- -- | -- Copyright : (c) A...
reuleaux/pire
tests/ParserTests/Subst.hs
bsd-3-clause
3,157
0
19
829
483
275
208
29
1
{- | Module : ./ExtModal/Print_AS.hs Copyright : DFKI GmbH 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable printing AS_ExtModal ExtModalSign data types -} module ExtModal.Print_AS where import Common.Keywords i...
spechub/Hets
ExtModal/Print_AS.hs
gpl-2.0
5,467
0
22
1,650
1,778
891
887
134
8
-- This Source Code Form is subject to the terms of the Mozilla Public -- License, v. 2.0. If a copy of the MPL was not distributed with this -- file, You can obtain one at http://mozilla.org/MPL/2.0/. {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-...
tel/haskell-maia
maia/src/Maia/Request.hs
mpl-2.0
2,811
0
14
657
1,083
561
522
75
4
<?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="hu-HU"> <title>Online Menu | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref...
msrader/zap-extensions
src/org/zaproxy/zap/extension/onlineMenu/resources/help_hu_HU/helpset_hu_HU.hs
apache-2.0
973
80
66
160
415
210
205
-1
-1
{- Copyright 2014 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
chpatrick/clang-lens
src/Language/C/Clang/Internal/Types.hs
apache-2.0
7,972
0
9
1,536
1,460
917
543
-1
-1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Generating machine code (instruction selection) -- -- (c) The University of Glasgow 1996-2013 -- ----------------------------------------------------------------------------- {-# LANGUAGE GADTs #-} module SPARC.Co...
spacekitteh/smcghc
compiler/nativeGen/SPARC/CodeGen.hs
bsd-3-clause
22,705
0
29
7,573
4,618
2,292
2,326
386
48
{-# LANGUAGE DisambiguateRecordFields #-} module Verify.Graphics.Vty.Picture ( module Verify.Graphics.Vty.Picture , module Graphics.Vty.Picture ) where import Verify.Graphics.Vty.Prelude import Graphics.Vty.Picture import Graphics.Vty.Debug import Verify.Graphics.Vty.Attributes import Verify.Graphics.Vty.Image...
jtdaugherty/vty
test/Verify/Graphics/Vty/Picture.hs
bsd-3-clause
1,426
0
13
382
349
186
163
39
0
{-| Module : Idris.Package.Parser Description : `iPKG` file parser and package description information. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE CPP, ConstraintKinds, FlexibleInstances, TypeSynonymInstances #-} module Idris.Package.Parser where import Idris.AbsSyntaxTree...
markuspf/Idris-dev
src/Idris/Package/Parser.hs
bsd-3-clause
7,781
0
29
2,770
2,205
1,064
1,141
177
3
module Util.ExitCodes where import System.Exit -- The command was used incorrectly, e.g., with -- the wrong number of arguments, a bad flag, a bad -- syntax in a parameter, or whatever. exitCodeUsage = ExitFailure 64 -- EX_DATAERR -- The input data was incorrect in some way. -- This should only be used for user's d...
m-alvarez/jhc
src/Util/ExitCodes.hs
mit
2,757
0
5
503
175
111
64
17
1
module MergeSort ( msortBy ) where infixl 7 :% infixr 6 :& data LenList a = LL {-# UNPACK #-} !Int Bool [a] data LenListAnd a b = {-# UNPACK #-} !(LenList a) :% b data Stack a = End | {-# UNPACK #-} !(LenList a) :& (Stack a) msortBy :: (a -> a -> Ordering) -> [a] -> [a] msortBy cmp = mergeSp...
shlevy/ghc
testsuite/tests/simplCore/should_compile/T14650.hs
bsd-3-clause
2,662
0
22
960
1,367
691
676
64
30
{-# LANGUAGE OverloadedStrings #-} import Control.Concurrent (forkIO, threadDelay) import Control.Monad (forever) import qualified Data.Text.IO as T import qualified Database.Redis as R import System.Periodic main = do rconn <- R.connect R.defaultConnectInfo schedu...
positiondev/periodic
example/Main.hs
isc
702
0
12
173
216
109
107
13
1
{-# LANGUAGE BangPatterns #-} import Data.Array.Unboxed main = putStrLn $ show sumAmicables sumAmicables = sum $ amicables 9999 amicables max = filter (amicable arr max) [1..max] where !arr = sumDivisors max amicable :: UArray Int Int -> Int -> Int -> Bool amicable arr max n = any (amicablePair arr ...
stu-smith/project-euler-haskell
Euler-021.hs
mit
673
0
9
162
323
166
157
14
1
import Data.List isPandigital :: String -> Bool isPandigital s = [1..length s] == (sort $ map (read . return) s) solve :: Integer solve = read $ head $ dropWhile (not . isPandigital) $ map (\x -> show x ++ show (x*2)) nums where nums = [9387,9386..9234] :: [Integer] main :: IO () main = print solve
jwtouron/haskell-play
ProjectEuler/Problem38.hs
mit
305
0
12
62
155
82
73
8
1
-------------------------------------------------------------------------------------------- -- Shamelessly copied and modified from -- -- https://github.com/nnoell/dotfiles/tree/master/v4.4 by nnoell. -- -----------------------------------------...
mixmaster/dotfiles
xmonad/xmonad.symlink/xmonad.hs
mit
45,988
352
26
11,263
11,228
6,335
4,893
-1
-1
-- Integer triangles -- https://www.codewars.com/kata/55db7b239a11ac71d600009d module Codewars.G964.Integertriangles where import qualified Data.Vector as Vector (generate, (!)) import Data.IntMap.Strict (fromAscList, member, (!)) squares = fromAscList . map (\x -> (x*x, x)) $ [1..100000] precomputed = Vector.genera...
gafiatulin/codewars
src/5 kyu/Integertriangles.hs
mit
549
0
18
96
236
134
102
8
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module QPX.API.Response.Slice where import Control.Lens (makeLenses) import Control.Monad (mzero) import Data.Aeson (FromJSON, Value (Object), parseJSON, ...
timbodeit/qpx-api
src/QPX/API/Response/Slice.hs
mit
714
0
9
300
147
87
60
17
0
maximum' :: (Ord a) => [a] -> a maximum' [] = error "maximum of empty list!" maximum' [x] = x maximum' (x:xs) = max x (maximum' xs) replicate' :: (Num c, Ord c) => c -> a -> [a] replicate' n x | n <= 0 = [] | otherwise = x : replicate' (n-1) x take' :: (Num i, Ord i) => i -> [a] -> [a] take' n _ | n ...
v0lkan/learning-haskell
recursion.hs
mit
858
0
11
239
547
286
261
28
1
{-# LANGUAGE OverloadedStrings #-} module Presenters.RecurringTask where import Data.Aeson import qualified Data.Text as T import qualified Models.RecurringTask as M data RecurringTask = RecurringTask { recurringTaskId :: Int , recurringTaskDescription :: T.Text , recurringTaskActive ...
ostapneko/stld2
src/main/Presenters/RecurringTask.hs
mit
1,171
0
9
394
209
119
90
25
1
module Parse ( parse ) where import Tokenize import Object import AST import qualified Data.Map as Map tokenizePrimaryToken :: [Token] -> [Token] tokenizePrimaryToken (ParenthesisBeginToken:ts) = (ParenthesisToken inner):(tokenizePrimaryToken outer) where (inner, outer) = searchPEndToken(ts) tokenizePrimaryToke...
NKMR6194/carrot
src/Parse.hs
mit
4,555
0
15
839
1,689
882
807
90
3
main = putStrLn "Please enter your name " >>= \trash -> getLine >>= \name -> putStrLn ("Hello, " ++ name ++ "!")
teodorlu/haskell-hardt-og-godt
source/io-monad.hs
mit
116
6
12
25
47
24
23
4
1
module Acronym (abbreviate) where import Data.Char (isLetter, isUpper, isLower, toUpper) tokenize :: String -> [String] tokenize [] = [] tokenize xs = token : tokenize rs where xs' = dropWhile (not . isLetter) xs token = takeWhile isLetter xs' rs = drop (length token) xs' toCapital :: String -> String t...
c19/Exercism-Haskell
acronym/src/Acronym.hs
mit
562
0
9
115
222
112
110
15
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, FlexibleInstances #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} module Database.MongoDB.Struc...
maximkulkin/hs-mongodb
Database/MongoDB/Structured/Query.hs
mit
12,059
0
18
2,655
4,328
2,284
2,044
234
9
module Database.Kioku.Internal.KiokuDB where import Control.Exception import qualified Data.ByteString.Char8 as BS import Data.Typeable import System.Directory import System.FilePath import Database.Kioku.Internal.Buffer import Database.Kioku.Internal...
flipstone/kioku
src/Database/Kioku/Internal/KiokuDB.hs
mit
4,149
0
17
892
1,213
627
586
93
2
{-# htermination reads :: String -> [((),String)] #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_reads_2.hs
mit
54
0
2
8
3
2
1
1
0
module Util.Misc ( isPalindromic ) where isPalindromic :: (Show a) => a -> Bool isPalindromic n = show n == (reverse . show) n
james-ralston/project-euler
src/Util/Misc.hs
mit
129
0
8
26
54
29
25
4
1
-- Copyright (c) 2013-2014 Vincent Legout <vincent@legout.info> -- 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, co...
vlegout/draw
main.hs
mit
1,202
0
7
205
41
29
12
4
1
-- father, mother :: Sheep -> Maybe Sheep matGrandf :: Sheep -> Maybe Sheep matGrandf = mother 's_comp' father matGrandm :: Sheep -> Maybe Sheep matGrandm = mother 's_comp' mother patGrandm :: Sheep -> Maybe Sheep patGrandm = father 's_comp' mother motPatGrand :: Sheep -> Maybe Sheep motPatGrand = mother 's_comp' fathe...
iharh/fp-by-example
tex/src/sheep_compose_2.hs
mit
338
0
6
54
99
52
47
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NamedFieldPuns #-} module Network.Wai.Handler.Warp.HTTP2.HPACK where import Control.Arrow (first) import qualified Control.Exception as E import Data.ByteString.Builder (Builder) import qualified Data.ByteString.Char8 as B8 import Data.CaseInsensitive (foldedCase) impor...
iquiw/wai
warp/Network/Wai/Handler/Warp/HTTP2/HPACK.hs
mit
1,890
0
13
281
451
249
202
40
1
{-# LANGUAGE RecordWildCards #-} module TinyMicro.Board.MOS6502 (board) where import TinyMicro.Board import TinyMicro.Video import qualified MOS6502.CPU as MOS6502 import Language.KansasLava import Hardware.KansasLava.Boards.Papilio.Arcade import Hardware.KansasLava.VGA.Driver import Hardware.KansasLava.VGA import Ha...
gergoerdi/tinymicro-mos6502-kansas-lava
lava/TinyMicro/Board/MOS6502.hs
gpl-2.0
1,327
0
12
259
410
229
181
31
1
module Text.Pandoc.Readers.Docx.JapaneseSpec (main, spec) where import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction" $ do it "should work fine" $ do suspend "not yet"
konn/pandoc-japanese-docx
test/Text/Pandoc/Readers/Docx/JapaneseSpec.hs
gpl-2.0
226
0
13
49
76
40
36
9
1
{- | Module : Tct.Encoding.Relative Copyright : (c) Martin Avanzini <martin.avanzini@uibk.ac.at>, Georg Moser <georg.moser@uibk.ac.at>, Andreas Schnabl <andreas.schnabl@uibk.ac.at> License : LGPL (see COPYING) Maintainer : Martin Avanzini <martin.avanzini@uibk.ac.at> St...
mzini/TcT
source/Tct/Encoding/Relative.hs
gpl-3.0
1,774
0
11
392
270
160
110
29
1
module Heqet.Output.FastRender where import Heqet.Output.Render import qualified Heqet.Instruments as Instruments import Heqet.Types import Heqet.Tools import Heqet.Split import Control.Lens {- This module is separate from Output.Render in order to avoid a loop of imports -} writeScore = putStrLn . allRendering qui...
Super-Fluid/heqet
Heqet/Output/FastRender.hs
gpl-3.0
486
0
8
66
113
63
50
-1
-1
module Lamdu.GUI.Expr.LiteralEdit ( make ) where import qualified Control.Lens as Lens import qualified Data.ByteString.Base16 as Hex import Data.ByteString.Lens (chars) import qualified Data.Char as Char import Data.Property (Property(..)) import qualified Data.Property as Property import ...
lamdu/lamdu
src/Lamdu/GUI/Expr/LiteralEdit.hs
gpl-3.0
10,047
0
22
3,171
2,731
1,449
1,282
-1
-1
data NothingType = Nothing
hmemcpy/milewski-ctfp-pdf
src/content/1.6/code/haskell/snippet27.hs
gpl-3.0
26
0
5
3
8
4
4
1
0
module Qzitche.Parse where import Text.ParserCombinators.Parsec import qualified Text.ParserCombinators.Parsec.Token as P import Text.ParserCombinators.Parsec.Language (emptyDef) data SyntaxElement = Identifier String | CharString String | NumberElement Int | ...
stevenremot/fronsduk
src/Qzitche/Parse.hs
gpl-3.0
7,023
0
21
3,311
1,868
978
890
168
2
module Lab2.Util.Primes where prime :: Integer -> Bool prime n = n > 1 && all (\ x -> rem n x /= 0) xs where xs = takeWhile (\ y -> y^2 <= n) primes primes :: [Integer] primes = 2 : filter prime [3..]
vdweegen/UvA-Software_Testing
Lab2/Util/Primes.hs
gpl-3.0
204
0
11
49
107
58
49
6
1
module Ampersand.Prototype.ValidateSQL (validateRulesSQL) where import Ampersand.Basics import Ampersand.ADL1 import Ampersand.Core.ShowAStruct import Ampersand.FSpec import Ampersand.Misc import Ampersand.Prototype.PHP import Data.List import quali...
AmpersandTarski/ampersand
src/Ampersand/Prototype/ValidateSQL.hs
gpl-3.0
5,186
0
16
1,368
1,361
700
661
82
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/ShippingSettings/Getsupportedcarriers.hs
mpl-2.0
5,331
0
17
1,207
722
419
303
108
1
module Text.Diff.Parse (parseDiff) where import Text.Diff.Parse.Internal
mulby/diff-parse
src/Text/Diff/Parse.hs
agpl-3.0
74
0
4
7
19
13
6
2
0
<?xml version='1.0' encoding='ISO-8859-1' ?> <!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="1.0"> <title>JSIMgraph</title> <maps> <homeID>jsimgraph_htm</homeID> <mapref location="JSIMgraph...
HOMlab/QN-ACTR-Release
QN-ACTR Java/help/jMODEL_en/JSIMgraph.hs
lgpl-3.0
979
75
65
145
402
204
198
-1
-1
module Application.DiagramDrawer.Job where import Application.DiagramDrawer.GUI startJob :: IO () startJob = do putStrLn "job started" startGUI
wavewave/diagdrawer
lib/Application/DiagramDrawer/Job.hs
bsd-2-clause
155
0
7
27
37
20
17
6
1
import Parser.Spec as Parser import Surface.Expr.Spec as Expr import Surface.Proof.Spec as Proof import Test.Hspec import Test.Hspec.Core.Runner main :: IO () main = hspecWith config . parallel $ do describe "Expr" Expr.spec describe "Proof" Proof.spec describe "Parser" Parser.spec where config = defaultConfig...
robrix/surface
test/Spec.hs
bsd-3-clause
354
0
9
55
107
59
48
11
1
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -funbox-strict-fields #-} {-| Module : Database.MySQL.Protocol.ColumnDef Description : MySQL field type Copyright : (c) Winterland, 2016 License : BSD Maintainer : drkoster@qq.com Stability : experimental Portability : PORTABLE Column definition(aka. field type). -}...
winterland1989/mysql-haskell
Database/MySQL/Protocol/ColumnDef.hs
bsd-3-clause
7,254
0
19
2,047
1,101
628
473
144
1
module Module4.Task19 where import Data.List.Split (splitOn) import Text.Read (readMaybe) data Error = ParsingError | IncompleteDataError | IncorrectDataError String deriving Show data Person = Person { firstName :: String, lastName :: String, age :: Int } deriving...
dstarcev/stepic-haskell
src/Module4/Task19.hs
bsd-3-clause
1,032
0
14
298
368
195
173
27
4
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses, TupleSections #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.SimplestFloat -- Description : Like "XMonad.Layout.SimpleFloat" but without the decoration. -- Copyright : (c) 2008 Jussi Mäk...
xmonad/xmonad-contrib
XMonad/Layout/SimplestFloat.hs
bsd-3-clause
2,169
0
13
428
405
225
180
27
1
-- | Groups black-box tests of epm and configures them to test -- the correct binary. -- -- This file should do nothing but import tests from other modules and run -- them with the path to the correct epm binary. module Main where -- Modules from Cabal. import Distribution.Simple.Program.Builtin (ghcPkgProgram)...
typelead/epm
epm/tests/PackageTests.hs
bsd-3-clause
3,507
0
13
801
593
334
259
57
1
#define IncludedcastConcat castConcat :: RString -> RString -> RString -> RString -> List Integer -> Proof {-@ castConcat :: tg:RString -> xi:RString -> yi:RString -> zi:RString -> xis:List (GoodIndex xi tg) -> { map (castGoodIndexRight tg xi (yi <+> zi)) xis == map (castGoodIndexRight tg (xi <...
nikivazou/verified_string_matching
src/Proofs/castConcat.hs
bsd-3-clause
770
0
16
190
214
107
107
10
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MonadComprehensions #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANG...
ulricha/dsh-tpc-h
Queries/TPCH/Standard/Q6.hs
bsd-3-clause
1,284
0
12
331
306
162
144
31
1
{-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, DeriveGeneric, TupleSections, RecordWildCards, InstanceSigs, CPP #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} -- | -- Running TH splices -- module GHCi.TH ( startTH , runModFinalizerRefs , runTH , GHCiQException(..) ) where {- Note [Remote Templa...
sdiehl/ghc
libraries/ghci/GHCi/TH.hs
bsd-3-clause
9,222
0
22
1,975
2,150
1,104
1,046
146
5
{-# OPTIONS_GHC -fno-warn-orphans #-} module Reflex.Gloss.Vector ( mv3 , mm3 , rotationMat , identityMat , translationMat , transformPoint , Matrix33, Vector3 , module Data.VectorSpace ) where import Graphics.Gloss.Rendering import Data.VectorSpace type Vector3 = (Float, Float, Float)...
Saulzar/reflex-gloss-scene
src/Reflex/Gloss/Vector.hs
bsd-3-clause
1,731
0
9
557
785
458
327
-1
-1
module Main where import Verify.Data.SpacePart.QuadTree import Verify.Data.SpacePart.AABB import Verify.Data.SpacePart.Edge import Test.QuickCheck main = do quickCheck $ label "parallel_edges_do_not_intersect_prop" parallel_edges_do_not_intersect_prop quickCheck $ label "intersects_is_reflexive_prop" interse...
mfpi/spacepart
test/Verify.hs
bsd-3-clause
721
0
8
80
113
56
57
13
1
----------------------------------------------------------------------------- -- | -- Module : Database.TxtSushi.ParseUtil -- Copyright : (c) Keith Sheppard 2009-2010 -- License : BSD3 -- Maintainer : keithshep@gmail.com -- Stability : experimental -- Portability : portable -- -- Parse utility funct...
keithshep/txt-sushi
Database/TxtSushi/ParseUtil.hs
bsd-3-clause
7,359
0
15
1,834
1,762
874
888
125
3
module Handler.ProjectShowBlob where import Import import Data.Git import Data.Git.Ref import Data.Git.Repository import Data.Git.Storage import Data.Git.Storage.Object import Data.Text as T (unpack) import Data.ByteString.Lazy.Char8 as BL myGetBlobMaybe :: Ref -> Git -> IO (Maybe ObjectInfo) myGetBlobMaybe ref git...
NicolasDP/hitweb
Handler/ProjectShowBlob.hs
bsd-3-clause
1,063
0
20
250
298
152
146
-1
-1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.EXT.TexturePerturbNormal -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : por...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/EXT/TexturePerturbNormal.hs
bsd-3-clause
788
0
4
91
52
42
10
6
0
module Strategy.Score ( -- 候補手グループを取得しすぎないように注意 greedyDiffs, greedyScores, ) where -- score を最大化する候補手 import Control.Arrow (second) import Data.Ord (Down (..)) import Data.List (unfoldr, group) import Data.Set (Set) import qualified Data.Set as Set import qualified Data.Heap as Heap import NormTypes ...
nobsun/icfpc2017
hs/src/Strategy/Score.hs
bsd-3-clause
2,097
0
13
508
537
297
240
42
2