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 |
|---|---|---|---|---|---|
module Paths_sandlib (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception.catc... | vertexclique/sandlib | dist/build/autogen/Paths_sandlib.hs | Haskell | bsd-3-clause | 1,149 |
-- | Errors that may occur during decoding/encoding of HTTP message bodies
module Network.HTTP.Encoding.Error (EncodingError (..)
,ConversionError (..)) where
import Codec.Text.IConv (ConversionError
,reportConversionError)
-- | Encoding/Decoding error messag... | achudnov/http-encodings | Network/HTTP/Encoding/Error.hs | Haskell | bsd-3-clause | 1,337 |
{-# LANGUAGE UnicodeSyntax #-}
module Shake.It.FileSystem
( module FileSystem
) where
import Shake.It.FileSystem.Dir as FileSystem
import Shake.It.FileSystem.File as FileSystem
| Heather/Shake.it.off | src/Shake/It/FileSystem.hs | Haskell | bsd-3-clause | 204 |
{-# LANGUAGE TypeOperators #-}
module Web.ApiAi.API
( module Import
, ApiAiAPI
) where
import Servant.API
import Web.ApiAi.API.Core as Import
import Web.ApiAi.API.Entities as Import
import Web.ApiAi.API.Query as Import
type ApiAiAPI = ApiAiEntitiesAPI :<|> ApiAiQueryAPI
| CthulhuDen/api-ai | src/Web/ApiAi/API.hs | Haskell | bsd-3-clause | 286 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Make
-- Copyright : Martin Sjögren 2004
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is an alternative build system that delegates everything to the @make@
-- p... | dcreager/cabal | Distribution/Make.hs | Haskell | bsd-3-clause | 8,739 |
-- | Here we use @dynamic-object@ to descibe the concept of point-like particles from
-- classical mechanics. Also read the HSpec tests :
-- <https://github.com/nushio3/dynamic-object/blob/master/test/ObjectSpec.hs>
-- for more details.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE... | nushio3/dynamic-object | Data/Object/Dynamic/Examples/PointParticle.hs | Haskell | bsd-3-clause | 6,339 |
module Main (main) where
import D12Lib
import System.Environment (getArgs)
import Text.Parsec.String (parseFromFile)
main :: IO ()
main = do
file <- head <$> getArgs
parseResult <- parseFromFile instructionsP file
let instructions = either (error . show) id parseResult
let vm = newVM instructions
let vmRan ... | wfleming/advent-of-code-2016 | 2016/app/D12.hs | Haskell | bsd-3-clause | 481 |
{-# LANGUAGE OverloadedStrings #-}
module InvalidateCacheTestCommon (test1Common) where
import qualified Data.ByteString.Char8 as BS
test1Common lookup3 keysCached3 invalidateCache3 = do
b <- lookup3 ("file1" :: BS.ByteString)
b <- lookup3 "file2"
b <- lookup3 "file3"
b <- lookup3 "file2"
b <- lookup3 "fi... | elblake/expiring-cache-map | tests/InvalidateCacheTestCommon.hs | Haskell | bsd-3-clause | 1,344 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Init
-- Copyright : (c) Brent Yorgey 2009
-- License : BSD-like
--
-- Maintainer : cabal-devel@haskell.org
-- Stability : provisional
-- Portability : portable
--
-... | IreneKnapp/Faction | faction/Distribution/Client/Init.hs | Haskell | bsd-3-clause | 22,401 |
module Text.Email.Parser.Polymorphic (
addrSpec, -- addrSpec is from this module, the rest are re-exports.
localPart,
domainPart,
EmailAddress,
unsafeEmailAddress,
toByteString
) where
import Text.Email.Parser (localPart, domainPart, EmailAddress(..), unsafeEmailAddress, toByteString)
impo... | bitemyapp/email-validate-hs | src/Text/Email/Parser/Polymorphic.hs | Haskell | bsd-3-clause | 3,833 |
{-# LANGUAGE OverloadedStrings #-}
module NLP.Romkan.Internal
(
romKanAList
, romKanAList_H
, kanRomAList
, kanRomAList_H
, kunreiToHepburnAList
, hepburnToKunreiAList
) where
import Data.Text (Text)
romKanAList :: [(Text, Text)]
romKanAList =
[
("bbya"... | karlvoigtland/romkan-hs | NLP/Romkan/Internal.hs | Haskell | bsd-3-clause | 29,985 |
module Main (
main
) where
import Test.HUnit (runTestTT)
import Yawn.Test.Common (withServer)
import qualified Yawn.Test.BlackBox.ParserTest as ParserTest (tests)
main :: IO ()
main = withServer "www" $ do
runTestTT ParserTest.tests
return ()
| ameingast/yawn | test/src/TestMain.hs | Haskell | bsd-3-clause | 252 |
module Benchmarks.ListSet where
type Set a = [a]
empty :: Set a
empty = []
insert :: Ord a => a -> Set a -> Set a
insert a [] = [a]
insert a (x:xs)
| a < x = a:x:xs
| a > x = x:insert a xs
| a == x = x:xs
set :: Ord a => [a] -> Set a
set = foldr insert empty
ordered [] = True
ordered [x] = True
ordered (x:y:... | UoYCS-plasma/LazySmallCheck2012 | suite/performance/Benchmarks/ListSet.hs | Haskell | bsd-3-clause | 616 |
module HsImport.Utils
( firstSrcLine
, lastSrcLine
, srcSpan
, declSrcLoc
, importDecls
) where
import qualified Language.Haskell.Exts as HS
import HsImport.Types
declSrcLoc :: Decl -> SrcLoc
declSrcLoc decl = HS.SrcLoc srcFile srcLine srcCol
where
declSrcSpan = srcSpan . HS.ann $ decl
... | dan-t/hsimport | lib/HsImport/Utils.hs | Haskell | bsd-3-clause | 692 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Common where
-- orig in mu/Syntax.hs
-- N for name, but Name already used in Bound,
-- and Nm is a data type in Syntax, thus N - oh well
type N = String
data Binop = Add | Sub | Mul | Eql
deriving (Eq, Ord, Show, Read)
| reuleaux/pire | exe/Common.hs | Haskell | bsd-3-clause | 283 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
module Language.Haskell.Refact.Utils.ExactPrint
(
replace
, replaceAnnKey
, copyAnn
, setAnnKeywordDP
, clearPriorComments
, balanceAllCo... | SAdams601/ParRegexSearch | test/HaRe/src/Language/Haskell/Refact/Utils/ExactPrint.hs | Haskell | mit | 5,482 |
{-# OPTIONS_GHC -F -pgmF htfpp #-}
module GameTest where
import Test.Framework
prop_reverse :: [Int] -> Bool
prop_reverse xs = xs == (reverse (reverse xs))
| abailly/hsgames | acquire/test/GameTest.hs | Haskell | apache-2.0 | 168 |
{-# LANGUAGE TemplateHaskell #-}
{-| Implementation of the Ganeti LUXI interface.
-}
{-
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 conditions are
met:
1. Redi... | mbakke/ganeti | src/Ganeti/Luxi.hs | Haskell | bsd-2-clause | 13,584 |
module Tandoori.GHC.Internals
(module SrcLoc,
module Outputable,
module Name,
module BasicTypes,
module Unique,
module FastString,
module HsExpr,
module HsTypes,
module HsPat,
module HsLit,
module HsBinds,
module DataCon,
module TysWiredIn,
mo... | bitemyapp/tandoori | src/Tandoori/GHC/Internals.hs | Haskell | bsd-3-clause | 845 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1997-1998
Author: Juan J. Quintela <quintela@krilin.dc.fi.udc.es>
-}
{-# LANGUAGE CPP #-}
module ETA.DeSugar.Check ( check , ExhaustivePat ) where
import ETA.HsSyn.HsSyn
import ETA.TypeCheck.TcHsSyn
import ETA.DeSugar.DsUtils
im... | pparkkin/eta | compiler/ETA/DeSugar/Check.hs | Haskell | bsd-3-clause | 30,170 |
{-# LANGUAGE CPP #-}
-- |
-- Package configuration information: essentially the interface to Cabal, with
-- some utilities
--
-- (c) The University of Glasgow, 2004
--
module PackageConfig (
-- $package_naming
-- * PackageId
mkPackageId, packageConfigId,
-- * The PackageConfig type: i... | frantisekfarka/ghc-dsi | compiler/main/PackageConfig.hs | Haskell | bsd-3-clause | 3,235 |
module A1 where
import D1
sumSq xs ys= sum (map sq xs) + sumSquares xs ys
main = sumSq [1..4]
| kmate/HaRe | old/testing/rmOneParameter/A1.hs | Haskell | bsd-3-clause | 99 |
{-# LANGUAGE TypeFamilyDependencies #-}
module T6018Bfail where
import Data.Kind (Type)
type family H a b c = (result :: Type) | result -> a b c
| sdiehl/ghc | testsuite/tests/typecheck/should_fail/T6018Bfail.hs | Haskell | bsd-3-clause | 148 |
import GHC.Conc
main :: IO ()
main = setNumCapabilities 0
| ezyang/ghc | testsuite/tests/rts/T13832.hs | Haskell | bsd-3-clause | 59 |
{-# LANGUAGE FlexibleContexts #-}
-- | Implementation of Kahan summation algorithm that tests
-- performance of tight loops involving unboxed arrays and floating
-- point arithmetic.
module Main (main) where
import Control.Monad.ST
import Data.Array.Base
import Data.Array.ST
import Data.Bits
import Data.Word
import S... | k-bx/ghcjs | test/nofib/imaginary/kahan/Main.hs | Haskell | mit | 1,334 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilyDependencies #-}
module T13271 where
import GHC.TypeLits
data T1 = T1
type T2 = TypeError (Text "You can't do that!")
type family X i = r | r -> i where
X 1 = T1
X 2 = T2
| shlevy/ghc | testsuite/tests/indexed-types/should_fail/T13271.hs | Haskell | bsd-3-clause | 229 |
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Data.Maybe (Maybe(..))
import Data.Ord (Ord)
import Language.Haskell.TH (mkName, nameSpace)
main :: IO ()
main = mapM_ (print . nameSpace)
[ 'Prelude.id
, mkName "id"
, 'Data.Maybe.Just
, ''Data.Maybe.Maybe
... | ezyang/ghc | testsuite/tests/th/TH_nameSpace.hs | Haskell | bsd-3-clause | 364 |
main = interact wordCount
where wordCount input = show (length input) ++ "\n"
| akampjes/learning-realworldhaskell | ch01/WC.hs | Haskell | mit | 80 |
{-# Language GADTs #-}
module Unison.Runtime.Vector where
import Unison.Prelude
import qualified Data.MemoCombinators as Memo
import qualified Data.Vector.Unboxed as UV
-- A `Vec a` denotes a `Nat -> Maybe a`
data Vec a where
Scalar :: a -> Vec a
Vec :: UV.Unbox a => UV.Vector a -> Vec a
Pair :: Vec a -> Vec ... | unisonweb/platform | parser-typechecker/src/Unison/Runtime/Vector.hs | Haskell | mit | 1,622 |
import Control.Monad
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
bind :: Monad m => (a -> m b) -> m a -> m b
bind f n = join $ fmap f n
data Nope a = NopeDotJpg deriving (Show, Eq)
instance Functor Nope where
fmap f a = NopeDotJpg
instance Applicative Nope where
pur... | mitochon/hexercise | src/haskellbook/ch18/ch18.hs | Haskell | mit | 3,911 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE Typ... | albertov/esqueleto-textsearch | test/Database/Esqueleto/TextSearchSpec.hs | Haskell | mit | 11,840 |
{-
ghci c:\Users\Thomas\Documents\GitHub\practice\pe\nonvisualstudio\haskell\Spec\Problem0002.Spec.hs
c:\Users\Thomas\Documents\GitHub\practice\pe\nonvisualstudio\haskell\Implementation\Problem0002.hs
-}
-- :r :q :set +s for times
module Problem0002Tests where
import Test.HUnit
import System.IO
import Problem... | Sobieck00/practice | pe/nonvisualstudio/haskell/OldWork/Spec/Problem0002.Spec.hs | Haskell | mit | 644 |
{-# OPTIONS #-}
-- ------------------------------------------------------------
module Holumbus.Crawler.XmlArrows
where
import Text.XML.HXT.Core
-- ------------------------------------------------------------
-- | Remove contents, when document status isn't ok, but remain meta info
checkDocumentStatus ... | ichistmeinname/holumbus | src/Holumbus/Crawler/XmlArrows.hs | Haskell | mit | 578 |
{-|
Module : Control.Monad.Bayes.LogDomain
Description : Numeric types representing numbers using their logarithms
Copyright : (c) Adam Scibior, 2016
License : MIT
Maintainer : ams240@cam.ac.uk
Stability : experimental
Portability : GHC
-}
-- Log-domain non-negative real numbers
-- Essentially a polymor... | ocramz/monad-bayes | src/Control/Monad/Bayes/LogDomain.hs | Haskell | mit | 4,423 |
module Frontend.Values where
import Frontend.Types
import Internal
data Value = IntValue Int
| FloatValue Float
| BoolValue Bool
| UnitValue
deriving Eq
instance Show Value where
show (IntValue i) = show i
show (FloatValue f) = show f
show (BoolValue True) = "true"
... | alpicola/mel | src/Frontend/Values.hs | Haskell | mit | 553 |
data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show)
data Direction = L | R deriving (Show)
type Directions = [ Direction ]
freeTree :: Tree Char
freeTree =
Node 'P'
(Node 'O'
(Node 'L'
(Node 'N' Empty Empty)
(Node 'T' Empty Empty)
)
... | afronski/playground-fp | books/learn-you-a-haskell-for-great-good/zippers/trees.hs | Haskell | mit | 1,321 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StandaloneDeriving #-}
module Nanocoin.Network.Peer (
Peer(..),
Peers,
) where
import Protolude hiding (put, get)
import Data.Aeson (ToJSON(..))
import Data.Binary (Binary, encode, decode)
import Data.Serialize (Serialize(..))
import Co... | tdietert/nanocoin | src/Nanocoin/Network/Peer.hs | Haskell | apache-2.0 | 663 |
module Lycopene.Core.Record.Service where
import Control.Monad.Trans (liftIO)
import Data.Time.Clock (getCurrentTime)
import Data.Time.LocalTime (utcToLocalTime, getCurrentTimeZone, LocalTime)
import Lycopene.Core.Monad
import Lycopene.Core.Database
import qualified Ly... | utky/lycopene | src/Lycopene/Core/Record/Service.hs | Haskell | apache-2.0 | 714 |
module Handler.ToPostList where
import Import
import Data.List (sort)
getToPostListR :: Handler RepHtml
getToPostListR = do
toposts <- liftIO getToPosts
defaultLayout $ do
setTitle "To post list"
$(widgetFile "topost-list")
| snoyberg/photosorter | Handler/ToPostList.hs | Haskell | bsd-2-clause | 250 |
module Database.Narc.Common where
type Tabname = String
type Field = String
| ezrakilty/narc | Database/Narc/Common.hs | Haskell | bsd-2-clause | 79 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QLineEdit.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:25
Warning : this file is machine generated - do not... | keera-studios/hsQt | Qtc/Gui/QLineEdit.hs | Haskell | bsd-2-clause | 59,042 |
{-# LANGUAGE BangPatterns #-}
module AI.HMM.Type where
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Generic as G
import Numeric.LinearAlgebra.HMatrix
import AI.Function
-- constant: log (2*pi)
m_log_2_pi :: Double
m_log_2_pi = 1.8378770664093453
-- | multi... | kaizhang/HMM | src/AI/HMM/Type.hs | Haskell | bsd-3-clause | 2,750 |
module Paths_bogre_banana (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception... | DavidEichmann/boger-banana | .dist-buildwrapper/dist/build/autogen/Paths_bogre_banana.hs | Haskell | bsd-3-clause | 1,156 |
module Main where
import System.Environment (getArgs)
import Budget.App (run, BudgetCommand(..))
main :: IO ()
main = do
args <- getArgs
case parseOpts args of
Left m -> putStrLn m
Right c -> run c
parseOpts :: [String] -> Either String BudgetCommand
parseOpts ("configure":options)
... | utky/budget | app/Main.hs | Haskell | bsd-3-clause | 808 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-|
Module : Numeric.AERN.RealArithmetic.Basis.MPFR.Effort
... | michalkonecny/aern | aern-mpfr-rounded/src/Numeric/AERN/RealArithmetic/Basis/MPFR/Basics.hs | Haskell | bsd-3-clause | 5,210 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Home.Routes where
import Servant
import Servant.HTML.Blaze
import Text.Blaze.Html5
type HomeRoutes = Home
type Home = Get '[HTML] Html
| hectorhon/autotrace2 | app/Home/Routes.hs | Haskell | bsd-3-clause | 204 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Distance.KO.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
import ... | facebookincubator/duckling | tests/Duckling/Distance/KO/Tests.hs | Haskell | bsd-3-clause | 507 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- | Internal only. Do Not Eat.
module Tea.TeaState ( TeaState (..)
, EventState (..)
) where
import Data.Map(Map)
import Data.Array(Array)
import Tea.Screen(Screen)
import Tea.Input(KeyCode)
data TeaState = TS { _screen :: Screen, _eventSt... | liamoc/tea-hs | Tea/TeaState.hs | Haskell | bsd-3-clause | 524 |
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : dave.laing.80@gmail.com
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Fragment.Bool.Rules.Kind.Infe... | dalaing/type-systems | src/Fragment/Bool/Rules/Kind/Infer/Common.hs | Haskell | bsd-3-clause | 1,494 |
-----------------------------------------------------------------------------
--
-- Pretty-printing assembly language
--
-- (c) The University of Glasgow 1993-2005
--
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-}
module PPC.Ppr (
pprNatCmmDe... | ml9951/ghc | compiler/nativeGen/PPC/Ppr.hs | Haskell | bsd-3-clause | 28,362 |
module Stars where
import Rumpus
-- Golden Section Spiral (via http://www.softimageblog.com/archives/115)
pointsOnSphere :: Int -> [V3 GLfloat]
pointsOnSphere (fromIntegral -> n) =
map (\k ->
let y = k * off - 1 + (off / 2)
r = sqrt (1 - y*y)
phi = k * inc
in V3 (c... | lukexi/rumpus | pristine/Intro/Stars.hs | Haskell | bsd-3-clause | 1,339 |
module RevealHs.Sample.Env where
import Data.Time.Clock
import Data.Time.Format
import Data.Time.LocalTime
today :: IO String
today = do
tz <- getCurrentTimeZone
t <- fmap (utcToLocalTime tz) getCurrentTime
return $ formatTime defaultTimeLocale (iso8601DateFormat Nothing) t
| KenetJervet/reveal-hs | app/RevealHs/Sample/Env.hs | Haskell | bsd-3-clause | 313 |
{-# LANGUAGE TemplateHaskell, GeneralizedNewtypeDeriving #-}
module Math.InfoRetrieval.TFIDF
( Document(..)
, Term(..)
, Corpus
, emptyCorpus
, addDocument
, removeDocument
, FreqScaling(..)
, tfidf
, search
) where
import Control.Lens
import Dat... | bgamari/tf-idf | Math/InfoRetrieval/TFIDF.hs | Haskell | bsd-3-clause | 2,526 |
{-|
Module : Numeric.AERN.RealArithmetic.RefinementOrderRounding.Operators
Description : convenience operators and functions with default effort
Description : re-export of parent's operators for easier direct import
Copyright : (c) Michal Konecny
License : BSD3
Maintainer :... | michalkonecny/aern | aern-real/src/Numeric/AERN/RealArithmetic/RefinementOrderRounding/Operators.hs | Haskell | bsd-3-clause | 862 |
import Language.Haskell.Exts.Parser
import Language.Haskell.Exts.Syntax
import System.FilePath
import System.Directory
import Control.Monad
import Data.Maybe
import Data.List
import Control.Applicative
import Data.GraphViz.Types.Graph
import Data.GraphViz.Commands.IO
import Data.GraphViz.Types.Canonical
import Data.Te... | bneijt/hs2dot | src/main/Main.hs | Haskell | bsd-3-clause | 2,509 |
{-# LANGUAGE CPP #-}
module Database.PostgreSQL.PQTypes.Internal.Monad (
DBT_(..)
, DBT
, runDBT
, mapDBT
) where
import Control.Applicative
import Control.Concurrent.MVar
import Control.Monad.Base
import Control.Monad.Catch
import Control.Monad.Error.Class
import Control.Monad.Reader.Class
import Control.... | scrive/hpqtypes | src/Database/PostgreSQL/PQTypes/Internal/Monad.hs | Haskell | bsd-3-clause | 5,271 |
{-# LANGUAGE EmptyDataDecls, FlexibleContexts, FlexibleInstances, RankNTypes #-}
{-# LANGUAGE TypeSynonymInstances, UndecidableInstances #-}
module Main where
import Data.Constraint.Unsafely
import Data.Proxy
class Semigroup a where
-- | binary operation which satisifies associative law:
-- ... | konn/unsafely | examples/semigroup.hs | Haskell | bsd-3-clause | 1,564 |
{-
Author: George Karachalias <george.karachalias@cs.kuleuven.be>
Haskell expressions (as used by the pattern matching checker) and utilities.
-}
{-# LANGUAGE CPP #-}
module PmExpr (
PmExpr(..), PmLit(..), SimpleEq, ComplexEq, toComplex, eqPmLit,
truePmExpr, falsePmExpr, isTruePmExpr, isFalsePmExpr, ... | GaloisInc/halvm-ghc | compiler/deSugar/PmExpr.hs | Haskell | bsd-3-clause | 16,939 |
{-# LANGUAGE CPP #-}
-- | Contains commons utilities when defining your own widget
module Glazier.React.ReactDOM
( renderDOM
) where
import Glazier.React.ReactElement
import qualified JS.DOM.EventTarget.Node.Element as DOM
-- | Using a React Element (first arg) give React rendering control over a DOM element (se... | louispan/glazier-react | src/Glazier/React/ReactDOM.hs | Haskell | bsd-3-clause | 689 |
-- | This module supplies the types that are used in interacting with
-- and parsing from the database.
module Database.Influx.Types
( module Database.Influx.Types.Core
, module Database.Influx.Types.FromInfluxPoint
)
where
import Database.Influx.Types.Core
import Database.Influx.Types.FromInfluxPoint
| factisresearch/influx | src/Database/Influx/Types.hs | Haskell | bsd-3-clause | 316 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE UnicodeSyntax #-}
{-|
[@ISO639-1@] fi
[@ISO639-2B@] fin
[@ISO639-3@] fin
[@Native name@] suomi
[@En... | telser/numerals | src/Text/Numeral/Language/FIN.hs | Haskell | bsd-3-clause | 49,160 |
module Main where
import Test.HUnit hiding (path)
import TestUtil
import Database.TokyoCabinet.HDB
import Data.Maybe (catMaybes)
import Data.List (sort)
import Control.Monad
dbname :: String
dbname = "foo.tch"
withOpenedHDB :: String -> (HDB -> IO a) -> IO a
withOpenedHDB name action = do
h <- new
open h name [... | tom-lpsd/tokyocabinet-haskell | tests/HDBTest.hs | Haskell | bsd-3-clause | 6,050 |
module CRF.Control.Monad.Lazy
( mapM'
-- , mapM_'
, sequence'
) where
import System.IO.Unsafe (unsafeInterleaveIO)
sequence' (mx:xs) = unsafeInterleaveIO $
combine xs =<< mx
where combine xs x = return . (x:) =<< sequence' xs
sequence' [] = return []
mapM' f (x:xs) = unsafeInterleaveIO $ do
y <- f x
... | kawu/tagger | src/CRF/Control/Monad/Lazy.hs | Haskell | bsd-3-clause | 488 |
-- From Thinking Functionally with Haskell
-- One man went to mow
-- Went to mow a meadow
-- One man and his dog
-- Went to mow a meadow
-- Two men went to mow
-- Went to mow a meadow
-- Two men, one man and his dog
-- Went to mow a meadow
-- Three men went to mow
-- Went to mow a meadow
-- Three men, two men, one man ... | trymilix/cookbooks | Software/haskell/song.hs | Haskell | apache-2.0 | 992 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Word (Word8, Word16)
import Data.List (unfoldr)
import Data.Bits (shiftL, (.&.))
import Data.ByteString.Char8 ()
import Data.Monoid
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import qualified Data.Binary.BitBuilder a... | KrzyStar/binary-low-level | tests/BitBuilderTest.hs | Haskell | bsd-3-clause | 1,956 |
-- | This module contains any objects relating to order theory
module SubHask.Algebra.Ord
where
import qualified Prelude as P
import qualified Data.List as L
import qualified GHC.Arr as Arr
import Data.Array.ST hiding (freeze,thaw)
import Control.Monad
import Control.Monad.Random
import Control.Monad.ST
import Pr... | abailly/subhask | src/SubHask/Algebra/Ord.hs | Haskell | bsd-3-clause | 2,149 |
<?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="de-DE">
<title>Active Scan Rules - Alpha | ZAP Extension</title>
<maps>
<homeID>top</homeID... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/ascanrulesAlpha/resources/help_de_DE/helpset_de_DE.hs | Haskell | apache-2.0 | 986 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ExtendedDefaultRules #-}
-- | A first example in equalional reasoning.
-- | From the definition of append we should be able to
-- | semi-automatically prove the two axioms.
-- | Note for soundness we need
-- | totallity: all the cases should be covered
-- | terminati... | abakst/liquidhaskell | tests/equationalproofs/pos/MapFusion.hs | Haskell | bsd-3-clause | 2,338 |
module Lib where
data Value = Finite Integer | Infinity
deriving (Eq)
instance Num Value where
(+) = undefined
(*) = undefined
abs = undefined
signum = undefined
negate = undefined
fromInteger = Finite
-- | @litCon _@ should not elicit an overlapping patterns warning w... | sdiehl/ghc | testsuite/tests/pmcheck/should_compile/T16289.hs | Haskell | bsd-3-clause | 667 |
<?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="ja-JP">
<title>FuzzDB Files</title>
<maps>
<homeID>fuzzdb</homeID>
<mapref location="ma... | thc202/zap-extensions | addOns/fuzzdb/src/main/javahelp/help_ja_JP/helpset_ja_JP.hs | Haskell | apache-2.0 | 960 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Fun... | olsner/ghc | libraries/base/Data/Functor/Identity.hs | Haskell | bsd-3-clause | 3,919 |
import Control.Exception
import System.Environment
import Control.Monad.Par.Scheds.Trace
-- NB. using Trace here, Direct is too strict and forces the fibs in
-- the parent; see https://github.com/simonmar/monad-par/issues/27
-- <<fib
fib :: Integer -> Integer
fib 0 = 1
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
-- >>
ma... | lywaterman/parconc-examples | parmonad.hs | Haskell | bsd-3-clause | 747 |
{-# LANGUAGE TemplateHaskell #-}
module T15502 where
import Language.Haskell.TH.Syntax (Lift(lift))
main = print ( $( lift (toInteger (maxBound :: Int) + 1) )
, $( lift (minBound :: Int) )
)
| sdiehl/ghc | testsuite/tests/th/T15502.hs | Haskell | bsd-3-clause | 221 |
{-# LANGUAGE TypeFamilies #-}
module C where
import A
data C
type instance F (a,C) = Bool
| shlevy/ghc | testsuite/tests/driver/recomp017/C2.hs | Haskell | bsd-3-clause | 90 |
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-unbox-small-strict-fields #-}
-- Makes f2 a bit more challenging
module Foo where
h :: Int -> Int -> Bool
h 0 y = y>0
h n y = h (n-1) y
-- The main point: all of these functions can have the CPR property
------- f1 -----------
-- x is used strictly... | urbanslug/ghc | testsuite/tests/stranal/T10482a.hs | Haskell | bsd-3-clause | 1,448 |
import Control.Exception
import Control.DeepSeq
main = evaluate (('a' : undefined) `deepseq` return () :: IO ())
| ezyang/ghc | testsuite/tests/simplCore/should_fail/T7411.hs | Haskell | bsd-3-clause | 113 |
-- !!! Monomorphism restriction
-- This one should work fine, despite the monomorphism restriction
-- Fails with GHC 5.00.1
module Test where
import Control.Monad.ST
import Data.STRef
-- Should get
-- apa :: forall s. ST s ()
apa = newSTRef () >> return ()
foo1 = runST apa
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_compile/tc132.hs | Haskell | bsd-3-clause | 278 |
module ShouldSucceed where
f x = a
a = (x,x)
x = x
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc021.hs | Haskell | bsd-3-clause | 54 |
module Main where
import Tracks.Network
import Tracks.Service
import Tracks.Train
import Tracks.Signals (Signals)
import qualified Tracks.Signals as Signals
import Control.Monad.STM
import Control.Concurrent
import qualified STMContainers.Set as Set
import System.Random
foxhole, riverford, tunwall, maccton, welbridg... | derkyjadex/tracks | Main.hs | Haskell | mit | 1,749 |
import Algorithms.MDP.Examples.Ex_3_1
import Algorithms.MDP
import Algorithms.MDP.ValueIteration
import qualified Data.Vector as V
converging :: Double
-> (CF State Control Double, CF State Control Double)
-> Bool
converging tol (cf, cf') = abs (x - y) > tol
where
x = (\(_, _, c) -> c) (... | prsteele/mdp | src/run-ex-3-1.hs | Haskell | mit | 634 |
len = fromIntegral . length
rnd n x = (fromIntegral (floor (x * t))) / t
where t = 10^n
put = putStrLn . show
mean xs = sum xs / (len xs)
stddev xs = sqrt $ var xs
var xs = (/(n-1)) $ sum [(x - m)^2 | x <- xs]
where m = mean xs
n = len xs
covar xs ys = (/(n - 1)) . sum $ zipWith (*) [x - xm | x ... | wd0/-stats | correl.hs | Haskell | mit | 903 |
module SimpSymb where
az = ['a'..'z']
data XPlus = '+' | '='
-- false x = ('+',x,'+',x,'+') | HaskellForCats/HaskellForCats | simpSymb.hs | Haskell | mit | 96 |
{-# LANGUAGE ScopedTypeVariables, ViewPatterns #-}
{-|
Module : Labyrinth.AStar
Description : pathfinding
Copyright : (c) deweyvm 2014
License : MIT
Maintainer : deweyvm
Stability : experimental
Portability : unknown
Implementation of the A* (A star) pathfinding algorithm.
-}
module Labyrinth.Pathing.ASt... | deweyvm/labyrinth | src/Labyrinth/Pathing/AStar.hs | Haskell | mit | 3,410 |
module Cases.Prelude
(
module Exports,
(?:),
(|>),
(<|),
(|$>),
)
where
-- base
-------------------------
import Control.Applicative as Exports hiding (WrappedArrow(..))
import Control.Arrow as Exports hiding (first, second)
import Control.Category as Exports
import Control.Concurrent as Exports
import Con... | nikita-volkov/cases | library/Cases/Prelude.hs | Haskell | mit | 3,608 |
import BMSClipboard
import System.Environment
import Data.List
import Debug.Trace
import Data.Maybe
sortObject a b
| t1 < t2 = LT
| t1 > t2 = GT
| otherwise = compare c1 c2
where
t1 = row(a)
t2 = row(b)
c1 = rawChannel(a)
c2 = rawChannel(b)
movePlayableNotesToBGM ([], bgmNotes) = bgmNot... | bemusic/bms-clipboarder | src/BGMize.hs | Haskell | mit | 1,142 |
module Http.Response
( Response (..)
, response
) where
import Text.ParserCombinators.Parsec hiding (token)
data Response = Response
{ statusLine :: StatusLine
, headers :: [(String,String)]
, body :: String
} deriving (Show)
data StatusLine = StatusLine
{ code :: Int
, reasonPhras... | ndreynolds/hsURL | src/Http/Response.hs | Haskell | mit | 2,472 |
{-# LANGUAGE MagicHash, MultiParamTypeClasses, TypeFamilies, DataKinds, FlexibleContexts #-}
module JavaFX.Types where
import Java
data {-# CLASS "javafx.stage.Stage" #-} Stage = Stage (Object# Stage)
deriving Class
data {-# CLASS "javafx.scene.Scene" #-} Scene = Scene (Object# Scene)
deriving Class
data {-# C... | filippovitale/eta-playground | javafx-canvas-grid/src/JavaFX/Types.hs | Haskell | mit | 1,166 |
module ProjectEuler.Problem004Spec (main, spec) where
import Test.Hspec
import ProjectEuler.Problem004
main :: IO ()
main = hspec spec
spec :: Spec
spec = parallel $
describe "solve" $
it "finds the largest palindrome product of two 3-digit numbers" $
solve 3 `shouldBe` 906609
| hachibu/project-euler | test/ProjectEuler/Problem004Spec.hs | Haskell | mit | 293 |
{-# LANGUAGE TupleSections #-}
module Main where
import SparseMatrix
import Data.List (sortOn)
import qualified System.IO.Strict as Strict
import Data.Map.Strict (fromList, toList)
main :: IO ()
main = Strict.readFile "hackage.graph.hs" >>= mapM_ print
. (fmap . fmap) (*100) . take 20 . sortOn (negate . snd) . toL... | Magnap/pagerank-hs | src/Main.hs | Haskell | mit | 399 |
-- | Common helpers for the tests.
module TestCommon
( mkApp'
, key
) where
import API (serveApp)
import App (AppConfig(..), mkApp)
import Control.Monad.Logger (runStderrLoggingT, filterLogger, LogLevel(..))
import qualified Data.Map.Strict as M
import Mailgun.APIKey (APIK... | fusionapp/catcher-in-the-rye | test/TestCommon.hs | Haskell | mit | 845 |
-- | Functions for working with Jalaali calendar system.
-- This library mimics the API of "Data.Time.Calendar.Gregorian".
module Data.Time.Calendar.Jalaali
( isJalaaliLeapYear
, toJalaali
, fromJalaali
, fromJalaaliValid
, jalaaliMonthLength
, showJalaali
, addJalaaliMonthsClip
, addJalaaliMonthsRollOv... | jalaali/jalaali-hs | src/Data/Time/Calendar/Jalaali.hs | Haskell | mit | 10,023 |
import RecursiveContents (getRecursiveContents)
simpleFind :: (FilePath -> Bool) -> FilePath -> IO [FilePath]
simpleFind p path = do
names <- getRecursiveContents path
return (filter p names)
| zhangjiji/real-world-haskell | ch9/SimpleFinder.hs | Haskell | mit | 197 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
-- |
-- Module : Network.OAuth.MuLens
-- Copyright : (c) Joseph Abrahamson 2013
-- License : MIT
--
-- Maintainer : me@jspha.com
-- Stability : experimental
-- Portability : non-portable
--
-- Tiny, @Control.Lens@ compatibility... | tel/oauthenticated | src/Network/OAuth/MuLens.hs | Haskell | mit | 1,573 |
-- If the numbers 1 to 5 are written out in words: one, two, three,
-- four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in
-- total.
-- If all the numbers from 1 to 1000 (one thousand) inclusive were
-- written out in words, how many letters would be used?
-- NOTE: Do not count spaces or hyphens. For ex... | whittle/euler | src/Euler/Problem017.hs | Haskell | mit | 2,402 |
{-# LANGUAGE TypeOperators #-}
module Language.Sigil.Stack
( push
, pop
) where
import Control.Monad.Free
import Language.Sigil.Types
push :: a -> SigilProgram a ()
push x = liftF $ Push x ()
pop :: SigilProgram a ()
pop = liftF $ Pop ()
{- swap :: (s :. a :. b) -> (s :. b :. a) ... | erochest/sigil | Language/Sigil/Stack.hs | Haskell | apache-2.0 | 1,482 |
module Lab4 where
fp :: Eq a => (a -> a) -> a -> a
fp f = \ x -> if x == f x then x else fp f (f x)
| bartolkaruza/software-testing-2014-group-W1 | week4/Lab4.hs | Haskell | apache-2.0 | 103 |
module HEP.Automation.EventAnalysis.Command where
import HEP.Automation.EventAnalysis.ProgType
import HEP.Automation.EventAnalysis.Job
commandLineProcess :: EventAnalysis -> IO ()
commandLineProcess (Single lhefp pdffp) = do
putStrLn "test called"
startSingle lhefp pdffp
commandLineProcess (JsonTest fp) = do
... | wavewave/EventAnalysis | lib/HEP/Automation/EventAnalysis/Command.hs | Haskell | bsd-2-clause | 640 |
module Distribution.VcsRevision.Svn ( getRevision ) where
import Control.Exception
import System.Process
import System.Exit
import Data.List
tryIO :: IO a -> IO (Either IOException a)
tryIO = try
-- | Nothing if we're not in a svn repo, Just (revision,modified) if we're in a repo.
getRevision :: IO (Maybe (String, B... | jkff/vcs-revision | Distribution/VcsRevision/Svn.hs | Haskell | bsd-2-clause | 775 |
module Module2.Task10 where
avg :: Int -> Int -> Int -> Double
avg a b c = fromIntegral (a + b + c) / 3
| dstarcev/stepic-haskell | src/Module2/Task10.hs | Haskell | bsd-3-clause | 105 |
{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-}
module Database.Dedalus.PrettyPrint where
-- This code is initially based on
-- https://github.com/pchiusano/datalog-refactoring/blob/master/src/PrettyPrint.hs
import qualified Text.PrettyPrint as PP
import Text.PrettyPrint (($$),(<>),(<+>))... | alanz/hdedalus | src/Database/Dedalus/PrettyPrint.hs | Haskell | bsd-3-clause | 1,773 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.