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 Person where
data Person = Person { firstName :: String
, lastName :: String
, age :: Int
, height :: Float
, phoneNumber :: String
, flavor :: String
} deriving (... | fredmorcos/attic | snippets/haskell/Person.hs | isc | 326 | 0 | 8 | 184 | 56 | 36 | 20 | 8 | 0 |
module Cli.Cli (listen, prompt, say) where
listen :: IO String
listen = getLine
prompt :: (Read a) => String -> IO a
prompt s = putStr s >> getLine >>= return . read
say :: String -> IO ()
say x = putStrLn x | korczis/skull-haskell | src/Lib/Cli/Cli.hs | mit | 211 | 0 | 8 | 47 | 99 | 52 | 47 | 7 | 1 |
-- ghci
-- :load C:\Users\Thomas\Documents\GitHub\haskell.practice\PE\Problem0016.hs
-- :r
-- :set +s
module Problem16 where
import Data.Char
twoToThePowerOf n =
2 ^ n
sumOfDigits n =
sum
$ map digitToInt
$ show n
sumOfDigitsForTwoToThePowerOf n =
sumOfDigits
$ twoToThePowerOf n
--Tes... | Sobieck00/practice | pe/nonvisualstudio/haskell/OldWork/Implementation/Problem0016.hs | mit | 965 | 78 | 9 | 219 | 265 | 145 | 120 | 33 | 1 |
module Euler.P002 (sumEvenFib,
sumEvenFib') where
-- Problem 2
--
-- Each new term in the Fibonacci sequence is generated by adding the previous
-- two terms. By starting with 1 and 2, the first 10 terms will be:
--
-- 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
--
-- By considering the terms in the ... | arnau/haskell-euler | src/Euler/P002.hs | mit | 819 | 0 | 8 | 199 | 233 | 130 | 103 | 16 | 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/DOM/Expression.hs | mit | 2,058 | 0 | 6 | 391 | 77 | 50 | 27 | 10 | 0 |
-- Enumerator and iteratee
-- ref: https://wiki.haskell.org/Enumerator_and_iteratee
-- okmij: http://okmij.org/ftp/Haskell/Iteratee/describe.pdf
-- An enumerator is something that knows how to generate a list
-- An iteratee is something that does one step in processing another piece of the big list.
-- foldl (+) 0 x... | Airtnp/Freshman_Simple_Haskell_Lib | Idioms/Enumerator-Iteratee.hs | mit | 5,808 | 0 | 24 | 1,442 | 526 | 273 | 253 | 33 | 3 |
-----------------------------------------------------------------------------
-- |
-- Module : StandardLibrary
-- Copyright : (c) University of Saskatchewan 2013
--
-- Maintainer : [email protected]
--
-- The Frabjous standard library
---------------------------------------------------------------------... | ivendrov/frabjous2 | src/Frabjous/StdLib.hs | mit | 12,883 | 0 | 16 | 3,370 | 2,601 | 1,401 | 1,200 | 162 | 3 |
{-
Package for evaluating Scheme Expressions
-}
module Scheme.Eval (
-- module Scheme.Eval.LispError,
module Scheme.Eval.Prim,
module Scheme.Eval.EvalUtil,
module Scheme.Eval.List,
module Scheme.Eval.Comp,
module Scheme.Eval.Unpack
) where
import Text.ParserCombinators.Parsec hiding (spaces)
import ... | johnellis1392/Haskell-Scheme | Scheme/Eval/Eval.hs | mit | 520 | 0 | 5 | 69 | 99 | 68 | 31 | 14 | 0 |
import Test.HUnit
import System.Exit
import Data.Set.Lazy
tests = TestList [basic, fizzbuzztest, infinity]
---- BASIC -----
basic = TestList [noZero, oneToTen, noEleven]
where
toTenList = [1..10]
toTenSet = fromList toTenList
noZero = TestCase $ assertBool "Zero not in there" $not (member 0 t... | happyherp/lazyset | LazySetTest.hs | mit | 1,490 | 0 | 15 | 430 | 526 | 285 | 241 | 27 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Codex.Config where
import qualified Data.HashMap.Strict as HM
import Snap.Util.FileServe(MimeMap, defaultMimeTypes)
-- | custom mime type mapping
mimeTypes :: MimeMap
mimeTypes
= HM.union defaultMimeTypes $
HM.fromList [(".mdown", "text/markdown"),
... | pbv/codex | src/Codex/Config.hs | mit | 452 | 0 | 8 | 125 | 91 | 58 | 33 | 11 | 1 |
-- |
-- AST traversal extracting output types.
module Hasql.TH.Extraction.OutputTypeList where
import Hasql.TH.Prelude
import PostgresqlSyntax.Ast
foldable :: Foldable f => (a -> Either Text [Typename]) -> f a -> Either Text [Typename]
foldable fn = fmap join . traverse fn . toList
preparableStmt = \case
SelectPre... | nikita-volkov/hasql-th | library/Hasql/TH/Extraction/OutputTypeList.hs | mit | 2,245 | 0 | 11 | 456 | 646 | 307 | 339 | -1 | -1 |
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
-- | Reexports "Text.Read.Lex.Compat"
-- from a globally unique namespace.
module Text.Read.Lex.Compat.Repl.Batteries (
module Text.Read.Lex.Compat
) where
import "this" Text.Read.Lex.Compat
| haskell-compat/base-compat | base-compat-batteries/src/Text/Read/Lex/Compat/Repl/Batteries.hs | mit | 294 | 0 | 5 | 31 | 32 | 25 | 7 | 5 | 0 |
module OneDim where
import Data.Bits
import CellularAutomata2D
import GUI
initSpace1D :: Int -> [a] -> Torus (Maybe a)
initSpace1D steps initialSpace1D = setCells emptySpace (zip fstRow $ map Just initialSpace1D)
where emptySpace = initSpace (steps, length initialSpace1D) (const $ Nothing)
fstRow = zip... | orion-42/cellular-automata-2d | OneDim.hs | mit | 1,448 | 0 | 18 | 333 | 535 | 273 | 262 | 30 | 3 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, RecordWildCards #-}
module Main (main) where
import qualified Prelude.Compat as Prelude
import Prelude.Compat hiding (FilePath, show)
import qualified Buildsome
import Buildsome (Buildsome)
import qualified Buil... | da-x/buildsome | src/Main.hs | gpl-2.0 | 11,298 | 0 | 19 | 2,189 | 2,987 | 1,548 | 1,439 | 246 | 4 |
-- MutationCount Module
-- By G.W. Schwartz
-- Collects all functions pertaining to the counting of mutations called
-- from Main
module MutationCount where
-- Built in
import Data.List
import Data.Char
import Data.Maybe
import qualified Data.Map as M
-- Local
import Types
import Mutation
-- Join together mutation... | GregorySchwartz/count-mutations | src/MutationCount.hs | gpl-2.0 | 2,308 | 0 | 13 | 820 | 476 | 260 | 216 | 51 | 1 |
{-# LANGUAGE ParallelListComp #-}
module Examples.Primitives.Cylinders where
import Primitives.Cylindrical(cylinderSolidNoSlopeSquaredOff, cylinderSolidNoSlope, cylinderWallsNoSlopeSquaredOff,
cylinderSolidNoSlopeLengthenY, cylinderSolidNoSlopeSquaredOffLengthenY, cylinderWallsNoSlop... | heathweiss/Tricad | src/Examples/Primitives/Cylinders.hs | gpl-2.0 | 3,677 | 0 | 14 | 790 | 789 | 444 | 345 | 59 | 1 |
{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving #-}
module React where
import Control.Applicative
import Control.Monad.State
import Control.Monad.Writer hiding (listen)
import Data.IORef
import Data.Unique
import Data.Functor
import qualified Data.IntSet as IS
import qualified Data.Map as M
import qualified Data.Set ... | tathougies/react.hs | src/React.hs | gpl-2.0 | 7,456 | 95 | 13 | 2,541 | 1,508 | 895 | 613 | 130 | 2 |
module ExportBasic(f, Listt((:>)) , Listt2(..), Listt3, listtest, Hello, (/**), mylist) where
f :: Int
f = 2
(/**) :: a -> Int -> Int
_ /** z = 2 * g * z -- 12 * z
where
g = 3 * k -- 6
where
k = 2
infixr 5 /**
data Listt a = a :> (Listt a) | Empt
mylist :: Listt a
mylist = Empt
data Listt2 a =... | Helium4Haskell/helium | test/exports/ExportBasic.hs | gpl-3.0 | 448 | 0 | 8 | 128 | 206 | 123 | 83 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude, FlexibleContexts, RecordWildCards, OverloadedStrings, TypeFamilies #-}
module Lamdu.GUI.ExpressionEdit.HoleEdit.SearchArea
( makeStdWrapped
) where
import Control.Lens.Operators
import qualified Graphics.UI.Bottle.EventMap as E
import qualified Graphics.UI.Bottle.Widge... | da-x/lamdu | Lamdu/GUI/ExpressionEdit/HoleEdit/SearchArea.hs | gpl-3.0 | 2,704 | 0 | 15 | 579 | 502 | 303 | 199 | 44 | 2 |
module Export.Compress where
--------------------------------------------------------------------------------
-- AGGREGATION UTILS
--------------------------------------------------------------------------------
compressOutput :: [(Double, (Int, Int, Int))] -> [(Double, (Int, Int, Int))]
compressOutput = foldr compres... | thalerjonathan/phd | thesis/code/sir/src/Export/Compress.hs | gpl-3.0 | 657 | 0 | 11 | 145 | 225 | 135 | 90 | 10 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Language.Haskell.TH.Utils.Unroll where
import Language.Haskell.TH
import Data.Set (member)
import Language.Haskell.TH.Utils.Defines
import Language.Haskell.TH.Utils.Substitute
import Language.Haskell.TH.Utils.Simplify
-- | Substitute a function application
-- Argument must be ... | satvikc/THUtils | Language/Haskell/TH/Utils/Unroll.hs | gpl-3.0 | 6,916 | 0 | 18 | 2,499 | 2,426 | 1,205 | 1,221 | 111 | 1 |
-----------------------------------------------------------------------------
--
-- Module : Text.Syntax.Math
-- Copyright : John Morrice <[email protected]>
-- License : GPL-3
--
-- Maintainer : John Morrice <[email protected]>
-- Stability :
-- Portability :
--
-- | Provide mathematical and... | elginer/snm_math | Text/Syntax/Math.hs | gpl-3.0 | 3,090 | 0 | 11 | 853 | 983 | 517 | 466 | 104 | 2 |
module CombinerSpec (spec) where
import Data.Function.Extra (never)
import Test.Hspec
import Language.Mulang
import Language.Mulang.Inspector.Smell
import Language.Mulang.Parsers.Haskell
import Language.Mulang.Parsers.JavaScript
spec :: Spec
spec = do
des... | mumuki/mulang | spec/CombinerSpec.hs | gpl-3.0 | 2,744 | 0 | 18 | 940 | 544 | 264 | 280 | 48 | 1 |
{-# Language OverloadedStrings #-}
module Language.UHIM.Japanese.TransformSpec where
import Control.Monad.IO.Class
import Data.Semigroup
import Data.Set (Set)
import qualified Data.Set as S
import Data.String
import qualified Data.Text.ICU.Collate as Col
import Language.UHIM.Japanese.Adjective (JaAdjConjugation(..))
i... | na4zagin3/uhim-dict | test/Language/UHIM/Japanese/TransformSpec.hs | gpl-3.0 | 2,329 | 0 | 16 | 357 | 608 | 333 | 275 | 59 | 2 |
module Header (
withSpecHead,
headerOption,
headerVersion
)
where
import Data.List (isPrefixOf)
import SimpleCmd (removePrefix)
import FileUtils (assertFileNonEmpty)
withSpecHead :: FilePath -> ([String] -> IO a) -> IO a
withSpecHead spec act = do
assertFileNonEmpty spec
readFile spec >>= (ac... | juhp/cabal-rpm | src/Header.hs | gpl-3.0 | 821 | 0 | 10 | 173 | 264 | 143 | 121 | 24 | 2 |
{-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings #-}
module Diagram (renderTable) where
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
import Diagrams.Backend.SVG
import Data.List
import Data.List.Utils (replace)
import Data.List.Split (splitOn)
import Lucid (renderText)
import Data.Text.Lazy (u... | cchens/courseography | hs/Diagram.hs | gpl-3.0 | 1,954 | 34 | 13 | 411 | 760 | 396 | 364 | 50 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Enterprises/SetStoreLayout.hs | mpl-2.0 | 4,460 | 0 | 14 | 923 | 398 | 244 | 154 | 64 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-clouderrorreporting/gen/Network/Google/Resource/CloudErrorReporting/Projects/Events/Report.hs | mpl-2.0 | 6,962 | 0 | 17 | 1,400 | 805 | 480 | 325 | 116 | 1 |
{-# OPTIONS_GHC -Wall -O2 #-}
import System.Console.CmdArgs (cmdArgsRun)
import System.Environment (getArgs, withArgs)
import System.IO
import NGramCrackers.Parsers.Args
main :: IO ()
main = getArgs >>= \args ->
(if null args then withArgs ["--help"] else id) $ cmdArgsRun myModes >>= optionHandler
| R-Morgan/NGramCrackers | src/Main.hs | agpl-3.0 | 312 | 0 | 12 | 52 | 92 | 52 | 40 | 8 | 2 |
module Main where
import Network.Socket hiding (recvFrom)
import Control.Monad
import Codec.Picture
import System.IO (hPutStr, stderr)
import Network.Socket.ByteString
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BL
import Telepulssi
import ImageTools
udpServer :: Integral a => a ->... | HacklabJKL/telepulssi-arduino | tools/UdpServer.hs | agpl-3.0 | 936 | 0 | 14 | 179 | 286 | 146 | 140 | 24 | 3 |
module AST where
import Text.Parsec.Error
import Data.IORef
import Control.Monad.Error
import System.IO
type IOThrowsError = ErrorT LispError IO
type Env = IORef [(String, IORef LispVal)]
data LispError = NumArgs Integer [LispVal]
| TypeMismatch String LispVal
| Parser ParseError
... | kkspeed/SICP-Practise | Interpreter/code/AST.hs | lgpl-3.0 | 1,862 | 0 | 11 | 567 | 584 | 318 | 266 | 48 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Network.Haskoin.Wallet.Server
( runSPVServer
, stopSPVServer
) where
import System.Posix.Daemon (runDetached, Redirection (ToFile), killAndWait)
import System.ZMQ4
( Rep(..), bind, receive, send
, withContext, withSocket
)
import Control.Monad (when, unless, foreve... | tphyahoo/haskoin-wallet | Network/Haskoin/Wallet/Server.hs | unlicense | 15,473 | 0 | 23 | 4,968 | 3,868 | 1,996 | 1,872 | -1 | -1 |
{- |
Description : Truncation of floating-point significands
Copyright : 2017 Andrew Dawson
License : Apache-2.0
Tools for truncating the number of bits in the significand of floating-point
numbers. The numbers can be represented in decimal, binary or hexadecimal.
You can create additional representations by mak... | aopp-pred/fp-truncate | src/Truncate.hs | apache-2.0 | 7,082 | 2 | 10 | 1,632 | 1,486 | 773 | 713 | 107 | 2 |
compress :: Eq a => [a] -> [a]
compress [] = []
compress (x:xs) = compress' x xs
where
compress' x [] = [x]
compress' y (x:xs)
| y == x = compress' x xs
| otherwise = y:(compress' x xs) | alephnil/h99 | 08.hs | apache-2.0 | 232 | 0 | 10 | 87 | 125 | 62 | 63 | 7 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TypeFamilies, TemplateHaskell, OverloadedStrings, InstanceSigs #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Types where
import Control.Applicative ((<$>), pure, (<*>))
import Control.Monad (forM_, mzero)
import Control.Monad.Reader (ask)
import Control.M... | passy/giflib-api | Types.hs | apache-2.0 | 2,657 | 0 | 15 | 548 | 823 | 453 | 370 | 58 | 1 |
module Graphics.GL.Low.Common where
import Graphics.GL
import Graphics.GL.Low.Types
import Graphics.GL.Low.Cube
attachmentPointForImageFormat :: ImageFormat -> GLenum
attachmentPointForImageFormat format = case format of
RGB -> GL_COLOR_ATTACHMENT0
RGBA -> GL_COLOR_ATTACHMENT0
Alpha ... | evanrinehart/lowgl | Graphics/GL/Low/Common.hs | bsd-2-clause | 865 | 0 | 7 | 160 | 141 | 83 | 58 | 21 | 7 |
{-# LANGUAGE TransformListComp #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Backends.Html.Decl
-- Copyright : (c) Simon Marlow 2003-2006,
-- David Waern 2006-2009,
-- Mark Lentczner 2010
-- License : B... | JPMoresmau/haddock | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | bsd-2-clause | 39,178 | 0 | 22 | 10,315 | 11,659 | 5,907 | 5,752 | 612 | 9 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QTcpServer_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:31
Warning : this file is machine generated - do ... | keera-studios/hsQt | Qtc/Network/QTcpServer_h.hs | bsd-2-clause | 24,198 | 0 | 18 | 5,581 | 7,934 | 3,780 | 4,154 | -1 | -1 |
-- | Parser for ECMAScript 3.
{-# LANGUAGE FlexibleContexts #-}
module Language.ECMAScript3.Parser
(parse
, Parser
, expression
, statement
, program
, parseFromString
, parseFromFile
-- old and deprecated
, parseScriptFromString
, parseJavaScriptFromFile
, parseScript
, parseExpression
... | sinelaw/language-ecmascript | src/Language/ECMAScript3/Parser.hs | bsd-3-clause | 29,230 | 578 | 20 | 7,010 | 7,122 | 3,753 | 3,369 | 607 | 4 |
{-|
Module : Idris.Error
Description : Utilities to deal with error reporting.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Idris.Error where
import Prelude hiding (catch)
import Idris.AbsSyntax
im... | enolan/Idris-dev | src/Idris/Error.hs | bsd-3-clause | 6,583 | 0 | 20 | 1,766 | 2,474 | 1,214 | 1,260 | 133 | 6 |
{-# LANGUAGE GeneralizedNewtypeDeriving, TemplateHaskell,
DeriveDataTypeable, PatternGuards,
DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
-- Those extensions are required by the Uniplate instances.
--{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
module Language.LaTeX.Types... | np/hlatex | Language/LaTeX/Types.hs | bsd-3-clause | 18,172 | 0 | 12 | 5,015 | 4,427 | 2,405 | 2,022 | 339 | 1 |
{-# LANGUAGE TypeFamilies, CPP, FlexibleInstances, FlexibleContexts, NamedFieldPuns, RecordWildCards, UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses, UnboxedTuples, StandaloneDeriving, TypeSynonymInstances #-}
{-# OPTIONS -funbox-strict-fields #-}
module Data.TrieMap.Key () where
import Data.TrieMap.Class... | lowasser/TrieMap | Data/TrieMap/Key.hs | bsd-3-clause | 3,563 | 7 | 13 | 674 | 1,528 | 787 | 741 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Cauterize.Common.ParserUtils
( pSexp
, parseBuiltInName
, parseSchemaVersion
, parseFormHash
) where
import Text.Parsec
import Text.Parsec.Text.Lazy
import Cauterize.FormHash
import Cauterize.Lexer
import Control.Monad
import Data.Word
import qualified Data.Text.L... | reiddraper/cauterize | src/Cauterize/Common/ParserUtils.hs | bsd-3-clause | 1,465 | 0 | 12 | 312 | 488 | 262 | 226 | 40 | 1 |
module Euler.E60
( concatInts
, remarkable
, remarkableSet
, addToRemarkableSet
, solve
, s
)
where
import Data.Monoid
import Data.Maybe
import Data.Numbers.Primes
solve :: Int -> Int
solve n = sum $ head $ dropWhile (\xs -> length xs < n) s
s :: [[Int]]
s = [] : concatMap (\p -> mapM... | lslah/euler | src/Euler/E60.hs | bsd-3-clause | 985 | 0 | 13 | 251 | 445 | 230 | 215 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ViewPatterns #-}
-- | Build-specific types.
module Stack.Types.B... | robstewart57/stack | src/Stack/Types/Build.hs | bsd-3-clause | 29,426 | 0 | 21 | 9,239 | 5,598 | 3,063 | 2,535 | 682 | 5 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram
-- Copyright : (c) Sven Panne 2002-2013
-- License : BSD3
--
-- Maintainer : Sven Panne <[email protected]>
-- Stability : stable
-- Portability :... | hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/PixelRectangles/Histogram.hs | bsd-3-clause | 4,803 | 0 | 13 | 667 | 847 | 465 | 382 | 90 | 8 |
-- | Module: Acme.LOLCAT
-- Copyright: (c) 2013 Antonio Nikishaev
-- License: BSD
-- Maintainer: [email protected]
--
-- >>> (OH HAI I CAN HAZ ЙO? THXBYE <*> putStrLn) "LOL" == ()
-- LOL
-- True
{-# LANGUAGE Unsafe #-}
module Acme.LOLCAT.IO (OH(..),HAI(..),I(..),CAN(..),HAZ(..),
I... | llelf/acme-lolcat | Acme/LOLCAT/IO.hs | bsd-3-clause | 711 | 9 | 7 | 194 | 248 | 159 | 89 | 18 | 1 |
module MaybeHero.World
( World
, mkWorld
, moveRoom
, currentRoom
, lookupRoom
, lookupRoomStrict
, rooms
, roomDestinations
, showCurrentInventory
) where
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import qualified Data.List as List
import qualified MaybeHero.Room as Room
import qualified M... | gtrogers/maybe-hero | src/MaybeHero/World.hs | bsd-3-clause | 1,768 | 0 | 11 | 270 | 547 | 292 | 255 | 43 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PolyKinds #-}
{-# OPTIONS_HADDOCK not-home #-}
module Servant.API.QueryParam (QueryFlag, QueryParam, QueryParams) where
import Data.Typeable (Typeable)
import GHC.Typ... | zerobuzz/servant | servant/src/Servant/API/QueryParam.hs | bsd-3-clause | 1,790 | 0 | 5 | 334 | 114 | 89 | 25 | -1 | -1 |
{-# LANGUAGE RecursiveDo #-}
module Main where
import Reflex
import Reflex.Gloss.Scene
import Reflex.Monad.Time
import Reflex.Animation
import Data.Foldable
import Data.Traversable
import Reflex.Monad
import Graphics.Gloss
import Widgets
foldMerge :: MonadReflex t m => a -> [Event t (a -> a)] -> m (Dynamic t a)
... | Saulzar/scribble | src/Scribble3.hs | bsd-3-clause | 2,557 | 0 | 17 | 668 | 1,027 | 516 | 511 | 62 | 1 |
-- | Multipart names.
module Text.MultipartNames.MultipartName(
MultipartName,
mkMultipartName,
mkMultipartNameFromWords,
isLegalSegment,
toSegments
) where
-- import Control.Lens
import Data.CaseInsensitive(CI)
import qualified Data.CaseInsensitive as CI
import Data.Char(isAscii, isLetter)
--... | nedervold/multipart-names | src/Text/MultipartNames/MultipartName.hs | bsd-3-clause | 1,466 | 6 | 9 | 285 | 283 | 154 | 129 | 27 | 2 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.ES3Compatibility
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <[email protected]>
-- Stability : stable
-- Portability : portabl... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/ES3Compatibility.hs | bsd-3-clause | 2,197 | 0 | 4 | 228 | 205 | 135 | 70 | 41 | 1 |
module Language.Xi.Base.Parser where
| fizruk/xi-base | src/Language/Xi/Base/Parser.hs | bsd-3-clause | 37 | 0 | 3 | 3 | 8 | 6 | 2 | 1 | 0 |
module Parser.Internal where
import Control.Applicative
( (<|>)
)
import ASTree
( Number(..)
, Expr(..)
, LatCalError(..)
)
import Text.ParserCombinators.ReadP
( ReadP
, readP_to_S
, optional
, eof
, char
, munch
, (<++)
, chainl1
, string
, between
,... | bus000/latex-calculator | src/Parser/Internal.hs | bsd-3-clause | 3,436 | 0 | 18 | 996 | 1,258 | 635 | 623 | 97 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Main where
import qualified System.Exit as Exit
import qualified TsParse as T
main :: IO ()
main = T.runAllTests >>= \b ->
if b then Exit.exitSuccess else Exit.exitFailure
| massysett/tsparse | test-tsp.hs | bsd-3-clause | 217 | 0 | 8 | 38 | 57 | 36 | 21 | 7 | 2 |
-- | This module re-exports everything from 'Pos.Chain.Block.Logic.*'.
module Pos.Chain.Block.Logic
( module Pos.Chain.Block.Logic.Integrity
) where
import Pos.Chain.Block.Logic.Integrity
| input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Block/Logic.hs | mit | 213 | 0 | 5 | 42 | 28 | 21 | 7 | 3 | 0 |
module Interaction where
import Logic
import Browser
-- | number of sentences
type Window = Int
type
data DB = DB {
retrieve :: Int -> Maybe Conversation,
update :: Int -> Conversation -> DB,
data Browsing = Browsing
{ browser :: Browser
data State = State
{ conversations :: [(Int,Browsing)]
}
data M... | paolino/qrmaniacs | Interaction.hs | mit | 577 | 44 | 6 | 141 | 205 | 126 | 79 | -1 | -1 |
{-
SockeyeSymbolTable.hs: Symbol Table for Sockeye
Part of Sockeye
Copyright (c) 2017, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not find this file, copies can be found by writing to:
ETH Zurich D-INFK, CA... | kishoredbn/barrelfish | tools/sockeye/SockeyeSymbolTable.hs | mit | 4,001 | 0 | 9 | 1,288 | 823 | 487 | 336 | 128 | 0 |
--
--
--
-----------------
-- Exercise 5.17.
-----------------
--
--
--
module E'5'17 where
-- GHCi> [2 .. 2]
-- [2]
-- [n .. n] results in the list [n].
-- GHCi> [2, 7 .. 4]
-- [2]
-- [2, 7 .. 4] results in the list [2].
-- GHCi> [2, 2 .. 2]
-- [2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
-- ,2,2,2,2,2,2,2,2,2,2,2,... | pascal-knodel/haskell-craft | _/links/E'5'17.hs | mit | 509 | 0 | 2 | 92 | 25 | 24 | 1 | 1 | 0 |
module XML.GGXParseOut
( parseCPGraph
, parseCSGraph
, serializeGraph
, XML.GGXParseOut.getLHS
, XML.GGXParseOut.getRHS
, getNacs
, getMappings
) where
import Data.Maybe (fromMaybe, isJust)
import Abstract.Category as FC
import Abstract.Rewriting.DPO
import... | rodrigo-machado/verigraph | src/library/XML/GGXParseOut.hs | gpl-3.0 | 6,318 | 0 | 14 | 1,458 | 2,152 | 1,151 | 1,001 | 104 | 5 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Functor.Indexed
-- Copyright : (C) 2008 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <[email protected]>
-- Stability : experimental
-- Portability : po... | urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav | Control/Functor/Indexed.hs | apache-2.0 | 875 | 4 | 10 | 177 | 217 | 118 | 99 | 15 | 0 |
<?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="it-IT">
<title>Code Dx | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref loc... | veggiespam/zap-extensions | addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_it_IT/helpset_it_IT.hs | apache-2.0 | 969 | 80 | 66 | 160 | 415 | 210 | 205 | -1 | -1 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="tr-TR">
<title>Pasif Tarama Kuralları - Beta | ZAP Uzantıları</title>
<maps>
<homeID>top</h... | veggiespam/zap-extensions | addOns/pscanrulesBeta/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesBeta/resources/help_tr_TR/helpset_tr_TR.hs | apache-2.0 | 1,002 | 80 | 67 | 163 | 434 | 218 | 216 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Text.XmlHtml.TestCommon where
import Control.Exception as E
import System.IO.Unsafe
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test, Node)
-----------------------------------... | 23Skidoo/xmlhtml | test/suite/Text/XmlHtml/TestCommon.hs | bsd-3-clause | 1,466 | 0 | 10 | 328 | 317 | 179 | 138 | 20 | 1 |
--
-- Data vault for metrics
--
--
-- Copyright © 2013-2014 Anchor Systems, Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
-- the 3-clause BSD licence.
--
... | afcowie/vaultaire-common | lib/Vaultaire/Types/ContentsResponse.hs | bsd-3-clause | 3,024 | 0 | 15 | 867 | 605 | 319 | 286 | 54 | 0 |
{- |
Module : $Header$
Description : some utilities for the abstract syntax
Copyright : (c) Christian Maeder and Uni Bremen 2003-2005
License : GPLv2 or higher, see LICENSE.txt
Maintainer : [email protected]
Stability : experimental
Portability : portable
utility functions and computations... | keithodulaigh/Hets | HasCASL/AsUtils.hs | gpl-2.0 | 14,692 | 0 | 20 | 3,689 | 4,675 | 2,415 | 2,260 | 280 | 9 |
module Spielbaum.Wort where
-- this file is copied only (source: /autotool/autobahn/Wort.hs)
-- reason for copying: autotool/util contains another Wort.hs
import Spielbaum.Next
import ToDoc
import Data.List (inits, tails)
import Control.Monad (guard)
data Regel a =
Regel { from :: [a]
, to :: [a]
}
d... | Erdwolf/autotool-bonn | src/Spielbaum/Wort.hs | gpl-2.0 | 966 | 7 | 14 | 260 | 417 | 218 | 199 | -1 | -1 |
module Main where
import Graphics.X11.Turtle
import Data.IORef
import Control.Concurrent
import Control.Monad
import System.Environment
import Text.XML.YJSVG
import Data.Word
main :: IO ()
main = do
[fn, save] <- getArgs
clr <- newIORef 0
bgclr <- newIORef 0
f <- openField
t <- newTurtle f
threadDelay 100000
h... | YoshikuniJujo/wxturtle | tests/draw.hs | bsd-3-clause | 1,723 | 14 | 21 | 430 | 861 | 420 | 441 | 58 | 6 |
{-| Template Haskell code for Haskell to Python constants.
-}
{-
Copyright (C) 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 License, or
(at your option)... | vladimir-ipatov/ganeti | src/Ganeti/Hs2Py/GenConstants.hs | gpl-2.0 | 1,762 | 0 | 16 | 329 | 355 | 183 | 172 | 23 | 2 |
-- %************************************************************************
-- %* *
-- The known-key names for Template Haskell
-- %* *
-- %**********************************... | AlexanderPankiv/ghc | compiler/prelude/THNames.hs | bsd-3-clause | 41,406 | 0 | 8 | 8,724 | 7,533 | 4,373 | 3,160 | 687 | 1 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="ur-PK">
<title>Call Home Add-On</title>
<maps>
<homeID>callhome</homeID>
<mapref locati... | thc202/zap-extensions | addOns/callhome/src/main/javahelp/org/zaproxy/addon/callhome/resources/help_ur_PK/helpset_ur_PK.hs | apache-2.0 | 966 | 77 | 67 | 157 | 413 | 209 | 204 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
--
-- Module : IDE.Command.VCS.GIT
-- Copyright : 2007-2011 Juergen Nicklisch-Franken, Hamish Mackenzie
-- License : GPL Nothing
--
-- Maintainer : [email protected]
-- Stability : pro... | 573/leksah | src/IDE/Command/VCS/GIT.hs | gpl-2.0 | 1,489 | 0 | 8 | 259 | 268 | 167 | 101 | 28 | 1 |
module Foo () where
{-@ measure getfst :: (a, b) -> a
getfst (x, y) = x
@-}
{-@ type Pair a b = {v0 : ({v:a | v = (getfst v0)}, b) | true } @-}
{-@ type OPList a b = [(Pair a b)]<\h -> {v: (a, b) | (getfst v) >= (getfst h)}> @-}
{-@ type OList a = [a]<\h -> {v: a | (v >= h)}> @-}
{-@ getFsts :: O... | ssaavedra/liquidhaskell | tests/pos/PairMeasure.hs | bsd-3-clause | 413 | 0 | 8 | 131 | 52 | 31 | 21 | 3 | 1 |
module Util.Http (
Links(..),
httpGet,
httpGetLink,
httpPost,
httpPostStatus,
httpPut,
httpDelete
) where
import Import.NoFoundation hiding (responseBody, responseStatus, statusCode, checkStatus)
import Data.Text (append)
import qualified Data.ByteString.Lazy as L
import Network.Wreq
import... | vinnymac/glot-www | Util/Http.hs | mit | 2,470 | 0 | 11 | 505 | 835 | 429 | 406 | -1 | -1 |
module OpcodeTypes
( Bytecode(..)
, oneOperandBytecodes
, zeroOperandBytecodes
, twoOperandBytecodes
, varOperandBytecodes
, extBytecodes
, opcodeName
) where
import qualified Story as S
data Bytecode = OP2_1 | OP2_2 | OP2_3 | OP2_4 | OP2_5 | OP2_6 | OP2_7
| OP2_8 | OP2_9 | OP2_10 | OP... | DylanSp/zmachine-interpreter | src/OpcodeTypes.hs | mit | 6,699 | 0 | 10 | 1,890 | 1,677 | 982 | 695 | 177 | 126 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ViewPatterns #-}
module Unison.Codebase.SqliteCodebase
( Unison.Codebase.SqliteCodebase.init,
unsafe... | unisonweb/platform | parser-typechecker/src/Unison/Codebase/SqliteCodebase.hs | mit | 55,182 | 0 | 38 | 16,518 | 14,482 | 7,218 | 7,264 | -1 | -1 |
-- | Commit version.
-- Adapted from Apia.Utils.CommitVersion.hs
-- http://github.com/asr/apia.
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
-- The constructor @versionTagsq (see GHC ticket #2496) is deprecated
-- (at least in GHC 8.0.1). See Issue #83.
{-# OPTIONS_GHC -fno-warn-warnings-... | jonaprieto/athena | src/Athena/Utils/CommitVersion.hs | mit | 1,626 | 0 | 15 | 285 | 339 | 185 | 154 | 27 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Describes Rowling values, i.e., the entities which are produced by
-- evaluating expressions, and passed as i... | thinkpad20/rowling | src/Language/Rowling/Definitions/Values.hs | mit | 8,495 | 0 | 17 | 1,884 | 2,031 | 1,062 | 969 | 151 | 19 |
module FrontEnd.TypeSynonyms (
removeSynonymsFromType,
declsToTypeSynonyms,
TypeSynonyms,
restrictTypeSynonyms,
expandTypeSyns,
showSynonyms,
showSynonym
) where
import Control.Applicative(Applicative)
import Control.Monad.Writer
import Data.Binary
import Data.List
import qualified Data... | m-alvarez/jhc | src/FrontEnd/TypeSynonyms.hs | mit | 6,646 | 1 | 22 | 1,618 | 2,532 | 1,291 | 1,241 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Undecida... | nshepperd/funn | AI/Funn/CL/Batched/Param.hs | mit | 2,439 | 0 | 11 | 567 | 878 | 496 | 382 | 57 | 1 |
import Data.List.Split (splitOn)
import Data.List (sort)
import Prelude hiding (readList)
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.Maybe
import Data.Maybe
part1 input = sum (map (\x -> part1helper $sort x) input)
where
part1helper [a,b,c] = 2*(a*... | jO-Osko/adventofcode2015 | 2015/problems/haskell/day2.hs | mit | 804 | 4 | 13 | 179 | 392 | 193 | 199 | 24 | 1 |
module CSPMTypeChecker.TCDependencies
(Dependencies, dependencies, namesBoundByDecl, namesBoundByDecl',
FreeVars, freeVars, prebindDataType) where
import Data.List (nub, (\\))
import CSPMDataStructures
import CSPMTypeChecker.TCMonad
import Util
-- This method heavily affects the DataType clause of typeCheckDecl.... | tomgr/tyger | src/CSPMTypeChecker/TCDependencies.hs | mit | 7,419 | 76 | 16 | 1,488 | 2,827 | 1,357 | 1,470 | 202 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module Errors
( AppError (..)
, authenticationRequired
, raiseAppError
, resourceNotFound
, serverError
, badRequest
) where
import Control.Monad.Except
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
imp... | gust/feature-creature | marketing-site/app/Errors.hs | mit | 1,337 | 0 | 7 | 238 | 294 | 172 | 122 | 34 | 1 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Db.Transaction
( Transaction'(Transaction)
, NewTransaction
, Transaction... | benkolera/talk-stacking-your-monads | code-classy/src/Db/Transaction.hs | mit | 3,165 | 1 | 11 | 635 | 745 | 410 | 335 | 90 | 1 |
module Y2016.M12.D20.Exercise where
-- below import available from 1HaskellADay git repository
import Data.SymbolTable
import Data.SymbolTable.Compiler
import Data.SAIPE.USStates
{--
So, yesterday, as you see from the import above, we enumerated the US States!
YAY! *throws confetti
NOW! Using the same data-set, s... | geophf/1HaskellADay | exercises/HAD/Y2016/M12/D20/Exercise.hs | mit | 1,493 | 0 | 8 | 237 | 84 | 51 | 33 | 9 | 1 |
f x = if x < 10
then x
else x*2
| Bolt64/my_code | haskell/hello_haskell.hs | mit | 49 | 1 | 6 | 28 | 28 | 13 | 15 | 3 | 2 |
revList :: [a] -> [a]
revList [] = []
revList (h:t) = revList t ++ [h]
dropList :: Int -> [a] -> [a]
dropList 0 list = list
dropList _ [] = []
dropList n (h:t) = dropList (n-1) t
fizzbuzz :: Int -> String
fizzbuzz a
| a `mod` 15 == 0 = "FizzBuzz"
| a `mod` 3 == 0 = "Fizz"
| a `mod` 5 == 0 = "Buzz"
| ... | anujjamwal/learning | Haskell/first.hs | mit | 2,734 | 13 | 12 | 725 | 1,601 | 823 | 778 | 72 | 4 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE... | TransportEngineering/nice-html | src/Text/Html/Nice/Internal.hs | mit | 12,438 | 297 | 17 | 3,367 | 3,795 | 2,054 | 1,741 | 341 | 14 |
{-
Game of Life Core - provides the basic funtions used in the SDL version
Copyright (C) 2012 Josh Chase
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 3 of the License, or... | Pursuit92/GameOfLife | src/GameOfLife.hs | gpl-3.0 | 3,498 | 0 | 13 | 786 | 1,170 | 637 | 533 | 48 | 2 |
import Control.Monad as M
import Control.Monad.Trans.Resource
import Data.Array.Repa as R
import Data.Conduit
import Data.Conduit.List as CL
import Data.List as L
import Data.Maybe ... | XinhuaZhang/PetaVisionHaskell | Application/Amoeba/PlotRecon.hs | gpl-3.0 | 1,422 | 0 | 29 | 633 | 374 | 198 | 176 | 36 | 2 |
module Lab6 where
import Control.Monad
import Lecture6
import Data.List
import Data.Bits
import Control.Exception
import Data.Time
import System.Random
import Formatting
import Formatting.Clock
import System.Clock
import Control.Monad
-- Define Main --
main = do
putStrLn "===================="
putStrLn "Assign... | vdweegen/UvA-Software_Testing | Lab6/Jordan/Exercises.hs | gpl-3.0 | 6,993 | 1 | 16 | 1,456 | 1,742 | 856 | 886 | 149 | 3 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
module Types where
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Logger (runNoLoggingT, NoLoggingT)
import Control.Monad.Trans.Resource (runResourceT, ResourceT)
import Database.Persist.S... | Southern-Exposure-Seed-Exchange/Order-Manager-Prototypes | spock/src/Types.hs | gpl-3.0 | 987 | 2 | 10 | 234 | 274 | 160 | 114 | 18 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
module RollMyOwnLiterals where
import Language.Haskell.TH
data Nat = Z | S Nat
nat :: Integer -> Q Type
nat 0 = [t|Z|]
nat n = [t|S $(nat (n-1))|]
| ntc2/haskell-call-trace | experiments/composition/RollMyOwnLiterals.hs | mpl-2.0 | 211 | 0 | 6 | 40 | 60 | 38 | 22 | 8 | 1 |
module Main where
main :: IO ()
main = mapM_ putStrLn c_yes
c_yes :: [String]
c_yes = repeat "y"
{-
main2 :: IO ()
main2 = do putStrLn "y"
main2
-}
| tyoko-dev/coreutils-haskell | src/Yes.hs | agpl-3.0 | 162 | 0 | 6 | 45 | 41 | 23 | 18 | 5 | 1 |
{-# LANGUAGE RankNTypes #-}
foo :: (forall a. a -> a) -> Char
foo f = f 'c'
type IdFunc = forall a. a -> a
someInt :: IdFunc -> Integer
someInt id' = id' 1
main = print "hello world"
----
-- runST :: forall s,a. ST s a -> a
-- newVar :: a -> ST s (MutVar s a)
-- readVar :: MutVar s a -> ST s a
-- writeVar :: M... | seckcoder/lang-learn | haskell/samples/src/RankN.hs | unlicense | 744 | 4 | 9 | 194 | 238 | 128 | 110 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module BarthPar.Data where
import Conduit
import Control.Error
import Control.Lens
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.L... | erochest/barth-scrape | src/BarthPar/Data.hs | apache-2.0 | 1,497 | 0 | 13 | 443 | 402 | 207 | 195 | 38 | 1 |
module Palindromes.A249642Spec (main, spec) where
import Test.Hspec
import Palindromes.A249642 (a249642)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A249642" $
it "correctly computes the first 10 elements" $
take 10 (map a249642 [0..]) `shouldBe` expectedValue where
expectedValue = [0,0,... | peterokagey/haskellOEIS | test/Palindromes/A249642Spec.hs | apache-2.0 | 371 | 0 | 10 | 59 | 130 | 75 | 55 | 10 | 1 |
{-|
Module : Text.ABNF.Document
Description : Documents according to an ABNF definition
Copyright : (c) Martin Zeller, 2016
License : BSD2
Maintainer : Martin Zeller <[email protected]>
Stability : experimental
Portability : non-portable
-}
module Text.ABNF.Document
(
-- * Document types
... | Xandaros/abnf | src/Text/ABNF/Document.hs | bsd-2-clause | 1,662 | 0 | 6 | 603 | 112 | 80 | 32 | 20 | 0 |
module Main where
import Criterion
import Criterion.Main
main :: IO ()
main = defaultMain
[ env (return ()) $
\ ~() -> bgroup "\"oops\"" [bench "dummy" $ nf id ()]
, env (return ()) $
\ ~() -> bgroup "'oops'" [bench "dummy" $ nf id ()]
]
| bos/criterion | examples/Quotes.hs | bsd-2-clause | 266 | 0 | 13 | 75 | 126 | 63 | 63 | 9 | 1 |
module Database.Narc.Rewrite where
import Data.Maybe (fromMaybe)
import Database.Narc.AST
import Database.Narc.Type
import Database.Narc.Util (alistmap)
-- | In @perhaps f x@, use @f@ to transform @x@, unless it declines by
-- returning @Nothing@, in which case return @x@ unchanged.
perhaps :: (a -> Maybe a) -> a ->... | ezrakilty/narc | Database/Narc/Rewrite.hs | bsd-2-clause | 2,786 | 0 | 14 | 743 | 1,620 | 877 | 743 | 50 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.