code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
data DT = DT Integer deriving Show newtype NT = NT Integer deriving Show checkDT :: DT -> String checkDT (DT _) = "OK!" checkNT :: NT -> String checkNT (NT _) = "OK!"
YoshikuniJujo/funpaala
samples/26_type_class/newtypeDiff.hs
Haskell
bsd-3-clause
170
{-# LANGUAGE BangPatterns, MultiParamTypeClasses #-} {-# OPTIONS -fno-warn-orphans #-} module Data.Digest.Groestl384 ( groestl384, Groestl384Digest (..), GroestlCtx, Hash(..), hash, hash', printAsHex ) w...
hakoja/SHA3
Data/Digest/Groestl384.hs
Haskell
bsd-3-clause
1,720
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} -- | 'Lucid.HtmlT' inspired monad for creating...
louispan/glazier-react
src/Glazier/React/Markup.hs
Haskell
bsd-3-clause
5,135
{-| Haskelm test suite For the moment, just contains some basic tests This file also serves as an example of how to translate Elm from different sources -} {-# LANGUAGE TemplateHaskell, QuasiQuotes, MultiWayIf #-} import Language.Elm.TH import Data.List (intercalate) import Control.Monad -- | Similarly, we can loa...
JoeyEremondi/haskelm-old
tests/Main.hs
Haskell
bsd-3-clause
622
-- | -- Module: Data.Float.BinString -- License: BSD-style -- Maintainer: me@lelf.lu -- -- -- This module contains functions for formatting and parsing floating point -- values as C99 printf/scanf functions with format string @%a@ do. -- -- The format is [-]0x/h.hhhhh/p±/ddd/, where /h.hhhhh/ is significand ...
llelf/float-binstring
Data/Float/BinString.hs
Haskell
bsd-3-clause
4,694
{-# LANGUAGE CPP, BangPatterns #-} {-#LANGUAGE RankNTypes, OverloadedStrings, ScopedTypeVariables #-} -- | This library emulates "Data.ByteString.Lazy.Char8" but includes a monadic element -- and thus at certain points uses a `Stream`/`FreeT` type in place of lists. -- See the documentation for @Data.ByteString.Str...
michaelt/streaming-bytestring
Data/ByteString/Streaming/Char8.hs
Haskell
bsd-3-clause
25,121
{-# LANGUAGE ScopedTypeVariables #-} -- | Utilities for interleaving transition operators and running Markov chains. module Math.Probably.MCMC ( -- * Strategies module Strategy -- * Interleaving , interleave , polyInterleave , frequency , oneOfRandomly -- * Other , ezMC , trace ) where import...
glutamate/probably-baysig
src/Math/Probably/MCMC.hs
Haskell
bsd-3-clause
2,457
{-# LANGUAGE MultiParamTypeClasses , FlexibleInstances , ViewPatterns , TupleSections #-} module Spire.Canonical.Evaluator (lookupValAndType , lookupType , sub , sub2 , elim , app , app2) where import Unbound.LocallyNameless hiding ( Spine ) import Spire.Canonical.Types im...
spire/spire
src/Spire/Canonical/Evaluator.hs
Haskell
bsd-3-clause
8,446
{-# LANGUAGE FlexibleContexts #-} module OpSem where import AST import Errors import qualified Control.Monad.Except as M import qualified Control.Monad.IO.Class as M -- (Recursion magic happens here) import qualified Data.Functor.Foldable as Rec import qualified Data.Map.Strict as Map import Data.Map.Strict (Map) i...
ClathomasPrime/ImpCore
Impcore/src/OpSem.hs
Haskell
bsd-3-clause
4,185
-- | -- Module : Network.TLS.Types -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- module Network.TLS.Types ( Version(..) , SessionID , SessionData(..) , CipherID , CompressionID , Role(..) , inver...
erikd/hs-tls
core/Network/TLS/Types.hs
Haskell
bsd-3-clause
1,296
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE GADTs #-} module Network.Krist.Transaction where import Data.Aeson import GHC.Generics import Data.Monoid import Control.Krist.Request import Control.Monad import Control.Monad.IO.Class import Syst...
demhydraz/krisths
src/Network/Krist/Transaction.hs
Haskell
bsd-3-clause
4,115
{-# LANGUAGE MagicHash #-} module Main where import GHC.Exts ( Float(F#), eqFloat#, neFloat#, ltFloat#, leFloat#, gtFloat#, geFloat# ) fcmp_eq, fcmp_ne, fcmp_lt, fcmp_le, fcmp_gt, fcmp_ge :: (String, Float -> Float -> Bool) fcmp_eq = ("==", \ (F# a) (F# b) -> a `eqFloat#` b) fcmp_ne = ("/=", \ (F# a)...
kfish/const-math-ghc-plugin
tests/ghc-7.6/arith016.hs
Haskell
bsd-3-clause
982
{- Test Show instances Copyright (c) 2014 Richard Eisenberg -} module Tests.Show where import Data.Metrology import Data.Metrology.Show () import Data.Metrology.SI import Test.Tasty import Test.Tasty.HUnit five :: Double five = 5 tests :: TestTree tests = testGroup "Show" [ testCase "Meter" $ show (five % Met...
goldfirere/units
units-test/Tests/Show.hs
Haskell
bsd-3-clause
649
{-| Module : Idris.Parser Description : Idris' parser. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE ConstraintKinds, FlexibleContexts, GeneralizedNewtypeDeriving, PatternGuards #-} {-# OPTIONS_GHC -O0 #-} module Idris.Parser(module Idris.Parser, ...
Heather/Idris-dev
src/Idris/Parser.hs
Haskell
bsd-3-clause
73,853
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "Network/Sendfile/Types.hs" #-} module Network.Sendfile.Types where -- | -- File range for 'sendfile'. data FileRange = EntireFile | PartOfFile { rangeOffset :: Integer , rangeLength :: Integer }
phischu/fragnix
tests/packages/scotty/Network.Sendfile.Types.hs
Haskell
bsd-3-clause
307
{-# LANGUAGE OverloadedStrings #-} module Rede.SimpleHTTP1Response(exampleHTTP11Response, exampleHTTP20Response, shortResponse) where import qualified Data.ByteString as B -- Just to check what a browser thinks about this port exampleHTTP11Response :: B.ByteString exampleHTTP11Response = "HTTP/1.1 200 OK\r\n\ \C...
alcidesv/ReH
hs-src/Rede/SimpleHTTP1Response.hs
Haskell
bsd-3-clause
9,171
-- | -- Module : Network.SimpleIRC -- Copyright : (c) Dominik Picheta 2010 -- License : BSD3 -- -- Maintainer : morfeusz8@gmail.com -- Stability : Alpha -- Portability : portable -- -- Simple and efficient IRC Library -- module Network.SimpleIRC ( -- * Core module Network.SimpleIRC.Core -- * Messages , m...
edwtjo/SimpleIRC
Network/SimpleIRC.hs
Haskell
bsd-3-clause
430
<?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="ru-RU"> <title>&gt;Запуск приложений | ZAP-расширения </title> <maps> <homeID>top</homeID> ...
thc202/zap-extensions
addOns/invoke/src/main/javahelp/org/zaproxy/zap/extension/invoke/resources/help_ru_RU/helpset_ru_RU.hs
Haskell
apache-2.0
1,042
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- | Create new a new project directory populated with a basic working -- project. module Stack.New ( new ...
Fuuzetsu/stack
src/Stack/New.hs
Haskell
bsd-3-clause
17,703
{-# LANGUAGE PolyKinds, GADTs #-} module T17541b where import Data.Kind data T k :: k -> Type where MkT1 :: T Type Int MkT2 :: T (Type -> Type) Maybe
sdiehl/ghc
testsuite/tests/dependent/should_fail/T17541b.hs
Haskell
bsd-3-clause
161
{-# LANGUAGE UndecidableInstances #-} module LargeNumberTest where import Data.Word import Init share [mkPersist sqlSettings { mpsGeneric = True }, mkMigrate "numberMigrate"] [persistLowerCase| Number intx Int int32 Int32 word32 Word32 int64 Int64 word64 Word64 deriving Show Eq |] cleanDB...
yesodweb/persistent
persistent-test/src/LargeNumberTest.hs
Haskell
mit
1,070
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sq-AL"> <title>Directory List v2.3 LC</title> <maps> <homeID>directorylistv2_3_lc</homeID> ...
kingthorin/zap-extensions
addOns/directorylistv2_3_lc/src/main/javahelp/help_sq_AL/helpset_sq_AL.hs
Haskell
apache-2.0
984
module SubSubPatternIn1 where f :: [Int] -> Int f ((x : (y : ys))) = case ys of ys@[] -> x + y ys@(b_1 : b_2) -> x + y f ((x : (y : ys))) = x + y
kmate/HaRe
old/testing/introCase/SubSubPatternIn1AST.hs
Haskell
bsd-3-clause
179
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings, TupleSections, ViewPatterns #-} import Yesod.Routes.TH import Yesod.Routes.Parse import THHelper import Language.Haskell.TH.Syntax import Criterion.Main import Data.Text (words) import Prelude hiding (words) import Control.DeepSeq import Yesod.Routes.TH.Simp...
ygale/yesod
yesod-core/bench/th.hs
Haskell
mit
1,836
module Helper ( module Test.Hspec , module Control.Applicative , module Test.Mockery.Directory ) where import Test.Hspec import Test.Mockery.Directory import Control.Applicative
sol/reserve
test/Helper.hs
Haskell
mit
211
{-# LANGUAGE CPP #-} module GHCJS.DOM.HTMLMapElement ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.HTMLMapElement #else module Graphics.UI.Gtk.WebKit.DOM.HTMLMapElement #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI))...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/HTMLMapElement.hs
Haskell
mit
455
module Y2016.M07.D27.Solution where import Control.Arrow ((&&&)) import Control.Monad (liftM2) import Data.List (group, sort) import Data.Maybe (fromJust) import Data.Set (Set) import qualified Data.Set as Set import Y2016.M07.D19.Solution (figure2) import Y2016.M07.D20.Solution (FigureC, lineSegments) import Y2016.M...
geophf/1HaskellADay
exercises/HAD/Y2016/M07/D27/Solution.hs
Haskell
mit
3,406
module Control.Foldl.Extended where import Control.Foldl (Fold(..)) import qualified Control.Foldl as L import qualified Data.Map as Map hiding (foldr) -- | turn a regular fold into a Map.Map fold keyFold :: (Ord c) => Fold a b -> Fold (c, a) [(c, b)] keyFold (Fold step begin done) = Fold step' begin' done'...
tonyday567/foldl-extended
src/Control/Foldl/Extended.hs
Haskell
mit
2,620
module Monoid1 where import Data.Semigroup import Test.QuickCheck import SemiGroupAssociativeLaw import MonoidLaws data Trivial = Trivial deriving (Eq, Show) instance Semigroup Trivial where _ <> _ = Trivial instance Monoid Trivial where mempty = Trivial mappend = (<>) instance Arbitrary Trivial ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter15.hsproj/Monoid1.hs
Haskell
mit
595
{-# LANGUAGE OverloadedStrings #-} import Text.HTML.TagSoup import Text.HTML.TagSoup.Match import qualified Data.ByteString as B import qualified Data.ByteString.UTF8 as UB import Data.String.Utils (strip) import Safe import System.IO (stdin) import Control.Applicative main :: IO () main = do content <- r...
sdroege/snippets.hs
html2.hs
Haskell
mit
950
module Core.Annotation where import qualified Data.Generics.Fixplate as Fix import Data.Set (Set) data Annotation typeId = Annotation { freeVars :: Set typeId } deriving (Eq, Ord, Show) type Annotated f id = Fix.Attr (f id) (Annotation id)
fredun/compiler
src/Core/Annotation.hs
Haskell
mit
252
{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} module Monad ( Monad(..) , MonadPlus(..) , (=<<) , (>=>) , (<=<) , forever , join , mfilter , filterM , mapAndUnzipM , zipWithM , zipWithM_ , foldM , foldM_ , replicateM , replicateM_ , concatMapM , g...
ardfard/protolude
src/Monad.hs
Haskell
mit
1,066
{-# htermination delete :: (Eq a, Eq k) => (Either a k) -> [(Either a k)] -> [(Either a k)] #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_delete_11.hs
Haskell
mit
108
{-# LANGUAGE BangPatterns, OverloadedStrings #-} module Network.Wai.Handler.Warp.Buffer ( bufferSize , allocateBuffer , freeBuffer , mallocBS , newBufferPool , withBufferPool , toBlazeBuffer , copy , bufferIO ) where import qualified Data.ByteString as BS import Data.ByteString.Internal (ByteStr...
mfine/wai
warp/Network/Wai/Handler/Warp/Buffer.hs
Haskell
mit
3,222
{-# OPTIONS_GHC -Wall -XFlexibleInstances #-} {- - - Copyright 2014 -- name removed for blind review, all rights reserved! Please push a git request to receive author's name! -- - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You...
DatePaper616/code
eMOD.hs
Haskell
apache-2.0
2,447
unit = ["", "Man","Oku","Cho","Kei","Gai","Jo","Jou","Ko","Kan","Sei","Sai","Gok","Ggs","Asg","Nyt","Fks","Mts"] toStr 0 _ = [] toStr _ [] = [] toStr n (u:us) = let m = n `mod` 10000 n'= n `div` 10000 in if m == 0 then (toStr n' us) else (toStr n' us) ++ show(m) ++ u ans' :: Integer -> Integer...
a143753/AOJ
0287.hs
Haskell
apache-2.0
595
-- Copyright 2020 Google LLC -- -- 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 ...
google/hrepl
hrepl/tests/CLib2.hs
Haskell
apache-2.0
688
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QAbstractSpinBox.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:36 Warning : this file is machine generated -...
keera-studios/hsQt
Qtc/Enums/Gui/QAbstractSpinBox.hs
Haskell
bsd-2-clause
7,971
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE Rank2Types #-} module EFA.Data.Vector where import qualified Data.Vector.Unboxed as UV import qualified Data.Vector as V i...
energyflowanalysis/efa-2.1
src/EFA/Data/Vector.hs
Haskell
bsd-3-clause
20,581
module Auto.Score ( BitString , bitStringToNum , mutateBitString , crossBitString , numToBitString , makeIndividual , makePopulation , flipBitAt ) where import Data.Array import System.Random -- type ScoreType = Double -- class Score a w...
iu-parfunc/AutoObsidian
src/Auto/Score.hs
Haskell
bsd-3-clause
2,161
{-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} -------------...
phaazon/either
src/Control/Monad/Trans/Either.hs
Haskell
bsd-3-clause
9,810
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} -- import Data.Char (isPunctuation, isSpace) -- import Data.List (intercalate) -- import Data.Monoid (mappend) import Data.Text (Text) import qualified Data.Map.Strict as Map import Control.Exception (finally) import Control.Monad (forM_, forever) impo...
triplepointfive/battleship
app/Main.hs
Haskell
bsd-3-clause
5,602
module Day1 where import Data.List (findIndex, inits) -- slower than a foldr (does 2 passes over input), but more readable/declarative floorCount :: String -> Int floorCount input = ups - downs where ups = charCount '(' input downs = charCount ')' input charCount c = length . filter (== c) floorC...
yarbroughw/advent
src/Day1.hs
Haskell
bsd-3-clause
706
{-# LANGUAGE TypeFamilies #-} module Language.Shelspel.Codegen.Bash where import Language.Shelspel.AST import Language.Shelspel.Codegen.Types import Control.Monad codegen :: Program -> String codegen prog = script where bash = flip execState empty $ cgen prog script = foldl (++) "" $ reverse bash ty...
badi/shelspel
src/Language/Shelspel/Codegen/Bash.hs
Haskell
bsd-3-clause
4,704
{-# LANGUAGE OverloadedStrings, ViewPatterns #-} import Control.Exception (catch, SomeException) import Control.Monad import Control.Monad.Trans (liftIO) import qualified Data.ByteString.UTF8 as B import Data.List (isPrefixOf, sortBy) import Data.Maybe import Safe (readMay) import System.Directory import System.Enviro...
sethfowler/pygmalion
tools/Pygmalion.hs
Haskell
bsd-3-clause
13,828
-- Copyright (c) 2012-2013, Christoph Pohl BSD License (see -- http://www.opensource.org/licenses/BSD-3-Clause) ------------------------------------------------------------------------------- -- -- Project Euler Problem 13 -- -- The following iterative sequence is defined for the set of positive -- integers: -- -- n →...
Psirus/euler
src/euler014.hs
Haskell
bsd-3-clause
1,403
{-# LANGUAGE CPP, MagicHash #-} #if __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Unsafe #-} #endif -- | -- Copyright : (c) 2010 Simon Meier -- -- Original serialization code from 'Data.Binary.Builder': -- (c) Lennart Kolmodin, Ross Patterson -- -- License : BSD3-style (see LICENSE) -- -- Ma...
DavidAlphaFox/ghc
libraries/bytestring/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.hs
Haskell
bsd-3-clause
2,954
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell {-@ LIQUID "--no-termination "@-} import Language.Haskell.Liquid.Prelude incr x = (x, [x+1]) chk (x, [y]) = liquidAssertB (x <y) prop = chk $ incr n where n = choose 0 incr2 x = (True, 9, x, 'o', x+1) chk2 (_, _, x, _, y) = liquidAssertB (x <y) prop2 = c...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/pair00.hs
Haskell
bsd-3-clause
471
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} module Plots.API ( -- * D...
bergey/plots
src/Plots/API.hs
Haskell
bsd-3-clause
17,846
module ETA.CodeGen.Env where import ETA.BasicTypes.Id import ETA.StgSyn.StgSyn import ETA.Types.Type import ETA.Types.TyCon import Codec.JVM import ETA.Util import ETA.Debug import ETA.CodeGen.Types import ETA.CodeGen.Closure import ETA.CodeGen.Monad import ETA.CodeGen.Utils import ETA.CodeGen.ArgRep import ETA.Cod...
alexander-at-github/eta
compiler/ETA/CodeGen/Env.hs
Haskell
bsd-3-clause
3,536
module Rho.TrackerComms.PeerResponse where import Data.Monoid import Data.Word (Word32) import Network.Socket (SockAddr) data PeerResponse = PeerResponse { prInterval :: Word32 , prLeechers :: Maybe Word32 , prSeeders :: Maybe Word32 , prPeers :: [SockAddr] } deriving ...
osa1/rho-torrent
src/Rho/TrackerComms/PeerResponse.hs
Haskell
bsd-3-clause
735
-- | -- Module : Conway.Core.Types -- Description : -- Copyright : (c) Jonatan H Sundqvist, 2015 -- License : MIT -- Maintainer : Jonatan H Sundqvist -- Stability : experimental|stable -- Portability : POSIX (not sure) -- -- Created October 25 2015 -- TODO | - Use Foldable, Monoid and Traversable instan...
SwiftsNamesake/Conway
src/Conway/Core/Types.hs
Haskell
bsd-3-clause
1,866
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} -- | This module is intended to be imported @qualified@, for example: -- -- > import qualified Test.Tasty.Laws.Functor as Functor -- module Test.Tasty.Laws.Functor ( testUnit , test , testExhaustive , testSeries , test...
jdnavarro/tasty-laws
Test/Tasty/Laws/Functor.hs
Haskell
bsd-3-clause
4,265
{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} module Main where import Data.List (sort) import qualified Data.StringMap as M import qualified Data.StringMap.Dim2Search as D2 -- ---------------------------------------- -- -- auxiliary functions fo...
alexbiehl/StringMap
tests/Dim2Test.hs
Haskell
mit
7,588
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-| Copyright: Aaron Taylor, 2016 License: MIT Maintainer: aaron@hamsterdam.co Class, instances and transformer for monads capable of HTTP request...
hamsterdam/kawhi
library/Control/Monad/Http.hs
Haskell
mit
2,822
{-# LANGUAGE TupleSections #-} {-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Edward Kmett and Dan Doel 2013 -- License : BSD2 -- Maintainer: Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability: non-portable --...
PipocaQuemada/ermine
src/Ermine/Parser/Pattern.hs
Haskell
bsd-2-clause
2,871
{-# LANGUAGE DeriveDataTypeable #-} module Distribution.Client.Cron ( cron , Signal(..) , ReceivedSignal(..) , rethrowSignalsAsExceptions ) where import Control.Monad (forM_) import Control.Exception (Exception) import Control.Concurrent (myThreadId, threadDelay, throwTo) import System.Random (randomRIO) imp...
haskell-infra/hackage-server
Distribution/Client/Cron.hs
Haskell
bsd-3-clause
2,758
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} -- | Generate HPC (Haskell Program Coverage) reports module Stack.Coverage ( delet...
mathhun/stack
src/Stack/Coverage.hs
Haskell
bsd-3-clause
20,063
{-| Module : Idris.IBC Description : Core representations and code to generate IBC files. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.IBC (loadIBC, loadPkgIndex, writeIBC,...
tpsinnem/Idris-dev
src/Idris/IBC.hs
Haskell
bsd-3-clause
100,046
-- | Build instance tycons for the PData and PDatas type families. -- -- TODO: the PData and PDatas cases are very similar. -- We should be able to factor out the common parts. module Vectorise.Generic.PData ( buildPDataTyCon , buildPDatasTyCon ) where import Vectorise.Monad import Vectorise.Builtins import V...
vTurbine/ghc
compiler/vectorise/Vectorise/Generic/PData.hs
Haskell
bsd-3-clause
6,567
{-# OPTIONS -Wall -fno-warn-missing-signatures -fno-warn-name-shadowing #-} -- | Load the configuration file. module HN.Config (getConfig) where import HN.Types import Data.ConfigFile import Database.PostgreSQL.Simple (ConnectInfo(..)) import qualified Data.Text as T import Network.Mail.Mime import Github.Auth (Git...
lwm/haskellnews
src/HN/Config.hs
Haskell
bsd-3-clause
1,545
{-# LANGUAGE ForeignFunctionInterface #-} module Main where import Foreign.C.Types foreign import ccall "foo" foo :: IO CInt main :: IO () main = foo >>= print
sdiehl/ghc
testsuite/tests/ffi/should_run/T17471.hs
Haskell
bsd-3-clause
163
{-# LANGUAGE EmptyDataDecls #-} module Opaleye.SQLite.PGTypes (module Opaleye.SQLite.PGTypes) where import Opaleye.SQLite.Internal.Column (Column) import qualified Opaleye.SQLite.Internal.Column as C import qualified Opaleye.SQLite.Internal.PGTypes as IPT import qualified Opaleye.SQLite.Internal.HaskellDB....
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/PGTypes.hs
Haskell
bsd-3-clause
4,512
<?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="id-ID"> <title>Kode Dx | ZAP Perpanjangan</title> <maps> <homeID>top</homeID> <mapref l...
kingthorin/zap-extensions
addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_id_ID/helpset_id_ID.hs
Haskell
apache-2.0
966
module CRC32 (crc32_tab, crc32, crc32String) where import Data.Bits import Data.Word import Data.Char -- table and sample code derived from -- http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/libkern/crc32.c -- * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or -- * code or tables extr...
seahug/parconc-examples
crc32/CRC32.hs
Haskell
bsd-3-clause
3,868
----------------------------------------------------------------------------- -- | -- Module : Xmobar.Commands -- Copyright : (c) Andrea Rossato -- License : BSD-style (see LICENSE) -- -- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org> -- Stability : unstable -- Portability : unportable -- -- The 'Ex...
dragosboca/xmobar
src/Commands.hs
Haskell
bsd-3-clause
2,869
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.C.String -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer :...
ryantm/ghc
libraries/base/Foreign/C/String.hs
Haskell
bsd-3-clause
14,693
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Tag a Binary instance with the stack version number to ensure we're -- reading a compatible format. module Data.Binary.VersionTagged ( taggedDecodeOrLoad ,...
Denommus/stack
src/Data/Binary/VersionTagged.hs
Haskell
bsd-3-clause
3,538
{-# OPTIONS_GHC -fplugin LinkerTicklingPlugin #-} module Main where main :: IO () main = return ()
siddhanathan/ghc
testsuite/tests/plugins/plugins06.hs
Haskell
bsd-3-clause
101
{-# LANGUAGE FlexibleContexts #-} module XmlParse where import qualified Data.Char as Char import Data.Conduit.Attoparsec import Data.Text (Text) import qualified Data.Text as Text import qualified Data.XML.Types as XML import Text.Megaparsec import Text.Megaparsec.Prim import Text.Megaparsec.Pos import XmlEvents imp...
scott-fleischman/haskell-xml-infer
src/XmlParse.hs
Haskell
mit
4,024
module Main where import qualified ExpressionProblem1a as EP1a import qualified ExpressionProblem1b as EP1b import qualified ExpressionProblem2a as EP2a import qualified ExpressionProblem2b as EP2b import qualified ExpressionProblem3a as EP3a import qualified ExpressionProblem3b as EP3b -- References -- http://c2.com...
rcook/expression-problem
src/Main.hs
Haskell
mit
2,520
import Data.List (sortBy) import Data.Ord (comparing) collatz :: Integer -> [Integer] collatz n | n == 1 = [1] | n `mod` 2 == 0 = n : collatz (n `div` 2) | otherwise = n : collatz (3 * n + 1) collatzSequences :: Integer -> [[Integer]] collatzSequences n = map...
DylanSp/Project-Euler-in-Haskell
prob14/solution.hs
Haskell
mit
611
module Rubik.Tables.Distances where import Rubik.Cube import Rubik.Solver import Rubik.Tables.Internal import Rubik.Tables.Moves import qualified Data.Vector.Storable.Allocated as S import qualified Data.Vector.HalfByte as HB d_CornerOrien_UDSlice = distanceTable2 "dist_CornerOrien_UDSlice" move18CornerOrien move18...
Lysxia/twentyseven
src/Rubik/Tables/Distances.hs
Haskell
mit
1,328
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ConstraintKinds #-} -- | Warning: This module should be considered highly experimental. module Data.Sequences where import Data.Maybe (fromJust, isJust) import Data.Mono...
pikajude/mono-traversable
src/Data/Sequences.hs
Haskell
mit
44,679
module SecretHandshake (handshake) where handshake :: Int -> [String] handshake n = error "You need to implement this function."
exercism/xhaskell
exercises/practice/secret-handshake/src/SecretHandshake.hs
Haskell
mit
130
module DebugDisplay (toBinaryRepresentation) where import Utilities(testBitAt) import Data.Word(Word8) import Data.Bits(Bits) -- Useful Debug Display Functions toBinaryRepresentation :: Bits a => [a] -> String toBinaryRepresentation [] = [] toBinaryRepresentation (x:xs) = (concat [show $ boolToInt . testBitAt n $ x...
tombusby/haskell-des
debug/DebugDisplay.hs
Haskell
mit
443
module Jbobaf ( module Jbobaf.Jitro, module Jbobaf.Lerfendi, module Jbobaf.Selmaho, module Jbobaf.Valsi, module Jbobaf.Vlatai ) where import Jbobaf.Jitro import Jbobaf.Lerfendi import Jbobaf.Selmaho import Jbobaf.Valsi import Jbobaf.Vlatai
jwodder/jbobaf
haskell/Jbobaf.hs
Haskell
mit
245
{-# LANGUAGE OverloadedStrings #-} import CFDI (UUID(..)) import CFDI.PAC (ppCancelError, cancelCFDI) import CFDI.PAC.Dummy (Dummy(..)) import CFDI.PAC.Fel (Fel(Fel), FelEnv(..)) import CFDI.PAC.ITimbre (ITimbre(ITimbre), ITimbreEnv(..)) import qualified Data.ByteString.Char8 as C8 (putStrLn) import Data.Char (toLower...
yusent/cfdis
cancel_cfdi/main.hs
Haskell
mit
2,827
{-# LANGUAGE RecursiveDo #-} module Types.Parser.Types ( Imperative (..) , VerbPhrase (..) , NounPhrase (..) , PrepPhrase (..) , AdjPhrase (..) , Noun , Verb , Determiner , Preposition , Adjective ) where import Prelude import Data.Text data Imperative = Type1 VerbPhrase NounPhrase ...
mlitchard/cosmos
library/Types/Parser/Types.hs
Haskell
mit
1,136
-- copied from stackoverflow. review later to reenact combinations :: Int -> [a] -> [[a]] combinations k xs = combinations' (length xs) k xs where combinations' n k' l@(y:ys) | k' == 0 = [[]] | k' >= n = [l] | null l = [] | otherwise = map (y :) (combinations' (n - 1) (k' -...
HenningBrandt/Study
Sieve_Method/sieve.hs
Haskell
mit
1,159
module Palindrome where import Utils ((|>)) import Control.Monad import System.Exit (exitSuccess) import Data.Char palindrome :: IO () palindrome = forever $ do line1 <- getLine case (isPalindrome line1) of True -> do putStrLn "It's a palindrome" exitSuccess False -> putStrLn "Not...
andrewMacmurray/haskell-book-solutions
src/ch13/palindrome.hs
Haskell
mit
480
{-# LANGUAGE NoMonomorphismRestriction #-} module Plugins.Gallery.Gallery.Manual52 where import Diagrams.Prelude example = hcat [ square 2 , circle 1 # withEnvelope (square 3 :: D R2) , square 2 , text "hi" <> phantom (circle 2 :: D R2) ]
andrey013/pluginstest
Plugins/Gallery/Gallery/Manual52.hs
Haskell
mit
311
{-# LANGUAGE OverloadedLists #-} module Irg.Lab1.Geometry.Shapes where import qualified Irg.Lab1.Geometry.Vector as V import qualified Data.Vector as V2 import Data.Maybe import Debug.Trace type Number = Float myTrace :: Show a => a -> a myTrace x = if False then traceShowId x else x polygonFill :: Polygon -> [(Do...
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab1/Geometry/Shapes.hs
Haskell
mit
4,980
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Widgets.LoadingSplash ( loadingSplash, loadingSplashD ) where import qualified Reflex.Dom as Dom import Control.Lens ((.~), (&)) import Commons import Widgets.Generation -- | Whe...
achirkin/qua-view
src/Widgets/LoadingSplash.hs
Haskell
mit
5,130
{-# LANGUAGE OverloadedStrings #-} import Control.Monad.Trans.Resource import Data.Conduit (($$)) import Data.Conduit.List (sinkNull) import Data.Map (Map, empty, insert) import Data.Text (Text, unpack) import Text.XML.Stream.Parse import Text.XML (Name, nameLocalName) data Person = Person Int Text deriving Show ...
kberger/xml-streaming
Xml.hs
Haskell
mit
674
module AuthBench (benchAuth, authEnv) where import Criterion.Main import Control.Monad import Control.DeepSeq import Control.Exception import Data.ByteString as BS import Crypto.Saltine.Core.Auth import BenchUtils authEnv :: IO Key authEnv = newKey benchAuth :: Key -> Benchmark benchAuth k = do let authVerify ...
tel/saltine
bench/AuthBench.hs
Haskell
mit
825
module Coins.A265415 (a265415) where import Coins.A260643 (a260643_list) import Data.List (elemIndices) a265415 :: Int -> Int a265415 n = a265415_list !! (n - 1) a265415_list :: [Int] a265415_list = map (+1) $ elemIndices 1 a260643_list
peterokagey/haskellOEIS
src/Coins/A265415.hs
Haskell
apache-2.0
239
<?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="ru-RU"> <title>Highlighter</title> <maps> <homeID>highlighter</homeID> <mapref location...
secdec/zap-extensions
addOns/highlighter/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs
Haskell
apache-2.0
964
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} module Spark.Core.Internal.ColumnStructures where import Control.Arrow ((&&&)) import Data.Function(on) import Data.Vector(Vector) import Spark...
tjhunter/karps
haskell/src/Spark/Core/Internal/ColumnStructures.hs
Haskell
apache-2.0
3,393
module Nanocoin.Network.RPC ( rpcServer ) where import Protolude hiding (get, intercalate, print, putText) import Data.Aeson hiding (json, json') import Data.Text (intercalate) import Web.Scotty import Data.List ((\\)) import qualified Data.Map as Map import Logger import Address import qualified Address import...
tdietert/nanocoin
src/Nanocoin/Network/RPC.hs
Haskell
apache-2.0
2,533
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.APPLE.FloatPixels -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/APPLE/FloatPixels.hs
Haskell
bsd-3-clause
1,012
module Data.Strict.Maybe where data Maybe' a = Just' !a | Nothing' lazy :: Maybe' a -> Maybe a lazy Nothing' = Nothing lazy (Just' a) = Just a {-# INLINABLE lazy #-} strict :: Maybe a -> Maybe' a strict Nothing = Nothing' strict (Just a) = Just' a {-# INLINABLE strict #-} maybe' :: b -> (a -> b) -> Maybe' a -> b ...
effectfully/prefolds
src/Data/Strict/Maybe.hs
Haskell
bsd-3-clause
397
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-} module Lichen.Plagiarism.Render where import Data.Monoid ((<>)) import Text.Blaze.Html5 ((!)) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Clay ((?)) import qualified Clay as C import qualified Clay.Size as C.S import...
Submitty/AnalysisTools
src/Lichen/Plagiarism/Render.hs
Haskell
bsd-3-clause
4,602
{-# LANGUAGE GADTs, KindSignatures, RankNTypes, ScopedTypeVariables, StandaloneDeriving, FlexibleInstances #-} module Binder where import Expr import Transport data Bindee :: * -> * where Temperature :: Bindee StringExpr deriving instance Show (Bindee a) instance Read (Bindee StringExpr) where readsPrec d = re...
ku-fpg/remote-monad-examples
classic-examples/Deep/Binder.hs
Haskell
bsd-3-clause
769
{-# LANGUAGE TemplateHaskell #-} module Dir.Everything(module Data.List.Extra, module Dir.Everything) where import Data.List.Extra import Language.Haskell.TH.Syntax import System.Timeout usedFunction1 = undefined :: (T1 -> T1) -> () usedFunction2 = Other unusedFunction = 12 :: Int (=~=) a b = a == b -- used (==~==) ...
ndmitchell/weeder
test/foo/src/Dir/Everything.hs
Haskell
bsd-3-clause
797
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: Data type for RPM and DPKG package version -- Copyright: (c) 2014 Peter Trsko -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experime...
trskop/pkg-version
src/Data/PkgVersion/Internal/PkgVersion.hs
Haskell
bsd-3-clause
3,367
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} module Language.Rsc.Liquid.Qualifiers (scrapeQuals) where import Data.List (delete, nub) import Data.Maybe (fromMaybe) import Language.Fixpoint.Types hiding (quals) im...
UCSD-PL/RefScript
src/Language/Rsc/Liquid/Qualifiers.hs
Haskell
bsd-3-clause
4,088
module Arbitrary where import Test.QuickCheck import qualified Data.ByteString.Lazy as BS import Frenetic.Common import Control.Monad import Nettle.Arbitrary import Frenetic.NetCore.Types hiding (Switch) import qualified Frenetic.NetCore.Types as NetCore import Frenetic.NetCore.Semantics import Frenetic.Topo arbPort ...
frenetic-lang/netcore-1.0
testsuite/Arbitrary.hs
Haskell
bsd-3-clause
5,323
#!/usr/bin/env runhaskell {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-cse #-} -- This program can crashed by attempting to read an uninitialized 'IORef' with incorrect user input (when he chooses not to input a line after the confirmation) module Main where import Data.IORef import Data.Global import Syste...
bairyn/global
examples/uninitialized/Main.hs
Haskell
bsd-3-clause
815
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts #-} {-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings, TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module KeyFlags (Masked(..), testCode, compatible, Keyboard(..), dec...
konn/hskk
cocoa/KeyFlags.hs
Haskell
bsd-3-clause
3,268