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 |
|---|---|---|---|---|---|
import Image
| YoshikuniJujo/markdown2svg | tests/testImage.hs | Haskell | bsd-3-clause | 13 |
module Opaleye.Internal.Order where
import qualified Opaleye.Column as C
import qualified Opaleye.Internal.Tag as T
import qualified Opaleye.Internal.PrimQuery as PQ
import qualified Database.HaskellDB.PrimQuery as HPQ
import qualified Data.Functor.Contravariant as C
import qualified Data.Profunctor as P
import quali... | k0001/haskell-opaleye | Opaleye/Internal/Order.hs | Haskell | bsd-3-clause | 1,611 |
module Test6
where
import qualified Data.HashMap.Strict as H
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.List
import Debug.Trace
import System.IO
isAlpha ch = ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')
wrds :: T.Text -> [ T.Text ]
wrds bs =
let
(_, r1) = T.span (n... | erantapaa/test-spelling | src/Test6.hs | Haskell | bsd-3-clause | 942 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
module Development.Shake.Install.RequestResponse where
import Development.Shake as Shake
import Control.App... | alphaHeavy/shake-install | Development/Shake/Install/RequestResponse.hs | Haskell | bsd-3-clause | 1,597 |
{-# LANGUAGE Arrows #-}
import Hatter
import Hatter.Types
import Hatter.Wires
import Control.Wire as Wire hiding (id)
import Control.Arrow
import Control.Applicative
import FRP.Netwire hiding (id)
import Prelude hiding ((.), null, filter)
import Data.Map as Map hiding (foldl)
import Linear hiding (trace)
import Debug.T... | shivanshuag/Hatter | examples/square_using_wires.hs | Haskell | bsd-3-clause | 1,899 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
------------------------------------------------------------------------------
import Control.Exception (SomeException, try)
import qualified Data.Text as T
import Site
import Snap.Core
import... | HaskellCNOrg/snaplet-oauth | example/src/Main.hs | Haskell | bsd-3-clause | 4,565 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE Typ... | Coggroach/Gluon | src/MongoDbConnector.hs | Haskell | bsd-3-clause | 1,299 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
-- | <http://www.libtorrent.org/reference-Core.html#peer-info peer_info> structure for "Libtorrent"
module Network.Libtorrent.PeerInfo (PeerFlag... | eryx67/haskell-libtorrent | src/Network/Libtorrent/PeerInfo.hs | Haskell | bsd-3-clause | 26,211 |
{-# LANGUAGE UndecidableInstances,
FlexibleInstances,
FlexibleContexts,
TypeFamilies,
ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Numeric.Signal.Multichannel
-- Copyright : (c) Alexand... | amcphail/hsignal | lib/Numeric/Signal/Multichannel.hs | Haskell | bsd-3-clause | 15,032 |
-- Implements a simple language embedded in the reactive resumption
-- monad, ReactT. First useful application example of resumptions.
{-# OPTIONS -fglasgow-exts -fno-monomorphism-restriction #-}
import InterpreterLib.Algebras
import InterpreterLib.Functors
import InterpreterLib.Terms.ArithTerm
import InterpreterLib.... | palexand/interpreters | AbstractInterp/Sample5.hs | Haskell | bsd-3-clause | 9,519 |
module StringCompressorKata.Day6 (compress) where
import Data.Char (intToDigit)
compress :: Maybe String -> Maybe String
compress Nothing = Nothing
compress (Just "") = Just ""
compress (Just (c:str)) = Just $ compress' 1 c str
where
compress' :: Int -> Char -> String -> String... | Alex-Diez/haskell-tdd-kata | old-katas/src/StringCompressorKata/Day6.hs | Haskell | bsd-3-clause | 674 |
module Language.Haskell.TH.SCCs
(binding_group, binding_groups,
scc, sccs,
Dependencies(..), type_dependencies, td_recur, td_descend,
Named(..),
printQ
) where
import Language.Haskell.TH.Syntax
import qualified Data.Set as Set; import Data.Set (Set)
import qualified Data.Map as Map
import qualified Da... | nfrisby/th-sccs | Language/Haskell/TH/SCCs.hs | Haskell | bsd-3-clause | 5,645 |
module Paths_Todo (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a) -> I... | frankhucek/Todo | .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Paths_Todo.hs | Haskell | bsd-3-clause | 1,566 |
module PPTest.Grammars.Lexical (specs) where
import PP
import PP.Grammars.Lexical
import Test.Hspec
specs = describe "PPTest.Grammars.Lexical" $ do
it "should parse a regular expression (any)" $
case parseAst "." :: To RegExpr of
Left e -> show e `shouldBe` "not an error"
... | chlablak/platinum-parsing | test/PPTest/Grammars/Lexical.hs | Haskell | bsd-3-clause | 2,584 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Main
( main
) where
-------------------------------------------------------------------------------
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON (..), defaultOptions,
... | bermanjosh/bloodhound | examples/Tweet.hs | Haskell | bsd-3-clause | 4,281 |
module Bot.Util where
import Paths_5chbot
import qualified Data.Version as V
eitherToMaybe :: Either a b -> Maybe b
eitherToMaybe (Left _) = Nothing
eitherToMaybe (Right a) = Just a
showVersion :: String
showVersion = "5chbot ver. " ++ V.showVersion version
| hithroc/5chbot | src/Bot/Util.hs | Haskell | bsd-3-clause | 262 |
module Scurry.Console (
consoleThread
) where
import Control.Concurrent.STM.TChan
import Control.Monad (forever)
import Data.List
import System.IO
import System.Exit
import qualified GHC.Conc as GC
import Scurry.Console.Parser
import Scurry.Comm.Message
import Scurry.Comm.Util
import Scurry.Types.Network
import S... | dmagyar/scurry | src/Scurry/Console.hs | Haskell | bsd-3-clause | 1,459 |
{- | Utilities for dealing with the location of parsed entities in their source files.
-}
{-# LANGUAGE OverloadedStrings #-}
module Base.Location
( Location(..)
, Position(..)
) where
import Data.Monoid
import Data.Text.Prettyprint.Doc (Pretty (..))
-- | Position within a text file.
data Po... | Verites/verigraph | src/library/Base/Location.hs | Haskell | apache-2.0 | 789 |
<?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="zh-CN">
<title>Bug Tracker</title>
<maps>
<homeID>top</homeID>
<mapref location="map.j... | veggiespam/zap-extensions | addOns/bugtracker/src/main/javahelp/org/zaproxy/zap/extension/bugtracker/resources/help_zh_CN/helpset_zh_CN.hs | Haskell | apache-2.0 | 957 |
<?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="pt-BR">
<title>Getting started Guide</title>
<maps>
<homeID>top</homeID>
<mapref locat... | brunoqc/zap-extensions | src/org/zaproxy/zap/extension/gettingStarted/resources/help_pt_BR/helpset_pt_BR.hs | Haskell | apache-2.0 | 970 |
{-|
Module : Servant.Server.Auth.Token.SingleUse
Description : Specific functions to work with single usage codes.
Copyright : (c) Anton Gushcha, 2016
License : MIT
Maintainer : ncrashed@gmail.com
Stability : experimental
Portability : Portable
-}
module Servant.Server.Auth.Token.SingleUse(
makeSingle... | VyacheslavHashov/servant-auth-token | src/Servant/Server/Auth/Token/SingleUse.hs | Haskell | bsd-3-clause | 2,483 |
{-# LANGUAGE TypeFamilies, TypeOperators, DataKinds #-}
module Tests.Compile.Readme where
import Data.Metrology.Poly hiding (LCSU)
data LengthDim = LengthDim -- each dimension is a datatype that acts as its own proxy
instance Dimension LengthDim
data TimeDim = TimeDim
instance Dimension TimeDim... | goldfirere/units | units-test/Tests/Compile/Readme.hs | Haskell | bsd-3-clause | 3,352 |
-- | Basic data flow analysis over the Haste AST.
module Haste.AST.FlowAnalysis (
Strict (..), VarInfo (..), InfoMap, ArgMap,
mkVarInfo, nullInfo, mergeVarInfos, findVarInfos
) where
import Haste.AST.Syntax
import Control.Monad.State
import Data.List (foldl', sort, group)
import qualified Data.Set as S
import... | kranich/haste-compiler | src/Haste/AST/FlowAnalysis.hs | Haskell | bsd-3-clause | 6,515 |
{-# LANGUAGE BangPatterns, DeriveFunctor, RecordWildCards #-}
module Network.Wreq.Cache.Store
(
Store
, empty
, insert
, delete
, lookup
, fromList
, toList
) where
import Data.Hashable (Hashable)
import Data.Int (Int64)
import Data.List (foldl')
import Prelude hiding (lookup, ma... | bitemyapp/wreq | Network/Wreq/Cache/Store.hs | Haskell | bsd-3-clause | 2,108 |
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="bs-BA">
<title>Directory List v2.3 LC</title>
<maps>
<homeID>directorylistv2_3_lc</homeID>
... | kingthorin/zap-extensions | addOns/directorylistv2_3_lc/src/main/javahelp/help_bs_BA/helpset_bs_BA.hs | Haskell | apache-2.0 | 984 |
module A4 where
data T a = C1 a
over :: (T b) -> b
over (C1 x) = x
under :: (T a) -> a
under (C1 x) = x
| SAdams601/HaRe | old/testing/addCon/A4.hs | Haskell | bsd-3-clause | 109 |
{-| Module describing an NIC.
The NIC data type only holds data about a NIC, but does not provide any
logic.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following c... | apyrgio/snf-ganeti | src/Ganeti/HTools/Nic.hs | Haskell | bsd-2-clause | 3,420 |
{-# LANGUAGE BangPatterns, OverloadedStrings #-}
import Control.DeepSeq
import Control.Exception
import Control.Monad
import Data.Aeson
import Data.Aeson.Parser
import Data.Attoparsec
import Data.Time.Clock
import System.Environment (getArgs)
import System.IO
import qualified Data.ByteString as B
main = do
(cnt:arg... | jprider63/aeson-ios-0.8.0.2 | benchmarks/ReadFile.hs | Haskell | bsd-3-clause | 821 |
{-# LANGUAGE BangPatterns, Rank2Types, OverloadedStrings,
RecordWildCards, MagicHash, UnboxedTuples #-}
module Data.Attoparsec.Internal.Fhthagn
(
inlinePerformIO
) where
import GHC.Base (realWorld#)
import GHC.IO (IO(IO))
-- | Just like unsafePerformIO, but we inline it. Big performance gains as
--... | DavidAlphaFox/ghc | utils/haddock/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/Internal/Fhthagn.hs | Haskell | bsd-3-clause | 636 |
module Main where
import System.IO
import DynFlags
import GHC
import Exception
import Module
import FastString
import MonadUtils
import Outputable
import Bag (filterBag,isEmptyBag)
import System.Directory (removeFile)
import System.Environment( getArgs )
import PrelNames
main :: IO()
main
= do [libdir] <- getArgs
... | urbanslug/ghc | testsuite/tests/ghc-api/T8628.hs | Haskell | bsd-3-clause | 1,039 |
{-# LANGUAGE OverloadedStrings #-}
module Jamo where
import Prelude hiding (readFile, putStrLn, lookup, writeFile)
import Data.List (intersect, (\\))
import Data.Map (fromList, lookup)
import Data.Attoparsec.Text (takeWhile1, takeTill, inClass, char, parseOnly, choice, many', endOfInput)
import Data.Text (Text, cons, ... | xnuk/another-aheui-interpreter | template/Jamo.hs | Haskell | mit | 2,569 |
-----------------------------------------------------------------------------
--
-- Module : Network.Google
-- Copyright : (c) 2012-13 Brian W Bush
-- License : MIT
--
-- Maintainer : Brian W Bush <b.w.bush@acm.org>
-- Stability : Stable
-- Portability : Portable
--
-- | Helper functions for accessi... | rrnewton/hgdata_trash | src/Network/Google.hs | Haskell | mit | 7,085 |
module TeX.Alias
( Alias(AliasIfTrue, AliasIfFalse)
, AliasMap(), emptyAliasMap, aliasLens
)
where
import qualified Data.Map as M
import TeX.StateUtils
import TeX.Token
data Alias = AliasIfTrue | AliasIfFalse
deriving (Eq, Show)
newtype AliasMap = AliasMap (M.Map Token Alias)
deriving (Show)
emptyAliasMap :: A... | xymostech/tex-parser | src/TeX/Alias.hs | Haskell | mit | 510 |
------------------------------------------------------------------------------
-- | Defines the 'Charset' accept header with an 'Accept' instance for use in
-- encoding negotiation.
module Network.HTTP.Media.Charset
( Charset ) where
import Network.HTTP.Media.Charset.Internal
| zmthy/http-media | src/Network/HTTP/Media/Charset.hs | Haskell | mit | 292 |
module Sprinkler where
import Control.Monad (when)
import Control.Monad.Bayes.Class
hard :: MonadBayes m => m Bool
hard = do
rain <- bernoulli 0.3
sprinkler <- bernoulli $ if rain then 0.1 else 0.4
wet <- bernoulli $ case (rain,sprinkler) of (True,True) -> 0.98
(Tr... | ocramz/monad-bayes | models/Sprinkler.hs | Haskell | mit | 699 |
module CLI
( Options(..)
, Command(..)
, SolveOptions(..)
, GenerateOptions(..)
, parseOpts
) where
import Options.Applicative
data Options = Options
{ cmd :: Command
, useAscii :: Bool
}
data Command
= Solve SolveOptions
| Generate GenerateOptions
data SolveOptions = SolveOptions
{ puzzleFi... | patrickherrmann/sudoku | src/CLI.hs | Haskell | mit | 1,764 |
{-# LANGUAGE OverloadedStrings #-}
module GhostLang.LinkerTests
( -- Pre link semantic tests.
checkEmptyModule
, checkOneNonMainModule
, checkMainModuleWithoutPatterns
, checkOtherModuleWithPatterns
, checkDuplicateMainModules
, checkSingleCorrectMainModule
, checkTwoCorrectModules
... | kosmoskatten/ghost-lang | ghost-lang/test/GhostLang/LinkerTests.hs | Haskell | mit | 12,556 |
{-# LANGUAGE ForeignFunctionInterface #-}
-- |
-- Module : Crypto.Hash.BLAKE
-- Copyright : (c) Austin Seipp 2013
-- License : MIT
--
-- Maintainer : aseipp@pobox.com
-- Stability : experimental
-- Portability : portable
--
-- BLAKE-256 and BLAKE-512 hashes. The underlying implementation uses
-- the @ref@... | thoughtpolice/hs-blake | src/Crypto/Hash/BLAKE.hs | Haskell | mit | 1,817 |
module Main where
main :: IO ()
main = do
input <- getLine
print input
-- getWrappingPaperSurfaceArea ::
type Len = Integer
data Box = Box Len Len Len
data Side = Side Len Len
getSides :: Box -> [Side]
getSides (Box l w h) = [ Side l w
, Side w h
, Side l h ]
cla... | spicydonuts/adventofcode-2015 | 2/Main.hs | Haskell | mit | 634 |
module Coins.A265415Spec (main, spec) where
import Test.Hspec
import Coins.A265415 (a265415)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A265415" $
it "correctly computes the first 10 elements" $
take 10 (map a265415 [1..]) `shouldBe` expectedValue where
expectedValue = [1,10,21,31,37,10... | peterokagey/haskellOEIS | test/Coins/A265415Spec.hs | Haskell | apache-2.0 | 339 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
module Worker where
import Control.Concurrent (threadDelay)
import Control.Applicative
import Control.Monad
import Control.Monad.Trans.Except
import Control.Distributed.Process
import Control.Distributed.Process.Clos... | SKA-ScienceDataProcessor/RC | MS1/distributed-dot-product/Worker.hs | Haskell | apache-2.0 | 2,242 |
{-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Handler.Root where
import Model.Accessor
import Foundation
import Control.Applicative
import Data.Text (Text, pack, unpack)
import Text.Blaze
import qualified Data.Text as T
-- This is a handler funct... | masaedw/Yiki | Handler/Root.hs | Haskell | bsd-2-clause | 6,292 |
module P011 where
import Arrays
run :: IO ()
run = print . maximum . map product $ groups
where
groups = concatMap (($ grid) . ($ 4)) [verticalWindow, horizontalWindow, forwardDiagWindow, backwardDiagWindow]
grid :: [[Integer]]
grid = [[08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91... | tyehle/euler-haskell | src/P011.hs | Haskell | bsd-3-clause | 2,018 |
module GameData.Animation where
import qualified Data.List as L
import Gamgine.Math.Vect as V
data Animation = Animation {
currentPosition :: V.Vect,
currentVelocity :: V.Vect,
velocity :: Double,
path :: [V.Vect],
bidirectional :: Bool,
movingToPathIdx :: Int,
finished ... | dan-t/layers | src/GameData/Animation.hs | Haskell | bsd-3-clause | 2,114 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-------------------... | futufeld/eclogues | eclogues-impl/gen-hs/AuroraSchedulerManager_Client.hs | Haskell | bsd-3-clause | 13,610 |
module Main where
import Lib
main :: IO ()
main = tokenizerMain
| NogikuchiKBYS/hsit-sandbox | app/Tokenizer.hs | Haskell | bsd-3-clause | 67 |
{-# LANGUAGE TypeOperators, ScopedTypeVariables #-}
-- |
-- Module : Data.Array.Accelerate.Prelude
-- Copyright : [2010..2011] Manuel M T Chakravarty, Gabriele Keller, Ben Lever
-- [2009..2012] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell
-- License : BSD3
--
-- Maintainer : Man... | robeverest/accelerate | Data/Array/Accelerate/Prelude.hs | Haskell | bsd-3-clause | 26,223 |
module Onedrive.Session (Session, newSessionWithToken, newSessionWithRenewableToken, getAccessToken, tryRenewToken) where
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TVar (TVar, newTVar, readTVar, writeTVar)
import Data.Text (Text)
data Session
= SessionWithToken Text
| SessionWithR... | asvyazin/hs-onedrive | src/Onedrive/Session.hs | Haskell | bsd-3-clause | 1,214 |
-- Enter your code here. Read input from STDIN. Print output to STDOUT
is_function :: [(Int, Int)] -> Bool
is_function pairs = no_dups (map fst pairs)
no_dups :: Eq a => [a] -> Bool
no_dups [] = True
no_dups (x:xs) = (not (x `elem` xs)) && (no_dups xs)
swap f = \y -> \x -> f x y
for = swap map
list2pair :: [a] ... | capn-freako/Haskell_Misc | HackerRank/function_test.hs | Haskell | bsd-3-clause | 715 |
{-# LANGUAGE OverloadedStrings #-}
module Seeds (users) where
import Data.Time
import UserService.Types
user1 = User "burt" "bobby" email theirAddress "218-222-5555" theirDob
where
email = "derp@gmail.com"
theirDob = fromGregorian 2012 1 1
theirAddress = Address "Sttreet" "LA" "CA" "#1" "90210"
user2 =... | tippenein/user_clone | src/Seeds.hs | Haskell | bsd-3-clause | 565 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, CApiFFI #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.IO
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maint... | sdiehl/ghc | libraries/base/System/IO.hs | Haskell | bsd-3-clause | 22,275 |
-- A little benchmark adapted from attoparsec
module Main where
import Control.Monad
-- import qualified Data.ByteString.Lazy as L
import System.Environment
import Data.IterIO
import Data.IterIO.Parse
iterio :: IO ()
iterio = do
args <- getArgs
forM_ args $ \arg -> do
result <- enumFile' arg |$ p
... | scslab/iterIO | tests/bench.hs | Haskell | bsd-3-clause | 595 |
-----------------------------------------------------------------------------
-- TIMain: Type Inference Algorithm
--
-- Part of `Typing Haskell in Haskell', version of November 23, 2000
-- Copyright (c) Mark P Jones and the Oregon Graduate Institute
-- of Science and Technology, 1999-2000
--
-- This program is distrib... | yu-i9/thih | src/Thih/TI/TIMain.hs | Haskell | bsd-3-clause | 9,988 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module Diff2Html where
import Data.Foldable
import Data.Monoid
import qualified Data.Text as T
import qualified Data.Algorithm.Patience as P
import Lucid
import Chunk
import Diff
import Utils (breakWith)
chunksToTable :: [Chunk] -> Html ()
chunksT... | bgamari/diff-utils | src/Diff2Html.hs | Haskell | bsd-3-clause | 2,790 |
module GalFld.GalFld
( module X
, factorP
, extendFFBy
) where
import GalFld.Core as X
import GalFld.Algorithmen as X
-- |Nimmt einen Grad `d` und ein Element `e` eines Endlichen Körpers und bildet
-- über den Endlichen Körper, dass das Element enthält eine Erweiterun von Grad
-- `d`.
-- Das übergebene Eleme... | maximilianhuber/softwareProjekt | src/GalFld/GalFld.hs | Haskell | bsd-3-clause | 838 |
-- |
-- Module : $Header$
-- Copyright : (c) 2013-2014 Galois, Inc.
-- License : BSD3
-- Maintainer : cryptol@galois.com
-- Stability : provisional
-- Portability : portable
{-# LANGUAGE Safe #-}
{-# LANGUAGE PatternGuards #-}
module Cryptol.Eval (
moduleEnv
, EvalEnv()
, emptyEnv
, eval... | dylanmc/cryptol | src/Cryptol/Eval.hs | Haskell | bsd-3-clause | 6,625 |
module Reporting.Annotation where
import Prelude hiding (map)
import qualified Reporting.Region as R
import qualified Data.String as String
-- ANNOTATION
data Located a =
A R.Region a
deriving (Eq)
instance (Show a) => Show (Located a) where
showsPrec p (A r a) = showParen (p > 10) $
showStrin... | rgrempel/frelm.org | vendor/elm-format/parser/src/Reporting/Annotation.hs | Haskell | mit | 1,260 |
{-# LANGUAGE StandaloneDeriving #-}
module TreeDB(
DirList,
dlEmpty, dlByExt, dlByExts, dlAdd, dlAddByExt,
TreeDB,
tdbEmpty, tdbByDir, tdbAdd, tdbAddDir,
tdbBuild, tdbMerge,
tdbByDirExt, tdbByDirExts
)
where
import qualified Data.ByteString.Char8 as C
import Data.List
import Data.Trie(Tr... | kishoredbn/barrelfish | hake/TreeDB.hs | Haskell | mit | 3,589 |
-- | This module provide a totally partial and incomplete maping
-- of Exif values. Used for Tiff parsing and reused for Exif extraction.
module Codec.Picture.Metadata.Exif ( ExifTag( .. )
, ExifData( .. )
, tagOfWord16
... | clinty/Juicy.Pixels | src/Codec/Picture/Metadata/Exif.hs | Haskell | bsd-3-clause | 5,379 |
module CmmMachOp
( MachOp(..)
, pprMachOp, isCommutableMachOp, isAssociativeMachOp
, isComparisonMachOp, machOpResultType
, machOpArgReps, maybeInvertComparison
-- MachOp builders
, mo_wordAdd, mo_wordSub, mo_wordEq, mo_wordNe,mo_wordMul, mo_wordSQuot
, mo_wordSRem, mo_wordSNeg, mo_wordUQu... | mcmaniac/ghc | compiler/cmm/CmmMachOp.hs | Haskell | bsd-3-clause | 14,455 |
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Module: Trace.Hpc.Coveralls
-- Copyright: (c) 2014-2015 Guillaume Nargeot
-- License: BSD3
-- Maintainer: Guillaume Nargeot <guillaume+hackage@nargeot.com>
-- Stability: experimental
--
-- Functions for converting and sending hpc output to coveralls.io.
module ... | jdnavarro/hpc-coveralls | src/Trace/Hpc/Coveralls.hs | Haskell | bsd-3-clause | 7,216 |
main = putStrLn "hello"
foo x = y + 3
y = 7
| ankhers/haskell-ide-engine | test/testdata/HaReDemote.hs | Haskell | bsd-3-clause | 47 |
{-# LANGUAGE TypeFamilies, EmptyDataDecls, GADTs #-}
module T4484 where
import Data.Kind (Type)
type family F f :: Type
data Id c = Id
type instance F (Id c) = c
data C :: Type -> Type where
C :: f -> C (W (F f))
data W :: Type -> Type
fails :: C a -> C a
fails (C _)
= -- We know (W (F f) ~ a)
C Id -- W... | sdiehl/ghc | testsuite/tests/indexed-types/should_compile/T4484.hs | Haskell | bsd-3-clause | 714 |
-- | Comment on the first declaration
main = return ()
| sdiehl/ghc | testsuite/tests/haddock/should_compile_flag_haddock/T17561.hs | Haskell | bsd-3-clause | 55 |
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module T5886a where
import Language.Haskell.TH
class C α where
type AT α ∷ ★
bang ∷ DecsQ
bang = return [InstanceD Nothing [] (AppT (ConT ''C) (ConT ''Int))
[TySynInstD ''AT (TySynEqn [ConT ''Int] (ConT '... | olsner/ghc | testsuite/tests/th/T5886a.hs | Haskell | bsd-3-clause | 337 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Time.LocalTime
import Data.Time.Clock
import Data.Maybe
import Control.Monad
import System.Environment
import qualified Data.Configurator as CFG
import Data.Configurator.Types
import Format
import System.Console.Terminfo.PrettyPrint
import Data.Time.Calendar
import Data.T... | dagle/hs-xmltv | src/Tv.hs | Haskell | mit | 3,493 |
module Data.Vector.Generic.Lifted (
unsafeFreeze
, read
, write
, new
, freeze
, replicate
, mapM
, thaw
, forM
) where
import Prelude hiding (mapM, read, replicate)
import Control.Monad.Trans (MonadTrans, lift)
import Data.Vector.Generic (Mutable, Vector)
import qualified D... | NicolasT/reedsolomon | src/Data/Vector/Generic/Lifted.hs | Haskell | mit | 1,742 |
-- |
-- Module: Math.NumberTheory.ArithmeticFunctions.NFreedom
-- Copyright: (c) 2018 Alexandre Rodrigues Baldé
-- Licence: MIT
-- Maintainer: Alexandre Rodrigues Baldé <alexandrer_b@outlook.com>
--
-- N-free number generation.
--
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
m... | Bodigrim/arithmoi | Math/NumberTheory/ArithmeticFunctions/NFreedom.hs | Haskell | mit | 5,954 |
{-# LANGUAGE OverloadedStrings #-}
module Database.Selda.SQL.Print.Config (PPConfig (..), defPPConfig) where
import Data.Text (Text)
import qualified Data.Text as T
import Database.Selda.SqlType
import Database.Selda.Table
-- | Backend-specific configuration for the SQL pretty-printer.
data PPConfig = PPConfig
{ -- ... | valderman/selda | selda/src/Database/Selda/SQL/Print/Config.hs | Haskell | mit | 3,457 |
module Main where
import Control.Monad
import Data.IORef
import Data.Tuple.HT
import FRP.Yampa
import Graphics
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
import System.Exit
import Types
import Simulation
-- Entry point.
main :: IO ()
main = do
newInput <- newIORef NoEvent
oldTime <- newIORef (0 :: ... | fatuhoku/haskell-yampa-bouncing-ball | src/Main.hs | Haskell | mit | 1,480 |
import System.Random
main = do
gen <- getStdGen
putStr $ take 20 (randomRs ('a', 'z') gen)
| UoBCS/haskell-diary | monads/random/random_string.hs | Haskell | mit | 102 |
module Feature.User.PG where
import ClassyPrelude
import Feature.User.Types
import Feature.Auth.Types
import Platform.PG
import Database.PostgreSQL.Simple
-- * UserRepo
findUserByAuth :: PG r m => Auth -> m (Maybe (UserId, User))
findUserByAuth (Auth email pass) = do
results <- withConn $ \conn -> query conn qry (... | eckyputrady/haskell-scotty-realworld-example-app | src/Feature/User/PG.hs | Haskell | mit | 3,969 |
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import qualified Control.Foldl as Fold
import Data.List (genericLength)
import Data.Maybe (catMaybes)
import Data.Text (unpack)
import System.Exit (exitFailure, exitSuccess)
import Te... | tylerjl/adventofcode | test/Haddock.hs | Haskell | mit | 1,020 |
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
{-# LANGUAGE UnicodeSyntax #-}
-- From: Herbert P. Sander. A logic of functional programs with an
-- application to concurrency. PhD thesis, Chalmers University of
-- Technology and University of Gothenburg, Department of Computer
-- Sciences, 1992. pp. 12-13.
module... | asr/fotc | notes/Berry/Berry.hs | Haskell | mit | 905 |
{-# LANGUAGE BangPatterns
, FlexibleContexts
, TypeFamilies
, MultiParamTypeClasses
, FunctionalDependencies
, TypeSynonymInstances
, FlexibleInstances #-}
module RobotVision.ImageRep.Utility
( fromChannels
, toChannels
, getNotBoundaryPoint... | eklinkhammer/haskell-vision | RobotVision/ImageRep/Utility.hs | Haskell | mit | 2,685 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Models where
... | erlandsona/caldwell-api | library/Models.hs | Haskell | mit | 1,186 |
module HelperSequences.A112798 (a112798, a112798_row) where
import HelperSequences.A027746 (a027746_row)
import Data.Maybe (fromJust)
import Data.List (elemIndex)
import HelperSequences.A000040 (a000040_list)
a112798 :: Int -> Int
a112798 n = a112798_tabl !! (n - 2)
a112798_tabl :: [Int]
a112798_tabl = concatMap a11... | peterokagey/haskellOEIS | src/HelperSequences/A112798.hs | Haskell | apache-2.0 | 482 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
-- | Data types for the K3 effect system
module Language.K3.Analysis.SEffects.Core where
import Control.DeepSeq
import GHC.Generics (Generic)
import Data.Binary
import Data.Serialize
i... | DaMSL/K3 | src/Language/K3/Analysis/SEffects/Core.hs | Haskell | apache-2.0 | 5,420 |
-- parse nested parens into a tree structure
-- Exercise 1 from chapter 8 of Basics of Haskell
-- https://www.schoolofhaskell.com/school/starting-with-haskell/basics-of-haskell/8_Parser
data Token = TokLParen | TokRParen | TokEnd
deriving (Show, Eq)
lookAhead :: String -> Token
lookAhead [] = TokEnd
lookAhead (c... | cbare/Etudes | haskell/parse_parens.hs | Haskell | apache-2.0 | 1,526 |
import Control.Parallel.Strategies
power5 x = x * x * x * x * x
digitSumPower5 n = sum $ map power5 $ map (\x -> read [x] :: Int) $ show n
isSameAsDigitSumPower5 n = (n == digitSumPower5 n)
main = do
let base = [2..10000000]
let filtered = filter isSameAsDigitSumPower5 base
let cs = filtered `using` par... | ulikoehler/ProjectEuler | Euler30.hs | Haskell | apache-2.0 | 355 |
{-# LANGUAGE TemplateHaskell #-}
module DBusTests.TH where
import DBus.Generation
import DBusTests.Generation
generateClient defaultGenerationParams testIntrospectionInterface
generateSignalsFromInterface defaultGenerationParams testIntrospectionInterface
| rblaze/haskell-dbus | tests/DBusTests/TH.hs | Haskell | apache-2.0 | 259 |
-- | Specific configuration for Joey Hess's sites. Probably not useful to
-- others except as an example.
{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module Propellor.Property.SiteSpecific.JoeySites where
import Propellor.Base
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.Fil... | ArchiveTeam/glowing-computing-machine | src/Propellor/Property/SiteSpecific/JoeySites.hs | Haskell | bsd-2-clause | 36,052 |
module BookCalendar where
import Data.Time
import Data.Time.Calendar.WeekDate
currentWordCount :: Integer
currentWordCount = 14700
wordsPerDay :: Integer
wordsPerDay = 333
isWeekend :: Day -> Bool
isWeekend d =
let (_,_,dow) = toWeekDate d
in dow > 5
addToDay :: UTCTime -> Integer -> Day
addToDay today days = ... | steveshogren/haskell-katas | src/BookCalendar.hs | Haskell | bsd-3-clause | 1,058 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
The @TyCon@ datatype
-}
{-# LANGUAGE CPP, FlexibleInstances #-}
module TyCon(
-- * Main TyCon data types
TyCon, AlgTyConRhs(..), visibleDataCons,
AlgTyConFlav(..), isNoParent,
FamTyConFlav... | vTurbine/ghc | compiler/types/TyCon.hs | Haskell | bsd-3-clause | 89,529 |
{-# LANGUAGE TypeOperators #-}
module Main where
import Control.Applicative ((<*>))
import Data.OI hiding (openFile)
import System.IO (IOMode (..), Handle)
import qualified System.IO as IO
import Prelude hiding (readFile, writeFile)
main :: IO ()
main = runInteraction pmain
pmain :: (([String],Either ((Handle, Strin... | nobsun/oi | sample/cats2.hs | Haskell | bsd-3-clause | 1,078 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans
-fno-warn-incomplete-patterns
-fno-warn-deprecations
-fno-warn-unused-binds #-} --FIXME
module UnitTests.Distribution.Version (versionTests) where
import Distribution.Version
import Distribution.Text
import Text.Pre... | sopvop/cabal | Cabal/tests/UnitTests/Distribution/Version.hs | Haskell | bsd-3-clause | 26,798 |
{-# LANGUAGE QuasiQuotes #-}
-- | Simple C runtime representation.
module Futhark.CodeGen.Backends.SimpleRepresentation
( sameRepresentation
, tupleField
, tupleFieldExp
, funName
, defaultMemBlockType
, builtInFunctionDefs
, intTypeToCType
, floatTypeToCType
, primTypeToCType
-- * Primitive valu... | CulpaBS/wbBach | src/Futhark/CodeGen/Backends/SimpleRepresentation.hs | Haskell | bsd-3-clause | 11,377 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Geometry where
import GHC.Generics
import Data.Aeson
data Point = Point1D {xp :: Double}
| Point2D {xp :: Double, yp :: Double}
| Point3D {xp :: Double, yp :: Double, zp :: Double}
deriving (Eq, Ord, Show, Gen... | adrienhaxaire/funfem | Geometry.hs | Haskell | bsd-3-clause | 925 |
import Test.Framework (defaultMain)
import qualified Database.Sqroll.Pure.Tests
import qualified Database.Sqroll.Sqlite3.Tests
import qualified Database.Sqroll.Table.Naming.Tests
import qualified Database.Sqroll.TH.Tests
import qualified Database.Sqroll.Json.Tests
import qualified Database.Sqroll.Tests
import qualifie... | pacak/sqroll | tests/TestSuite.hs | Haskell | bsd-3-clause | 674 |
{-# LANGUAGE OverloadedStrings #-}
-- | RequestTests runs as a standalone executable so that developers can change
-- TestConfig to whatever settings they want.
module Main where
import Blaze.ByteString.Builder
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import qualified Data.ByteSt... | anchor/haskell-opensrs | tests/RequestTests.hs | Haskell | bsd-3-clause | 13,098 |
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module ChartSpec where
import Test.Hspec
import Graphics.HSD3.Chart
import Graphics.HSD3.Theme
import Utils
spec :: Spec
spec = describe "Chart" $ do
d... | Soostone/hs-d3 | test/suite/ChartSpec.hs | Haskell | bsd-3-clause | 5,451 |
module PrefStringUtil where
import Data.List
import Data.List.Split
import Data.Char (isSpace)
import Data.Maybe
-- | This is a quick and dirty "Trim whitespace from both sides" function", that is taken straight outta
-- <http://stackoverflow.com/questions/6270324/in-haskell-how-do-you-trim-whitespace-from-the-beginn... | peterkmurphy/preference | src/PrefStringUtil.hs | Haskell | bsd-3-clause | 1,809 |
{-|
Module : Database.Relational.Update
Description : Definition of UPDATE and friends.
Copyright : (c) Alexander Vieth, 2015
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE AutoDeriveTypeable #-}
module Database.Relational.Upd... | avieth/Relational | Database/Relational/Update.hs | Haskell | bsd-3-clause | 423 |
module Language.TNT.Token
( Token (..)
) where
import Prelude hiding (Bool (..))
data Token = Name String
| Operator String
| Number Double
| String String
| Char Char
| Import
| As
| Var
| Fun
| If
... | sonyandy/tnt | Language/TNT/Token.hs | Haskell | bsd-3-clause | 984 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module : Game.GoreAndAsh.Resources.Module
Description : Monad transformer and instance for core module
Copyright : (c) Anton Gushcha, 2016
License : BSD3
Maintainer : ncrashed@gmail.com
Stability : experimental
Portability : POSIX
-}
module Game.GoreAndAsh.Resourc... | Teaspot-Studio/gore-and-ash-resources | src/Game/GoreAndAsh/Resources/Module.hs | Haskell | bsd-3-clause | 1,734 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ViewPatterns #-}
-----------------------------------------------------------------------------
-- |
-- This module rexposes wrapped parsers from the GHC API. Along with
-- returning the parse result, the corresponding annotations are also
-- returned such that it is then easy to modify... | mpickering/ghc-exactprint | src/Language/Haskell/GHC/ExactPrint/Parsers.hs | Haskell | bsd-3-clause | 9,633 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-|
Module : Network.Linode
License : BSD3
Stability : experimental
This package contains some helpers to create and configure <https://www.linode.com/ Linode> instances. They all require an API key, which can be created on the Linod... | Helkafen/haskell-linode | src/Network/Linode.hs | Haskell | bsd-3-clause | 15,875 |
-- | Special retrieval queries to build 'ClockTable's using 'HeadingFilter's.
--
-- 'ClockTable' is not a type saved directly in the database, it's a combination
-- type used for presenting org-mode data.
-- Should work similarly to
-- <http://orgmode.org/manual/The-clock-table.html The clock table in emacs>.
--
-- = U... | rzetterberg/orgmode-sql | lib/Database/OrgMode/Export/ClockTable.hs | Haskell | bsd-3-clause | 5,556 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
#if defined(__GL... | phaazon/linear | src/Linear/Affine.hs | Haskell | bsd-3-clause | 7,173 |
module Physics.Falling.Collision.Detection.GJK
(
distanceToOrigin
, distance
, algorithmGJK
, closestPoints
, initialSimplexResult
, SimplexResult
)
where
import Physics.Falling.Math.Error
import Physics.Falling.Math.Transform hiding(distance)
import Physics.Falling.Math.AnnotatedVector
import Physics.Falling.Shape.Im... | sebcrozet/falling | Physics/Falling/Collision/Detection/GJK.hs | Haskell | bsd-3-clause | 5,672 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.