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 Rebase.GHC.IO.Encoding.Types
(
module GHC.IO.Encoding.Types
)
where
import GHC.IO.Encoding.Types
| nikita-volkov/rebase | library/Rebase/GHC/IO/Encoding/Types.hs | Haskell | mit | 107 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot1click-project-placementtemplate.html
module Stratosphere.ResourceProperties.IoT1ClickProjectPlacementTemp... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/IoT1ClickProjectPlacementTemplate.hs | Haskell | mit | 2,300 |
--
import Data.Char
data Operator = Plus | Minus | Times | Div deriving (Show,Eq)
opToChar :: Operator -> Char
-- opToChar = undefined
opToChar Plus = '+'
opToChar Minus = '-'
opToChar Times = '*'
opToChar Div = '/'
opToStr :: Operator -> String
opToStr Plus = "+"
opToStr Minus = "-"
opToStr Times = "*"
opToS... | egaburov/funstuff | Haskell/BartoszBofH/7_TokenizerHOF/tokenize.hs | Haskell | apache-2.0 | 3,402 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Utils
-- Copyright : (c) The University of Glasgow 2001-2002,
-- Simon Marlow 2003-2006,
-- David Waern 2006-2009
-- License : BSD-like
--
-- M... | jstolarek/haddock | haddock-api/src/Haddock/Utils.hs | Haskell | bsd-2-clause | 15,975 |
{-# LANGUAGE ScopedTypeVariables #-}
module Import
( module Prelude
, module Foundation
, (<>)
, Text
, module Data.Monoid
, module Control.Applicative
, module Gitolite
, module Data.Maybe
, module Settings.StaticFiles
, getGitolite
, withRepo
, withRepoObj
, isBlob
... | konn/gitolist | Import.hs | Haskell | bsd-2-clause | 4,831 |
{-# LANGUAGE TupleSections #-}
module Driver where
import Control.Applicative ((<$>),(<*>))
import Control.Monad (when)
import Data.Foldable (forM_)
import Distribution.Package
import Distribution.PackageDescription
import Distribution.ModuleName
import Distribution.PackageDescription.Parse
import Distribution.Verb... | wavewave/metapackage | src/Driver.hs | Haskell | bsd-2-clause | 2,470 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-}
module Network.DNS.StateBinary where
import Control.Monad.State (State, StateT)
import qualified Control.Monad.State as ST
import Control.Monad.Trans.Resource (ResourceT)
import qualified Data.Attoparsec.ByteString as A
import qualified Data.Attoparsec.Typ... | greydot/dns | Network/DNS/StateBinary.hs | Haskell | bsd-3-clause | 4,973 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{- |
Module: Main
Maintainer: Thomas Sutton
This module implements a command-line tool to perform formal concept analysis
on data sets.
-}
module Main where
import Control.Applicative
import qualified Data.ByteString.Lazy as BL
import ... | thsutton/fca | src/Main.hs | Haskell | bsd-3-clause | 4,322 |
{-# OPTIONS_GHC -Wall #-}
module Classy.Casadi.Integrator where
import Control.Applicative ( (<$>) )
import Python.Exceptions
import Python.Interpreter
import Python.Objects
import Foreign.C.Types ( CDouble )
import qualified Classy.Convenience as CC
import Classy.State hiding ( run )
import Classy.Types
import Clas... | ghorn/classy-dvda | src/Classy/Casadi/Integrator.hs | Haskell | bsd-3-clause | 3,400 |
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Turtle
import Filesystem.Path.CurrentOS
import Data.Text
main = sh $
do m <- using $ mktempfile "." "m.pdf"
sr <- using $ mktempfile "." "sr.pdf"
let p1 = ["bbc-oca/msr/79ths.score"]
... | nkpart/score-writer | library/make-msr.hs | Haskell | bsd-3-clause | 1,005 |
module Main (
main
) where
import Criterion.Config
import Criterion.Main
import System.Random
import qualified Signal.Wavelet.C1Bench as C1
import qualified Signal.Wavelet.Eval.CommonBench as EC
import qualified Signal.Wavelet.Eval1Bench as E1
import qualified Signal.Wavelet.Eval2Bench a... | jstolarek/lattice-structure-hs | bench/MainBenchmarkSuite.hs | Haskell | bsd-3-clause | 8,573 |
{- PiForall language, OPLSS, Summer 2013 -}
{-# LANGUAGE TypeSynonymInstances,ExistentialQuantification,FlexibleInstances, UndecidableInstances, FlexibleContexts,
ViewPatterns, DefaultSignatures
#-}
{-# OPTIONS_GHC -Wall -fno-warn-unused-matches -fno-warn-name-shadowing #-}
-- | A Pretty Printer.
module... | jonsterling/Luitzen | src/PrettyPrint.hs | Haskell | bsd-3-clause | 13,162 |
-- |
-- Module : BenchmarkOps
-- Copyright : (c) 2018 Harendra Kumar
--
-- License : MIT
-- Maintainer : streamly@composewell.com
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module NestedOps where
import Control.Exception (try)
import GHC.Exception (ErrorCall)
import qualified... | harendra-kumar/asyncly | benchmark/NestedOps.hs | Haskell | bsd-3-clause | 4,633 |
{-# LANGUAGE OverloadedStrings #-}
-- reference to L.isPrefixOf
-- see Data.List (delete, deleteBy)
module Data.Carbonara.LazyByteString where
import qualified Data.ByteString.Char8 as S (singleton)
import qualified Data.ByteString.Internal as S (w2c,c2w)
import Data.Int (Int64)
import qualified Data.ByteString.... | szehk/Haskell-Carbonara-Library | src/Data/LazyByteString.hs | Haskell | bsd-3-clause | 757 |
{-# LANGUAGE OverloadedStrings, FlexibleContexts, PackageImports #-}
module Network.XMPiPe.Core.S2S.Client (
-- * Types and Values
Mpi(..), Jid(..), Tags(..), tagsNull, tagsType,
-- * Functions
starttls, sasl, begin, input, output,
) where
import "monads-tf" Control.Monad.State
import "monads-tf" Control.Monad.E... | YoshikuniJujo/xmpipe | core/Network/XMPiPe/Core/S2S/Client.hs | Haskell | bsd-3-clause | 2,569 |
module PyHint.Message (
Message(..),
) where
import Language.Py.SrcLocation (SrcSpan)
data Message = Message String String SrcSpan deriving (Show)
| codeq/pyhint | src/PyHint/Message.hs | Haskell | bsd-3-clause | 151 |
{-# LANGUAGE PackageImports #-}
import "monads-tf" Control.Monad.Trans
import Control.Applicative
import Data.Conduit
import qualified Data.Conduit.List as CL
import Data.Conduit.Lazy
import Data.Time
times :: Int -> ConduitM i UTCTime IO ()
times 0 = return ()
times n = lift getCurrentTime >>= yield >> times (n - 1)... | YoshikuniJujo/simple-pipe | try/testConduitLazy.hs | Haskell | bsd-3-clause | 321 |
module Text.Highlighter.Lexers.Modelica (lexer) where
import qualified Text.Highlighter.Lexers.Html as Html
import Text.Regex.PCRE.Light
import Text.Highlighter.Types
lexer :: Lexer
lexer = Lexer
{ lName = "Modelica"
, lAliases = ["modelica"]
, lExtensions = [".mo"]
, lMimetypes = ["text/x-modelica"]
... | chemist/highlighter | src/Text/Highlighter/Lexers/Modelica.hs | Haskell | bsd-3-clause | 3,475 |
module Spec.Tag where
data Tag = Tag{ tName :: String
, tAuthor :: String
, tContact :: String
}
deriving(Show)
| oldmanmike/vulkan | generate/src/Spec/Tag.hs | Haskell | bsd-3-clause | 163 |
-- |
-- Module: Scheduling
-- Description: Rule scheduling
-- Copyright: (c) 2013 Tom Hawkins & Lee Pike
--
-- Algorithms for scheduling rules in Atom
module Language.Atom.Scheduling
( schedule
, Schedule
, reportSchedule
) where
import Text.Printf
import Data.List
import Language.Atom.Analysis
import Langu... | Copilot-Language/atom_for_copilot | Language/Atom/Scheduling.hs | Haskell | bsd-3-clause | 5,686 |
-- munt - cryptographic function composition
import qualified Options.Applicative as Opts
import qualified Options.Applicative.Help.Chunk as OAHC
import qualified System.IO as IO
import qualified System.Process as Proc
import Data.List (intercalate)
import Options.Applicative ((<>))
import Text.Printf (printf)
impor... | shmookey/bc-tools | src/munt.hs | Haskell | bsd-3-clause | 3,474 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeOperators #-}
module Evaluator.Types where
import Protolude
import Evaluator.BuiltIns (builtIns)
import Evaluator.Object
import Parser.AST (Ident)
import Control.Monad.Trans.Class (MonadTrans(..))
newtype EvalError = EvalError Text
deriving... | noraesae/monkey-hs | lib/Evaluator/Types.hs | Haskell | bsd-3-clause | 1,702 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
-- |
-- Module : Statistics.Distribution.ChiSquared
-- Copyright : (c) 2010 Alexey Khudyakov
-- License : BSD3
--
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : portable
--
-- The chi-squared distribution. This is a continuous p... | fpco/statistics | Statistics/Distribution/ChiSquared.hs | Haskell | bsd-2-clause | 3,226 |
{-# LANGUAGE TupleSections #-}
import CoreSyn
import CoreUtils
import Id
import Type
import MkCore
import CallArity (callArityRHS)
import MkId
import SysTools
import DynFlags
import ErrUtils
import Outputable
import TysWiredIn
import Literal
import GHC
import Control.Monad
import Control.Monad.IO.Class
import System.En... | olsner/ghc | testsuite/tests/callarity/unittest/CallArity1.hs | Haskell | bsd-3-clause | 9,920 |
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.List
import StackTest
main :: IO ()
main = repl [] $ do
replCommand ":main"
line <- replGetLine
when (line /= "Hello World!")
$ error "Main module didn't load correctly."
| AndrewRademacher/stack | test/integration/tests/module-added-multiple-times/Main.hs | Haskell | bsd-3-clause | 256 |
{-
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | Ye-Yong-Chi/codeworld | codeworld-base/src/GHC/Pack.hs | Haskell | apache-2.0 | 731 |
module Main where
import Prelude hiding (lines)
import Control.Monad
import Data.IORef
import Data.Time.Clock
import Graphics.Rendering.OpenGL (($=))
import qualified Graphics.Rendering.OpenGL as GL
import qualified Graphics.UI.GLUT as GLUT
import Game
import Keyboard
import Matrix
fps :: (Fractional a) => a
fps = 1... | sordina/purewars | Main.hs | Haskell | bsd-3-clause | 2,469 |
module Tuura.Concept (
module Data.Monoid,
module Tuura.Concept.Abstract,
module Tuura.Concept.Circuit,
) where
import Data.Monoid
import Tuura.Concept.Abstract
import Tuura.Concept.Circuit
| tuura/concepts | src/Tuura/Concept.hs | Haskell | bsd-3-clause | 207 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.Plane
-- Copyright : (c) Marco Túlio Gontijo e Silva <marcot@riseup.net>,
-- Leonardo Serra <leoserra@minaslivre.org>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : ... | markus1189/xmonad-contrib-710 | XMonad/Actions/Plane.hs | Haskell | bsd-3-clause | 7,811 |
module Main where
import Load
main = testload
| abuiles/turbinado-blog | tmp/dependencies/hs-plugins-1.3.1/testsuite/pdynload/bayley1/prog/Main.hs | Haskell | bsd-3-clause | 47 |
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
module Network.Wai.Handler.Warp.SendFile (
sendFile
, readSendFile
, packHeader -- for testing
#ifndef WINDOWS
, positionRead
#endif
) where
import Control.Monad (void, when)
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import Ne... | utdemir/wai | warp/Network/Wai/Handler/Warp/SendFile.hs | Haskell | mit | 4,692 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP #-}
module BuildTyCl (
buildSynonymTyCon,
buildFamilyTyCon,
buildAlgTyCon,
buildDataCon,
buildPatSyn,
TcMethInfo, buildClass,
distinctAbstractTyCo... | forked-upstream-packages-for-ghcjs/ghc | compiler/iface/BuildTyCl.hs | Haskell | bsd-3-clause | 14,205 |
<?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="pl-PL">
<title>Passive Scan Rules | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<... | kingthorin/zap-extensions | addOns/pscanrules/src/main/javahelp/org/zaproxy/zap/extension/pscanrules/resources/help_pl_PL/helpset_pl_PL.hs | Haskell | apache-2.0 | 982 |
module Multi2 where
import Multi1
g = fib fib_gen 46
| RefactoringTools/HaRe | old/testing/introThreshold/Multi2_TokOut.hs | Haskell | bsd-3-clause | 55 |
module ListSort () where
import Language.Haskell.Liquid.Prelude
append k [] ys = k:ys
append k (x:xs) ys = x:(append k xs ys)
takeL x [] = []
takeL x (y:ys) = if (y<x) then y:(takeL x ys) else takeL x ys
takeGE x [] = []
takeGE x (y:ys) = if (y>=x) then y:(takeGE x ys) else takeGE x ys
{-@ quicksort ... | ssaavedra/liquidhaskell | tests/neg/ListQSort.hs | Haskell | bsd-3-clause | 763 |
{-# LANGUAGE CPP, FlexibleContexts, OverloadedStrings, TupleSections, ScopedTypeVariables, ExtendedDefaultRules, LambdaCase #-}
module Main where
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import Control.Lens (over, _1)
import Contro... | beni55/ghcjs | test/TestRunner.hs | Haskell | mit | 30,626 |
module T11167 where
data SomeException
newtype ContT r m a = ContT {runContT :: (a -> m r) -> m r}
runContT' :: ContT r m a -> (a -> m r) -> m r
runContT' = runContT
catch_ :: IO a -> (SomeException -> IO a) -> IO a
catch_ = undefined
foo :: IO ()
foo = (undefined :: ContT () IO a)
`runContT` (undefined ::... | olsner/ghc | testsuite/tests/rename/should_compile/T11167.hs | Haskell | bsd-3-clause | 542 |
{-# LANGUAGE StaticPointers #-}
module StaticPointers01 where
import GHC.StaticPtr
f0 :: StaticPtr (Int -> Int)
f0 = static g
f1 :: StaticPtr (Bool -> Bool -> Bool)
f1 = static (&&)
f2 :: StaticPtr (Bool -> Bool -> Bool)
f2 = static ((&&) . id)
g :: Int -> Int
g = id
| ghc-android/ghc | testsuite/tests/typecheck/should_compile/TcStaticPointers01.hs | Haskell | bsd-3-clause | 274 |
{-# LANGUAGE Rank2Types #-}
-- Tests subsumption for infix operators (in this case (.))
-- Broke GHC 6.4!
-- Now it breaks the impredicativity story
-- (id {a}) . (id {a}) :: a -> a
-- And (forall m. Monad m => m a) /~ IO a
module Main(main) where
foo :: (forall m. Monad m => m a) -> IO a
foo = id . id
main :: I... | urbanslug/ghc | testsuite/tests/typecheck/should_run/tcrun035.hs | Haskell | bsd-3-clause | 348 |
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..))
import Control.Monad (void)
import DNA (hammingDistance)
testCase :: String -> Assertion -> Test
testCase label assertion = TestLabel label (TestCase assertion)
main :: IO ()
main = void $ runTestTT $ TestList
[ TestList hammingDistanceTests ]
hammingD... | tfausak/exercism-solutions | haskell/point-mutations/point-mutations_test.hs | Haskell | mit | 1,630 |
module TestSuites.ParserCSVSpec (spec) where
import Test.Hspec.Contrib.HUnit(fromHUnitTest)
import Test.HUnit
import HsPredictor.ParserCSV
import HsPredictor.Types
spec = fromHUnitTest $ TestList [
TestLabel ">>readMatches" test_readMatches
]
test_readMatches = TestCase $ do
let r1 = ["2012.08.24,Dortmund,Bre... | Taketrung/HsPredictor | tests/TestSuites/ParserCSVSpec.hs | Haskell | mit | 1,458 |
-- |
-- Module: BigE.TextRenderer.Font
-- Copyright: (c) 2017 Patrik Sandahl
-- Licence: MIT
-- Maintainer: Patrik Sandahl <patrik.sandahl@gmail.com>
-- Stability: experimental
-- Portability: portable
module BigE.TextRenderer.Font
( Font (..)
, fromFile
, enable
, disable
, delete
) where
impo... | psandahl/big-engine | src/BigE/TextRenderer/Font.hs | Haskell | mit | 3,787 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, UndecidableInstances #-}
{- |
The HList library
(C) 2004-2006, Oleg Kiselyov, Ralf Laemmel, Keean Schupke
A model of label as needed for extensible records.
Record labels are simply type-level naturals.
This models is as simple and as portable as... | bjornbm/HList-classic | Data/HList/Label1.hs | Haskell | mit | 991 |
{-# LANGUAGE QuasiQuotes #-}
import Here
str :: String
str = [here|test
test
test test |]
main :: IO()
main = do putStrLn str
| Pnom/haskell-ast-pretty | Test/examples/QuasiQuoteLines.hs | Haskell | mit | 132 |
module Shipper.Outputs (
startDebugOutput,
startZMQ4Output,
startRedisOutput,
) where
import Shipper.Outputs.Debug
import Shipper.Outputs.ZMQ4
import Shipper.Outputs.Redis
| christian-marie/pill-bug | Shipper/Outputs.hs | Haskell | mit | 185 |
module Analysis where
data Criticality = Maximum | Minimum | Inflection
deriving (Eq, Show, Read)
data Extremum p = Extremum
{ exPoint :: p
, exType :: Criticality
} deriving (Eq, Show)
instance Functor Extremum where
fmap f (Extremum p c) = Extremum (f p) c
extremum :: (Fractional t, Ord t) =>... | neilmayhew/Tides | Analysis.hs | Haskell | mit | 1,094 |
module Game.Client where
import Network.Simple.TCP
import Control.Concurrent.MVar
import Control.Applicative
import Game.Position
import Game.Player
import qualified Game.GameWorld as G
import qualified Game.Resources as R
import qualified Game.Unit as U
-- | Client kuvaa koko asiakasohjelman tilaa
data Client = Clie... | maqqr/psycho-bongo-fight | Game/Client.hs | Haskell | mit | 1,318 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Views.Pages.Error (errorView) where
import BasicPrelude
import Text.Blaze.Html5 (Html, toHtml, (!))
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
import Routes (Route)
import Views.Layout (layoutV... | nicolashery/example-marvel-haskell | Views/Pages/Error.hs | Haskell | mit | 572 |
import Control.Applicative
import Data.Char
import Data.Tuple
newtype Parser result = Parser { runParser :: String ->
[(String, result)] }
succeed :: r -> Parser r
succeed v = Parser $ \stream -> [(stream, v)]
instance Functor Parser where
fmap f (Parser pattern) = P... | markstoehr/cs161 | _site/fls/Lab5_flymake.hs | Haskell | cc0-1.0 | 1,570 |
{-# LANGUAGE OverloadedStrings #-}
{-
Copyright 2019 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENS... | alphalambda/codeworld | codeworld-error-sanitizer/test/Main.hs | Haskell | apache-2.0 | 1,410 |
{-# LANGUAGE TypeOperators #-}
------------------------------------------------------------------------------
module OpenArms.App where
------------------------------------------------------------------------------
import Control.Monad.Reader
import Servant
import Network.Wai
import Control.Monad.Trans.Either
---------... | dmjio/openarms | src/OpenArms/App.hs | Haskell | bsd-2-clause | 969 |
{-# LANGUAGE DataKinds, RecordWildCards, TypeOperators #-}
module Sprockell where
import CLaSH.Prelude
{-------------------------------------------------------------
| SPROCKELL: Simple PROCessor in hasKELL :-)
|
| j.kuper@utwente.nl
| October 28, 2012
-------------------------------------------------------... | christiaanb/clash-compiler | examples/Sprockell.hs | Haskell | bsd-2-clause | 11,221 |
-- 161667
import Data.List(sort, group)
nn = 1500000
-- generate all primitive pythagorean triples w/ Euclid's formula
-- a = m^2 - n^2, b = 2mn, c = m^2 + n^2
-- m - n is odd and m and n are coprime
genTri x m n
| n >= m = genTri x (m+1) 1 -- invalid pair, next m
| n == 1 && p > x = [] -... | higgsd/euler | hs/75.hs | Haskell | bsd-2-clause | 947 |
{-# LANGUAGE TypeSynonymInstances, TypeOperators, FlexibleInstances,
StandaloneDeriving, DeriveFunctor, DeriveFoldable,
DeriveTraversable #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Xournal.Select
-- Copyright : (c) 2011, ... | wavewave/xournal-types | src/Data/Xournal/Select.hs | Haskell | bsd-2-clause | 4,701 |
module Day14_2 where
import Data.List
import Data.List.Split
type DeerInfo = (Int, String, Int, Int, Int)
main :: IO ()
main = do
f <- readFile "input.txt"
let deers = map parse $ map (splitOn " ") (lines f)
distAt = [distanceAtTime d 1 | d <- deers]
score = foldl calc deers [1..2503]
... | ksallberg/adventofcode | 2015/src/Day14_2.hs | Haskell | bsd-2-clause | 1,508 |
module Infinity.Util (
-- * Functions
unlessM, whenM, mkdate, mktime, mkdir, ci,
run,
-- * Types
User, Channel, Command, Nick, Cmds
) where
import Data.List
import System.IO
import System.Exit
import System.Time
import Control.Monad
import System.Process
import System.FilePath
import System.Directory
import Contro... | thoughtpolice/infinity | src/Infinity/Util.hs | Haskell | bsd-3-clause | 2,442 |
module Sword.Daemon where
import Prelude hiding (Either(..))
import qualified Data.Map as Map
import Data.Time (UTCTime, getCurrentTime, diffUTCTime)
import Network.Socket
import System.IO
import Control.Exception
import Control.Concurrent
import Control.Concurrent.Chan
import Control.Monad
import Control.Monad.Fix (f... | kmerz/the_sword | src/Sword/Daemon.hs | Haskell | bsd-3-clause | 3,924 |
-- Turnir -- a tool for tournament management.
--
-- Author : Ivan N. Veselov
-- Created: 20-Sep-2010
--
-- Copyright (C) 2010 Ivan N. Veselov
--
-- License: BSD3
--
-- | Pretty printing of miscelanneous data structures.
-- Uses wonderful HughesPJ pretty-printing combinator library.
--
module Pretty (
ppTable,
ppRo... | sphynx/turnir | src/Pretty.hs | Haskell | bsd-3-clause | 3,320 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit
import Text.IPv6Addr
main :: IO ()
main = defaultMain $ hUnitTestToTests tests
tests :: Test.HUnit.Test
tests = TestList
[ (~?=) (maybeIPv6Addr ":") Nothing
, (~?=) (maybeIPv6Addr... | MichelBoucey/IPv6Addr | tests/Main.hs | Haskell | bsd-3-clause | 7,625 |
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE RecordWildCards #-}
module Refact.Fixity (applyFixities) where
import SrcLoc
import Refact.Utils
import BasicTypes (Fixity(..), defaultFixity, compareFixity, negateFixity, FixityDirection(..))
import HsExpr
import RdrName
import OccName
import ... | bitemyapp/apply-refact | src/Refact/Fixity.hs | Haskell | bsd-3-clause | 5,164 |
{-
Copyright (c) 2015, Joshua Brot
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the fol... | Pamelloes/AAGenAlg | Setup.hs | Haskell | bsd-3-clause | 1,572 |
module IptAdmin.AddChainPage where
import Control.Monad.Error
import Happstack.Server.SimpleHTTP
import IptAdmin.EditChainForm.Parse
import IptAdmin.EditChainForm.Render
import IptAdmin.Render
import IptAdmin.System
import IptAdmin.Types
import IptAdmin.Utils
import Iptables
import Iptables.Types
import Text.ParserCo... | etarasov/iptadmin | src/IptAdmin/AddChainPage.hs | Haskell | bsd-3-clause | 2,515 |
{-# LANGUAGE RecordWildCards #-}
module Main (main) where
import Control.Monad
import Data.Binary.Get
import qualified Data.ByteString.Lazy as BL
import Data.List
import Text.Printf
import Codec.Tracker.S3M
import Codec.Tracker.S3M.Header
import C... | riottracker/modfile | examples/readS3M.hs | Haskell | bsd-3-clause | 2,265 |
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Typeable
import Control.Exception
import GHC.IO.Exception
import System.IO
import Network
main :: IO ()
main = test `catch` ioHandle
test :: IO ()
test = do
h <- connectTo "localhost" $ PortNumber 54492
hGetLine h >>= putStrLn
(hGetLine h >>= putStrLn) `catch` ioH... | YoshikuniJujo/xmpipe | test/exClient.hs | Haskell | bsd-3-clause | 539 |
module Graphics.Pastel.WX
( module Graphics.Pastel.WX.Draw
, module Graphics.Pastel.WX.Test
) where
import Graphics.Pastel.WX.Draw
import Graphics.Pastel.WX.Test
| willdonnelly/pastel | Graphics/Pastel/WX.hs | Haskell | bsd-3-clause | 175 |
module GameStage
( GameStage
, gameStage
) where
import Control.Applicative
import Control.Monad
import Data.Set
import qualified Data.Map as M
import qualified Data.List as L
import Data.Unique
import qualified Class.GameScene as GS
import Class.Sprite
import KeyBind
import GlobalValue
import qualified Sound ... | c000/PaperPuppet | src/GameStage.hs | Haskell | bsd-3-clause | 5,848 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
Utility functions on @Core@ syntax
-}
{-# LANGUAGE CPP #-}
-- | Commonly useful utilites for manipulating the Core language
module CoreUtils (
-- * Constructing expressions
mkCast,
mkTick, mkTicks... | nushio3/ghc | compiler/coreSyn/CoreUtils.hs | Haskell | bsd-3-clause | 88,132 |
module Main where
import Data.Lens.Common ((^.), (^=))
import Prelude hiding (Either(..))
import System.Console.ANSI
import System.IO
import Console
import Level
import Types
-- operator to add 2 coordinates together
(|+|) :: Coord -> Coord -> Coord
(|+|) (x1, y1) (x2, y2) = (x1 + x2, y1 + y2)
-- receive a charac... | jamiltron/Thieflike | src/Main.hs | Haskell | bsd-3-clause | 2,227 |
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-}
{-# OPTIONS_GHC -fcontext-stack47 #-}
module Games.Chaos2010.Database.Spells_with_order where
import Games.Chaos2010.Database.Fields
import Database.HaskellDB.DBLayout
type Spells_with_order =
Record
(HCons (LVPair Spell_category (Expr (Maybe String))... | JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Spells_with_order.hs | Haskell | bsd-3-clause | 826 |
module Euler.E2
( fib
, every
)
where
fib :: [Int]
fib = scanl (+) 1 (1:fib)
every :: Int -> [a] -> [a]
every _ [] = []
every n (x:xs) = x : every n (drop (n-1) xs)
| lslah/euler | src/Euler/E2.hs | Haskell | bsd-3-clause | 184 |
module Language.GDL.Unify
( Substitution
, unify
) where
import qualified Data.Map as M
import Language.GDL.Syntax
type Substitution = M.Map Identifier Term
occurs :: Identifier -> Term -> Bool
occurs _ (Atom _) = False
occurs ident (Var identr) = ident == identr
occurs ident (Compound children... | ian-ross/ggp | Language/GDL/Unify.hs | Haskell | bsd-3-clause | 1,333 |
module WASH.CGI.AbstractSelector
-- the public interface
-- ( as_rows, as_cols, table_io, getText, selectionGroup, selectionButton, selectionDisplay)
where
import WASH.CGI.BaseCombinators (unsafe_io, once)
import WASH.CGI.CGIInternals (HTMLField, INVALID, ValidationError (..))
import WASH.CGI.CGIMonad hiding (lif... | nh2/WashNGo | WASH/CGI/AbstractSelector.hs | Haskell | bsd-3-clause | 7,097 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Bits.Lens
-- Copyright : (C) 2012-14 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Edward Kmett <ekmett@gmail.com... | hvr/lens | src/Data/Bits/Lens.hs | Haskell | bsd-3-clause | 7,823 |
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.NoBorders
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
main = do
xmobarProcess <- spawnPipe "start-xmobar"
trayerProcess <- spawnPipe "start-trayer"
xmonad $ default... | justinlynn/monadix | src/Main.hs | Haskell | bsd-3-clause | 949 |
module ClassInContext where
class FFF a where
fff :: a -> a
data S a = S a
instance FFF Int where
fff x = x
instance (Eq a, FFF a) => Eq (S a) where
(S x) == (S y) = (fff x) == (fff y)
cmpr :: S Int -> S Int -> Bool
cmpr = (==)
| phischu/fragnix | tests/quick/ClassInContext/ClassInContext.hs | Haskell | bsd-3-clause | 246 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE PatternGuards #-}
module AddHandler (addHandler) where
import Prelude hiding (readFile)
import System.IO (hFlush, stdout)
import Data.Char (isLower, toLower, isSpace)
import Data.List (isPrefixOf, isSuffixOf, stripPrefix)
import Data.Maybe (fromMaybe, listToMaybe)
import qualified ... | geraldus/yesod | yesod-bin/AddHandler.hs | Haskell | mit | 8,191 |
module RecursiveRef where
{-# ANN module "HLint: ignore Eta reduce" #-}
-- Recursive function call without type signature targets the monomorphic
-- binding. This verifies that we handle the case.
-- - @recNoSig defines/binding FunRNS
recNoSig x =
-- - @recNoSig ref FunRNS
recNoSig x
-- - @localRecNoSig ref F... | google/haskell-indexer | kythe-verification/testdata/basic/RecursiveRef.hs | Haskell | apache-2.0 | 997 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
-- |
-- Module : Documentation.Haddock.Parser
-- Copyright : (c) Mateusz Kowalczyk 2013-2014,
-- Simon Hengel 2013
-- License : BSD-like
--
-- Maintainer : haddock@projects.haskell.org
-- Stability : experimental... | Fuuzetsu/haddock | haddock-library/src/Documentation/Haddock/Parser.hs | Haskell | bsd-2-clause | 29,240 |
module Settings.Packages.Base (basePackageArgs) where
import Expression
import Settings
basePackageArgs :: Args
basePackageArgs = package base ? do
integerLibraryName <- pkgName <$> getIntegerPackage
mconcat [ builder GhcCabal ? arg ("--flags=" ++ integerLibraryName)
-- This fixes the 'unknown sym... | bgamari/shaking-up-ghc | src/Settings/Packages/Base.hs | Haskell | bsd-3-clause | 471 |
module Graphics.Gnuplot.Frame (
Frame.T,
cons, simple, empty,
) where
import qualified Graphics.Gnuplot.Frame.OptionSet as OptionSet
import qualified Graphics.Gnuplot.Private.Frame as Frame
import qualified Graphics.Gnuplot.Private.Plot as Plot
import qualified Graphics.Gnuplot.Private.GraphEmpty as Empty
imp... | wavewave/gnuplot | src/Graphics/Gnuplot/Frame.hs | Haskell | bsd-3-clause | 597 |
{-# LANGUAGE DeriveDataTypeable, PatternGuards #-}
module Tim.Smallpt.Render(
Context(..),
Refl(..),
Sphere(..),
Vec(..),
Work(..),
(|*|),
(|+|),
(|-|),
clamp,
cross,
dot,
line,
makeWork,
norm,
vmult) where
import Control.Applicative
import Control.Monad.State
import Data.Data
import... | timrobinson/smallpt-haskell | Tim/Smallpt/Render.hs | Haskell | bsd-3-clause | 10,331 |
{- |
Module : Database.HDBC.PostgreSQL
Copyright : Copyright (C) 2005-2011 John Goerzen
License : BSD3
Maintainer : John Goerzen <jgoerzen@complete.org>
Stability : provisional
Portability: portable
HDBC driver interface for PostgreSQL 8.x
Written by John Goerzen, jgoerzen\@complete.org
/... | cabrera/hdbc-postgresql | Database/HDBC/PostgreSQL.hs | Haskell | bsd-3-clause | 2,143 |
-----------------------------------------------------------------------------
-- |
-- Module : RefacSlicing
-- Copyright : (c) Christopher Brown 2005
--
-- Maintainer : cmb21@kent.ac.uk
-- Stability : provisional
-- Portability : portable
--
-- This module contains a transformation for HaRe.
-- Symoblic ... | kmate/HaRe | old/refactorer/RefacSlicing.hs | Haskell | bsd-3-clause | 6,790 |
module Poly4 () where
import Language.Haskell.Liquid.Prelude
x = choose 0
baz y = y
prop = liquidAssertB (baz True)
| abakst/liquidhaskell | tests/pos/poly4.hs | Haskell | bsd-3-clause | 125 |
module Test10 where
f x = x + y where y = 37
g = 1 + 37
| SAdams601/HaRe | old/testing/refacFunDef/Test10_AstOut.hs | Haskell | bsd-3-clause | 59 |
{-# LANGUAGE TemplateHaskell #-}
-- test the representation of unboxed literals
module Main
where
$(
[d|
foo :: Int -> Int
foo x
| x == 5 = 6
foo x = 7
|]
)
$(
[d|
bar :: Maybe Int -> Int
bar x
| Just y <- x = y
bar _ = 9
|]
)
... | danse/ghcjs | test/ghc/th/tH_repGuardOutput.hs | Haskell | mit | 484 |
-- There was a lot of discussion about various ways of computing
-- Bernouilli numbers (whatever they are) on haskell-cafe in March 2003
-- Here's one of the programs.
-- It's not a very good test, I suspect, because it manipulates big integers,
-- and so probably spends most of its time in GMP.
import Data.Ratio
i... | beni55/ghcjs | test/nofib/imaginary/bernouilli/Main.hs | Haskell | mit | 1,320 |
{-# LANGUAGE RankNTypes #-}
module T9196 where
f :: (forall a. Eq a) => a -> a
f x = x
g :: (Eq a => Ord a) => a -> a
g x = x
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_fail/T9196.hs | Haskell | bsd-3-clause | 128 |
module Channel where
import qualified Data.ByteString as Bs
import qualified Data.Set as S
import qualified Control.Concurrent as C (ThreadId)
import qualified Network.Socket as So hiding (send, sendTo, recv, recvFrom)
-- | Holds the configuration of a channel.
data ChannelConfig = ChannelConfig {
socket :: So.S... | Autopawn/haskell-secureUDP | Channel.hs | Haskell | mit | 4,347 |
module GroupCreator.Evaluation
( Condition(..)
, fitness
) where
import GroupCreator.Groupings
import GroupCreator.People
import Data.List
import Data.Ord
import Data.Map
import Data.Hash (hash, asWord64)
data Condition = SizeRestriction { groupSize :: Int }
--make groups of this many people
... | cambraca/group-creator | GroupCreator/Evaluation.hs | Haskell | mit | 2,580 |
{-# htermination index :: Ix a => (a,a) -> a -> Int #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_index_1.hs | Haskell | mit | 56 |
module Language.Lua.AST where
import Text.Parsec (SourcePos)
import Language.Lua.Symbol (Intrinsic)
data LuaProgram = LuaProgram FilePath Block deriving(Eq, Ord, Show)
data Block = Block [Statement] (Maybe LastStatement) deriving(Eq, Ord, Show)
data Function = Function SourcePos [Name] Block SourcePos deriving(Eq, O... | ykst/llint | Language/Lua/AST.hs | Haskell | mit | 2,282 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
-- | This module enables debugging all 'ByteString' to 'Text' to 'String' conversions.
-- This is an internal module.
--
-- @since 0.5.67
module B9.Text
( Text,
LazyText,
ByteString,
LazyByteString,
Textual (..),
writeTextFi... | sheyll/b9-vm-image-builder | src/lib/B9/Text.hs | Haskell | mit | 4,306 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE RecordWildCards #-... | unisonweb/platform | parser-typechecker/src/Unison/Codebase/Editor/HandleInput.hs | Haskell | mit | 132,775 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Instances.Response where
import GHC.Generics
import Test.QuickCheck.Arbitrary.Generic
import Test.QuickCheck.Instances()
import Web.Face... | Vlix/facebookmessenger | test/Instances/Response.hs | Haskell | mit | 3,784 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
module WeiXin.PublicPlatform.Conversation.Yesod where
-- {{{1 imports
import ClassyPrelude.Yesod hiding (Proxy, proxy)
import qualified Control.Exception.Safe as ExcSafe
import Control.Monad.Logger
import Data.Proxy
import qualified Data.ByteSt... | yoo-e/weixin-mp-sdk | WeiXin/PublicPlatform/Conversation/Yesod.hs | Haskell | mit | 26,066 |
module Exercise where
perfect :: Int -> Bool
perfect n = sum (delers n) == n
delers :: Int -> [Int]
delers n = [x | x <- [1..n-1], n `mod` x == 0]
perfectTill :: Int -> [Int]
perfectTill n = filter perfect [1..n]
| tcoenraad/functioneel-programmeren | 2012/opg1a.hs | Haskell | mit | 217 |
module Graphics.UI.Gtk.WebKit.WebView.Concrete (
titleChanged,
resourceRequestStarting
) where
import Graphics.UI.Gtk.WebKit.NetworkRequest (NetworkRequest)
import Graphics.UI.Gtk.WebKit.NetworkResponse (NetworkResponse)
import Graphics.UI.Gtk.WebKit.WebFrame (WebFrame)
import Graphics.UI.Gtk.WebKit.WebResource (W... | fmap/hwb | src/Graphics/UI/Gtk/WebKit/WebView/Concrete.hs | Haskell | mit | 795 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
module Examples.Rpc.EchoServer (main) where
import Network.Simple.TCP (serve)
import Capnp.New (SomeServer, def, defaultLimit, export, handleParsed)
import Capnp.Rpc (ConnConfig(..), handleConn, socket... | zenhack/haskell-capnp | examples/lib/Examples/Rpc/EchoServer.hs | Haskell | mit | 817 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent (threadDelay)
import Control.Monad (forever)
import Control.Monad.IO.Class (liftIO)
import Data.Text (Text)
import System.Environment (getArgs)
import System.Random (randomRIO)
import HBar
main :: IO ()
main = do
selection <- head <$> g... | kosmoskatten/plotly-hs | plotly-hbar-demo/src/Main.hs | Haskell | mit | 1,971 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.