code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Drive.Terminal.Handlers
( terminalToDescribeI
, execTerminal
) where
import qualified Data.Text as Text
import qualified Drive ... | palf/free-driver | packages/drive-terminal/lib/Drive/Terminal/Handlers.hs | bsd-3-clause | 1,088 | 0 | 11 | 255 | 299 | 160 | 139 | 22 | 1 |
module Lifted where
import Control.Concurrent.STM (STM, TVar, atomically, readTVarIO)
import Control.Monad (MonadPlus, mzero)
import Control.Monad.IO.Class (MonadIO, liftIO)
-- atomically, but generalised to MonadIO
atomicallyL :: MonadIO io => STM a -> io a
atomicallyL = liftIO... | frublox/aichanbot | src/Lifted.hs | bsd-3-clause | 455 | 0 | 7 | 101 | 116 | 66 | 50 | 8 | 1 |
{-# LANGUAGE UnicodeSyntax #-}
{-|
Module : Math.Haskell.Fractal.HurstExponent
Description : Calculate Hurst Exponent of timer series data
Copyright : (c) m00nlight, 2014-2015
License : BSD3
Stability : experimental
This exponent calculate the Hurst Exponent of time series data using
... | m00nlight/hs-fractal | Math/Haskell/Fractal/HurstExponent.hs | bsd-3-clause | 2,551 | 0 | 14 | 579 | 442 | 243 | 199 | 29 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-|
Module : AERN2.MP.Float.Auxi
Description : Auxiliary structures
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental
Portability : portable
... | michalkonecny/aern2 | aern2-mp/src/AERN2/MP/Float/Auxi.hs | bsd-3-clause | 763 | 0 | 8 | 187 | 136 | 81 | 55 | 17 | 1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.EXT.BlendFuncSeparate
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portab... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/EXT/BlendFuncSeparate.hs | bsd-3-clause | 820 | 0 | 4 | 110 | 51 | 41 | 10 | 7 | 0 |
module Utils where
import Control.Monad (ap, liftM, liftM2)
import Data.Char (isNumber)
import Data.List (genericLength)
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as U
import Numeric.LinearAlgebra (Matrix, ... | emmanueldenloye/manifoldRNC | src/Utils.hs | bsd-3-clause | 2,880 | 0 | 13 | 914 | 871 | 476 | 395 | 59 | 3 |
import System.Posix.Interaction(Interaction(..), OStream(..), testProgram)
-- throw-away example demonstrating Interactions
main :: IO ()
main = testProgram "/usr/bin/head" ["-1"] Nothing True (Interactions [Feed "apa\n", Expect (Just 2) StdOut "apa\n"])
| GaloisInc/sk-dev-platform | libs/SCD/src/System/Posix/Test.hs | bsd-3-clause | 257 | 0 | 11 | 30 | 84 | 47 | 37 | 3 | 1 |
module Config
( initConfig
, readConfig
, dropConfigs
) where
import Events
import Data.ConfigFile
import Network.SimpleIRC
import System.Directory
import Control.Monad.Except
import Control.Monad
import Data.List
--import qualified System.IO.UTF8 as I
initConfig :: IO (FilePath,[FilePath])
initConfig = do
-- hom... | raposalorx/mssbot | Config.hs | bsd-3-clause | 1,776 | 0 | 14 | 547 | 482 | 250 | 232 | 40 | 2 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Math.Functor.Faithful where
import Data.Constraint
import Math.Category
import Math.Functor
import Prelude (($))
class Functor f => FullyFaithful f where
unfmap :: Cod f (f a) (f b) -> Dom f a b
instance FullyFaithful Dict where
unfmap f = Sub $ f ... | ekmett/categories | src/Math/Functor/Faithful.hs | bsd-3-clause | 453 | 0 | 10 | 87 | 175 | 92 | 83 | -1 | -1 |
module Code28_WarmingUp where
import Data.List (unfoldr)
import Prelude hiding (reverse,concat)
import qualified Prelude as P
loopless = unfoldr step . prolog
-- Four warm-up exercises
-- (1) id_L
id_L :: [a] -> [a]
id_L = unfoldr uncons . prolog
prolog :: [a] -> [a]
prolog = id
uncons :: [a] -> May... | sampou-org/pfad | Code/Code28_WarmingUp.hs | bsd-3-clause | 1,192 | 0 | 12 | 354 | 549 | 307 | 242 | 30 | 2 |
module Seed where
import Rumpus
start :: Start
start = do
myCodeHidden ==> True
setShape Sphere
setSize 0.2
setColor (V4 0.2 0.3 0.1 1)
setBody Physical
myCollisionBegan ==> \_ _ -> do
isHeld <- isBeingHeld
when (not isHeld) $ do
removeComponent myCo... | lukexi/rumpus | pristine/Room/Seed.hs | bsd-3-clause | 516 | 0 | 16 | 196 | 163 | 72 | 91 | 18 | 1 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Output.Common where
import Control.Lens
import Data.Text (Text)
import NewTTRS.Law
import Text.Blaze.Html (preEscapedToHtml)
import Text.Hamlet
import qualified Data.Text as Text
import DataStore
import Player
import Output.Formatting
graphStddevCutoff :: Double... | glguy/tt-ratings | Output/Common.hs | bsd-3-clause | 3,350 | 0 | 12 | 788 | 658 | 361 | 297 | 62 | 3 |
-- clock (on console, for now)
-- todo: add a UI clock.
module Main
( main
) where
import Sirea.Prelude
import Sirea.Clock
import Sirea.Time
import Control.Exception (assert)
-- a better way to show the clock...
timeString :: T -> String
timeString t =
let nDay = tmNanos t in
let sDay = nDay `di... | dmbarbour/Sirea | tst/Clock.hs | bsd-3-clause | 944 | 0 | 17 | 287 | 302 | 158 | 144 | 24 | 2 |
{- |
Module : ./CommonLogic/ClTests.hs
Description : Parser of common logic interface format
Copyright : (c) Karl Luc, DFKI Bremen 2010
License : GPLv2 or higher, see LICENSE.txt
Maintainer : kluc@informatik.uni-bremen.de
Stability : provisional
Portability : portable
-- Tests and examples of Com... | spechub/Hets | CommonLogic/ClTests.hs | gpl-2.0 | 2,928 | 0 | 29 | 586 | 779 | 400 | 379 | 70 | 1 |
module AST.Node where
-- import AST.Type
--
import AST.Type.Vector
import AST.Type.Scalar
import AST.Function.Operator
import AST.Function.Lambda
import AST.Function.Basic
-- We could view all the AST nodes as a set of 3 subsets:
-- 1. Subset of Term, which consists the node of Array, Vector and Scalar.
-- 2. Subse... | VELVETDETH/MiniAcc | AST/Node.hs | apache-2.0 | 1,297 | 0 | 8 | 375 | 221 | 130 | 91 | 27 | 1 |
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.ByteString.Lazy
-- Copyright : (c) Paolo Martini 2007
-- License : BSD-style (see the LICENSE file)
--
-- Maintainer : derek.a.elkins@gmail.com
-- Stability : provisional
... | aslatter/parsec | src/Text/Parsec/ByteString/Lazy.hs | bsd-2-clause | 1,369 | 0 | 10 | 289 | 163 | 101 | 62 | 12 | 1 |
{-# OPTIONS -fglasgow-exts #-}
module HJS.Interpreter.VarArgs where
class BuildList a r | r-> a where
build' :: [a] -> a -> r
instance Show a => BuildList a [String] where
build' l x = reverse $ (show x):(map show l)
instance BuildList a b => BuildList a (a->b) where
build' l x y = build' (x:l... | disnet/jscheck | src/HJS/Interpreter/VarArgs.hs | bsd-3-clause | 357 | 0 | 9 | 95 | 144 | 76 | 68 | -1 | -1 |
-- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai
main = if True
then print 12
else print 42
| mpickering/ghc-exactprint | tests/examples/ghc710/IfThenElse2.hs | bsd-3-clause | 106 | 0 | 6 | 20 | 21 | 11 | 10 | 3 | 2 |
-- | Various JSON-related classes and helper functions not provided by Aeson
module Unison.JSON where
import Data.Aeson (ToJSON(..), FromJSON(..))
import Data.Text (Text)
import Data.Vector ((!?))
import qualified Data.Aeson as J
import qualified Data.Aeson.Types as Aeson
import qualified Data.Vector as Vector
class... | nightscape/platform | shared/src/Unison/JSON.hs | mit | 1,035 | 0 | 12 | 189 | 341 | 185 | 156 | 20 | 1 |
import Test.Hspec
t :: [String] -> [String]
b :: [String] -> [String]
h :: [String] -> Bool
z :: String -> Bool
d :: String -> String
(%) :: a -> [a] -> [a]
i :: String -> Bool
l :: String -> String
a :: (a -> b) -> (a -> b) -> [a] -> [b]
m :: [a] -> [a]
-- Not posting this because it is a lot larger than the existin... | clupascu/codegolf | 135541-toggle-the-box/toggleBox_golfed.hs | mit | 1,885 | 0 | 16 | 695 | 704 | 384 | 320 | 67 | 1 |
-- An abstraction layer for shell-related tasks.
{-
Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com>
This file is part of Aura.
Aura is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version ... | joehillen/aura | src/Shell.hs | gpl-3.0 | 5,349 | 0 | 10 | 1,113 | 1,143 | 617 | 526 | 89 | 2 |
{-# language OverloadedLists #-}
{-# language OverloadedStrings #-}
{-# language QuasiQuotes #-}
{-# language TypeApplications #-}
{-# language TypeFamilies #-}
module Planetary.Library.FrankExamples.Test (unitTests) where
import Control.Exception (Exception, throw)
import Control.Lens
import Control.Monad.Except
impo... | joelburget/interplanetary-computation | src/Planetary/Library/FrankExamples/Test.hs | bsd-3-clause | 9,963 | 0 | 25 | 4,247 | 1,101 | 601 | 500 | -1 | -1 |
module Main where
import System.Environment
import System.IO
import System.Process
import System.Locale
import System.Posix.Process
import System.Posix.Files
import System.Posix.Directory
import System.Exit
import qualified Text.Regex.PDeriv.ByteString.LeftToRightD as R
import qualified Data.ByteString.Char8 as S
i... | awalterschulze/xhaskell-regex-deriv | benchmarks/Timer.hs | bsd-3-clause | 2,487 | 0 | 24 | 933 | 853 | 454 | 399 | 59 | 3 |
data Foo = Foo {foo :: (Maybe Foo)} | mpickering/hlint-refactor | tests/examples/Bracket21.hs | bsd-3-clause | 35 | 0 | 10 | 7 | 22 | 12 | 10 | 1 | 0 |
module Main(main) where
import Control.Exception
import Data.Char
import System.Directory
import System.FilePath as FP
import System.IO
import qualified Data.ByteString.Lazy as LBS
import DataConstructors
import E.Main
import E.Program
import E.Rules
import E.Type
import FrontEnd.Class
import Grin.Main(compileToGrin)... | hvr/jhc | src/Main.hs | mit | 3,651 | 6 | 19 | 943 | 1,184 | 578 | 606 | -1 | -1 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[StgStats]{Gathers statistical information about programs}
The program gather statistics about
\begin{enumerate}
\item number of boxed cases
\item number of unboxed cases
\item number of let-no-escapes
\item number of non-updatable lets
\item numbe... | olsner/ghc | compiler/simplStg/StgStats.hs | bsd-3-clause | 5,279 | 0 | 13 | 1,558 | 1,016 | 537 | 479 | 93 | 15 |
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FlexibleInstances #-}
module ShouldFail where
import Data.Kind
class C7 a b where
data S7 b :: Type
instance C7 Char (a, Bool) where
data S7 (a, Bool) = S7_1
-- Fails because the arg to S7 should be the
-- same as that to C7
instance C7 Char (a, Int) where
da... | sdiehl/ghc | testsuite/tests/indexed-types/should_fail/SimpleFail9.hs | bsd-3-clause | 342 | 0 | 7 | 72 | 96 | 55 | 41 | -1 | -1 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
module T15592b where
import Data.Kind
class C a where
type T (x :: (f :: k -> Type) a)
| sdiehl/ghc | testsuite/tests/polykinds/T15592b.hs | bsd-3-clause | 148 | 0 | 11 | 31 | 43 | 26 | 17 | -1 | -1 |
module Fixme () where
data F a b c = F (Int -> b -> c)
{- data F a b c = F (x::(Int -> b -> c)) @-}
{-@ bar :: F {v:Int| v >= 0} b c @-}
bar :: F Int b c
bar = undefined
{-@ foo :: F {v:Int| v >= 0} b c -> Int @-}
foo :: F Int b c -> Int
foo = undefined
{-@ hoo :: Int @-}
hoo = foo bar
| mightymoose/liquidhaskell | tests/pos/unusedtyvars.hs | bsd-3-clause | 294 | 0 | 9 | 90 | 80 | 47 | 33 | 7 | 1 |
{-# LANGUAGE QuasiQuotes #-}
module Test where
import QQ
f' = f . (+ 1)
[pq| foo |] -- Expands to f :: Int -> Int
f x = x + 1
| ezyang/ghc | testsuite/tests/quasiquotation/qq009/Test.hs | bsd-3-clause | 137 | 0 | 6 | 43 | 41 | 26 | 15 | 6 | 1 |
-- !!! do & where interaction
module ShouldCompile where
f1 :: IO a -> IO [a]
f1 x = do
v <- x
return [v]
where
g x = [x,x]
f2 :: IO a -> IO [a]
f2 x = do
v <- x
return (g v)
where
g x = [x,x]
f3 :: IO a -> IO [a]
f3 x = do
v <- x
return (g v)
where
g x = [x,x]
| urbanslug/ghc | testsuite/tests/parser/should_compile/read011.hs | bsd-3-clause | 293 | 0 | 9 | 105 | 185 | 93 | 92 | 16 | 1 |
module Main where
data X = X ()
{-# NOINLINE newX #-}
newX :: () -> IO X
newX n = do
let {-# NOINLINE value #-}
value = n
return (X value)
main = do
x <- newX (error "Why?")
case x of
X _ -> return ()
| siddhanathan/ghc | testsuite/tests/stranal/should_run/T2756b.hs | bsd-3-clause | 236 | 0 | 11 | 84 | 102 | 50 | 52 | 12 | 1 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE OverloadedStrings #-}
module Shed.BlobServer where
import qualified Crypto.Hash.SHA1 as SHA1
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Builder as Builder
im... | dbp/shed | src/Shed/BlobServer.hs | isc | 1,307 | 0 | 13 | 294 | 378 | 200 | 178 | 30 | 1 |
zip2 :: [a] -> [b] -> [(a, b)]
zip2 _ [] = []
zip2 [] _ = []
zip2 (x:xs) (y:ys) = (x, y): zip2 xs ys
| v0lkan/learning-haskell | session-003/024-zip-recursive.hs | mit | 101 | 0 | 8 | 27 | 96 | 52 | 44 | 4 | 1 |
module Main where
import LI11718
import qualified Tarefa4_2017li1g180 as T4
import System.Environment
import Text.Read
main = do
args <- getArgs
case args of
["atualiza"] -> do
str <- getContents
let params = readMaybe str
case params of
Nothing -> ... | hpacheco/HAAP | examples/plab/svn/2017li1g180/src/RunT4.hs | mit | 554 | 0 | 17 | 168 | 153 | 79 | 74 | 16 | 4 |
{-# LANGUAGE QuasiQuotes #-}
module View.Doors where
import Model
import View.Helpers
import View.Layout
data DoorView = DoorView {
door :: Entity Door
}
doorsListView :: [DoorView] -> Html
doorsListView doors = layout [shamlet|
<a href="/doors/new">Add a Door
<ul>
$forall view <- doors
$with Entity ... | flipstone/glados | src/View/Doors.hs | mit | 979 | 0 | 9 | 199 | 160 | 91 | 69 | 15 | 1 |
import System.IO
sumofsquares :: Int -> Bool
sumofsquares 0 = False
sumofsquares x = if length (triangles x) > 0 then True else False
triangles :: Int -> [(Int, Int, Int)]
triangles x = [(a,b,x) | c <-[x] , b <- [1..c], a <- [1..b] , a^2 + b^2 == c]
main = do {
n <- readLn :: IO Int;
putStrLn . show $ sumofs... | divayprakash/haskell-course | onlineTest2_problem5.hs | mit | 331 | 0 | 10 | 79 | 185 | 100 | 85 | 9 | 2 |
main = print (foldr1 lcm [1..20]) | emilkloeden/21-days-of-Euler | Haskell/5.hs | mit | 33 | 0 | 8 | 5 | 22 | 11 | 11 | 1 | 1 |
import System.Environment (getArgs)
firstwords :: String -> String
firstwords input = unlines fwords
where
fwords = map fw $ lines input
fw [] = []
fw l = head $ words l
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input)
... | lpenz/realworldhaskell-exercises | ch04/firstword.hs | mit | 649 | 1 | 11 | 187 | 179 | 86 | 93 | 16 | 2 |
module Gshell.Unionfs ( unmountWorkspace
, createWorkspace
, unmountWorkspaces
, generateBranch
) where
import Gshell.Names
import Gshell.State
import Utility.Debug
import System.Exit
import... | ctlab/gShell | src/Gshell/Unionfs.hs | mit | 3,612 | 0 | 17 | 940 | 1,032 | 536 | 496 | -1 | -1 |
module Shexkell.Text.JSON.Control (
ObjectParser
, parseObject
, valueOf
, valueOpt
) where
import Control.Monad.Reader
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
-- | Parsing in the context of a JSON object
type ObjectParser a = ReaderT Object Parser a
parseObject :: Fr... | weso/shexkell | src/Shexkell/Text/JSON/Control.hs | mit | 1,012 | 0 | 9 | 226 | 225 | 128 | 97 | 21 | 1 |
#!/usr/bin/runhaskell
myDrop n xs =
if n <= 0 || null xs
then xs
else myDrop (n - 1) (tail xs)
| borisjoffe/haskell | myDrop.hs | mit | 99 | 6 | 8 | 25 | 55 | 28 | 27 | 4 | 2 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Nunavut.Propogation where
import Control.Lens (Lens', lens)
import Control.Monad.Trans.RWS (RWST)
import Data.Monoid (Monoid, mappend, mempty)
import Numeric.LinearAlgebra (Matrix, fromList, outer, toLis... | markcwhitfield/nunavut | src/Nunavut/Propogation.hs | mit | 4,767 | 0 | 10 | 1,734 | 1,034 | 589 | 445 | 68 | 1 |
{-#LANGUAGE ScopedTypeVariables #-}
{-#LANGUAGE DeriveGeneric #-}
module GenericTypeSpec where
-- Test tools
import Test.Hspec
import Test.QuickCheck
-- Tested modules
import GenericType
-- Additional data
import Foreign.Storable.Generic
import Foreign.Ptr (Ptr)
import Foreign.Marshal.Alloc (malloc)
import D... | mkloczko/derive-storable | test/GenericRep/GenericTypeSpec.hs | mit | 4,469 | 0 | 22 | 1,577 | 871 | 437 | 434 | 63 | 1 |
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
-- | Service API.
module Web.Mackerel.Api.Service
( listServices
, createService
, deleteService
, listServiceMetricNames
) where
import Data.Aeson.TH (deriveJSON)
import qualified Data.ByteString.Char8 as BS
import Network.HTTP.Types (StdMethod(..))
impor... | itchyny/mackerel-client-hs | src/Web/Mackerel/Api/Service.hs | mit | 1,487 | 0 | 10 | 184 | 404 | 220 | 184 | 29 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
import Test.Hspec
import Test.Hspec.QuickCheck (prop)
import Test.QuickCheck.Monadic (assert, monadicIO, run)
import qualified Data.Conduit as C
import qualified Data.Conduit.Util as C
import qualified Data.Conduit.Internal as CI
import qualified Data.Conduit.Lis... | moonKimura/conduit-1.0.8 | test/main.hs | mit | 43,107 | 0 | 35 | 17,358 | 15,926 | 7,901 | 8,025 | -1 | -1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Gen where
import Control.Monad.IO.Class
import Control.Monad.Reader
impo... | TeofilC/Turing | Gen.hs | mit | 3,831 | 0 | 14 | 797 | 1,277 | 638 | 639 | 91 | 3 |
module Y2016.M12.D19.Exercise where
import Codec.Compression.GZip
-- below imports available at the 1HaskellADay git repository
import Data.SymbolTable
import Data.SymbolTable.Compiler
{--
Today and this week we're going to be focusing on the SAIPE/poverty data that
we started to look at last week. But we'll be bre... | geophf/1HaskellADay | exercises/HAD/Y2016/M12/D19/Exercise.hs | mit | 2,848 | 0 | 8 | 488 | 57 | 35 | 22 | 6 | 1 |
{- |
Module : SemanticalAnalysis.hs
Description : .
Maintainer : Christopher Pockrandt
License : MIT
There is no need for a semantical analysis at this time, therefore the function
`process` equals the identity function
-}
module SemanticalAnalysis (
process -- main function of ... | SWP-Ubau-SoSe2014-Haskell/SWPSoSe14 | src/RailCompiler/SemanticalAnalysis.hs | mit | 3,244 | 4 | 16 | 661 | 926 | 492 | 434 | 51 | 3 |
--Project Euler Problem 1
main :: IO()
main = do
y <- return (sum[x | x <- [1..999], mod x 3 == 0 || mod x 5 == 0])
putStrLn("Answer to problem 1 = " ++ show(y))
| calewis/SmallProjectsAndDev | project_euler/haskell/problem_1.hs | mit | 170 | 0 | 16 | 45 | 94 | 46 | 48 | 4 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module Baum.ZweiDrei.Type where
import Autolib.ToDoc
import Autolib.Reader
import Data.Typeable
data Key a = This a | Infinity
deriving ( Typeable, Eq, Ord )
instance Functor Key where
fmap f (This x ) = This ( f x )
fmap f Infinity = Infinity
$(derives [makeReader, ... | marcellussiegburg/autotool | collection/src/Baum/ZweiDrei/Type.hs | gpl-2.0 | 1,080 | 0 | 11 | 293 | 322 | 173 | 149 | 24 | 1 |
module Brainfuck.Generator.JVM (tokensToJVMCode, generateJVMTemplate) where
import Control.Monad.State
import Brainfuck.Tokens
type LabelStack = [Int]
pop :: State LabelStack String
pop = state $ \(x:xs) -> (show x, xs)
push :: State LabelStack String
push = state $ inc
where
inc (x:xs) = (show (x + ... | Nullreff/BF-JVM | src/Brainfuck/Generator/JVM.hs | gpl-3.0 | 2,723 | 0 | 11 | 920 | 697 | 388 | 309 | 86 | 3 |
-- a brutally simple command-line utility to render a Tidal pattern as a WebDirt score
-- usage: renderTidal [cps] [number-of-cycles-to-render]
-- pattern is taken from first line of stdin
-- rendered output goes to stdout
-- if anything is wrong or missing, it will fail silently and output the message "error"
module ... | Moskau/estuary | server/renderTidal.hs | gpl-3.0 | 579 | 0 | 16 | 116 | 114 | 59 | 55 | 10 | 2 |
module Main ( main ) where
import Test.Framework
import Properties
import StoreTest
main :: IO ()
main = defaultMain
[ testGroup "properties" testProperties
, storeTests
]
| waldheinz/ads | src/tests/Main.hs | gpl-3.0 | 197 | 0 | 7 | 51 | 49 | 28 | 21 | 8 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-cloudhsm/gen/Network/AWS/CloudHSM/CreateHapg.hs | mpl-2.0 | 3,334 | 0 | 9 | 757 | 447 | 271 | 176 | 55 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/GlobalPublicDelegatedPrefixes/Insert.hs | mpl-2.0 | 5,080 | 0 | 16 | 1,078 | 484 | 292 | 192 | 81 | 1 |
{-# LANGUAGE PatternSynonyms #-}
pattern myLongLeftVariableName `MyLongInfixPatternMatcher` myLongRightVariableName =
[myLongLeftVariableName, myLongRightVariableName]
| lspitzner/brittany | data/Test245.hs | agpl-3.0 | 170 | 0 | 6 | 13 | 22 | 13 | 9 | -1 | -1 |
module Foreign.MathJax where
typeset :: String -> IO ()
typeset _ = return ()
| theam/haskell-do | src/ghc-specific/Foreign/MathJax.hs | apache-2.0 | 80 | 0 | 7 | 16 | 33 | 17 | 16 | 3 | 1 |
--(*) Duplicate the elements of a list.
--
--Example:
--
-- * (dupli '(a b c c d))
--(A A B B C C C C D D)
--Example in Haskell:
--
-- > dupli [1, 2, 3]
--[1,1,2,2,3,3]
dupli :: [a] -> [a]
dupli = foldr copy []
where
copy x acc = x: x: acc
dupli' xs = xs >>= (\x -> [x, x])
| tiann/haskell-learning | haskell99/p14/main.hs | apache-2.0 | 282 | 0 | 8 | 74 | 84 | 50 | 34 | 4 | 1 |
module Application.Hoodle.Database.Command where
import Application.Hoodle.Database.ProgType
import Application.Hoodle.Database.Job
commandLineProcess :: Hoodle_db -> IO ()
commandLineProcess Test = do
putStrLn "test called"
startJob
| wavewave/hoodle-db | lib/Application/Hoodle/Database/Command.hs | bsd-2-clause | 241 | 0 | 7 | 28 | 53 | 30 | 23 | 7 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QUndoCommand_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:30
Warning : this file is machine generated - d... | uduki/hsQt | Qtc/Gui/QUndoCommand_h.hs | bsd-2-clause | 20,034 | 0 | 18 | 4,495 | 6,513 | 3,112 | 3,401 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
module NLP.Concraft.Polish.DAG.Format.Base
(
-- * Printing
ShowCfg (..)
, ProbType (..)
, showSent
, showData
-- * Parsing
, parseData
, parseSent
) where
import Prelude hiding (Word)
import ... | kawu/concraft-pl | src/NLP/Concraft/Polish/DAG/Format/Base.hs | bsd-2-clause | 9,496 | 0 | 19 | 2,627 | 2,212 | 1,230 | 982 | 201 | 9 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
-- Module : Data.CritBit.Set
-- Copyright : (c) Bryan O'Sullivan and others 2013-2014
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- A set type that uses crit-bit trees internally.
--
-- For... | bos/critbit | Data/CritBit/Set.hs | bsd-2-clause | 14,379 | 0 | 11 | 3,131 | 2,878 | 1,619 | 1,259 | 182 | 1 |
module UpdateTest
( main
) where
import Control.Concurrent
import Data.Word
import qualified Data.Set as Set
import qualified Data.Map as Map
import Frenetic.NetCore
import Control.Monad (forever)
import Frenetic.NetCore.Util (poDom)
dlDst a = DlDst $ EthernetAddress (fromInteger a)
switch a = Switch $ fromIntege... | frenetic-lang/netcore-1.0 | examples/UpdateTest.hs | bsd-3-clause | 3,135 | 0 | 25 | 987 | 1,200 | 632 | 568 | 95 | 1 |
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-}
module Math where
import Data.VectorSpace
-- | un punto nel piano 2d ascissa e ordinata o anche un vettore
newtype Punto = Punto (Float,Float) deriving (Eq,Show, Read, AdditiveGroup)
-- | un angolo
type Angolo = Float
-- campo dei Punto
instance Num Punto wh... | paolino/marionetta | Math.hs | bsd-3-clause | 1,443 | 0 | 14 | 337 | 582 | 315 | 267 | 29 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
module Benchmarks.Mate where
import Data.Generics
import Data.List
data Kind = King | Queen | Rook | Bishop | Knight | Pawn
deriving (Eq, Show, Data, Typeable)
data Colour = Black | White
deriving (Eq, Show, Data, Typeable)
type Piece = (Colour,Kind)
type Square = (Int,Int)
... | UoYCS-plasma/LazySmallCheck2012 | suite/performance/Benchmarks/Mate.hs | bsd-3-clause | 7,326 | 111 | 24 | 2,057 | 4,004 | 2,122 | 1,882 | 199 | 7 |
module Data.Hexagon.NeighborsSpec where
import qualified Data.Sequence as Seq
import SpecHelper
spec :: Spec
spec = do
describe "Data.Hexagon.Neighbors" $ do
context "every HexCoordinate has 6 neighbors" $ do
it "CubeCoordinate" $ property $ prop_neighbor_count_cube
it "AxialCoordinate" $ property $... | alios/hexagon | test/Data/Hexagon/NeighborsSpec.hs | bsd-3-clause | 7,917 | 0 | 15 | 1,272 | 1,806 | 884 | 922 | 149 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
-- | Dealing with Cabal.... | mietek/stack | src/Stack/Package.hs | bsd-3-clause | 23,951 | 0 | 20 | 7,491 | 5,363 | 2,798 | 2,565 | 517 | 10 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE OverloadedStrings #-}
module Search.SearchIndex
(
SearchIndex, SearchIndexBuilder
, newSearchIndexBuilder, indexTokenDoc
, buildSearchIndex
, search, numDocsPerTerm
, SearchIndexHandle, withSearchIndexFile, readPostingList, joinIndexes
, indexedTok... | jdimond/diplomarbeit | lib/Search/SearchIndex.hs | bsd-3-clause | 2,256 | 0 | 13 | 365 | 710 | 378 | 332 | 51 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
module River.Source.Concrete.Parser (
parseProgram
, parseProgram'
) where
import Control.Applic... | jystic/river | src/River/Source/Concrete/Parser.hs | bsd-3-clause | 10,480 | 0 | 26 | 2,368 | 3,500 | 1,784 | 1,716 | 312 | 2 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE DefaultSignatures #-}
#endif
module Generics.Deriving.Enum (
-- * Generic enum class
GEnum(..)
... | ekmett/generic-deriving | src/Generics/Deriving/Enum.hs | bsd-3-clause | 6,456 | 0 | 16 | 1,807 | 2,121 | 1,155 | 966 | 107 | 4 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
--
-- This module contains the main implementation of the Livermore Unstructured
-- Lagran... | tmcdonell/accelerate-lulesh | src/LULESH.hs | bsd-3-clause | 41,781 | 0 | 23 | 13,796 | 11,112 | 5,889 | 5,223 | 749 | 6 |
module Tor.Flags(
Flag(..)
, runDefaultMain
--
, getNickname
, getOnionPort
, getContactInfo
, getTapDevice
)
where
import Data.Version hiding (Version)
import Data.Word
import System.Console.GetOpt
import System.Environment
import System.Exit
import Paths_has... | GaloisInc/haskell-tor | exe/Tor/Flags.hs | bsd-3-clause | 2,934 | 0 | 13 | 895 | 791 | 420 | 371 | 70 | 2 |
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : dave.laing.80@gmail.com
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAG... | dalaing/type-systems | src/Rules/Type/Infer/Common.hs | bsd-3-clause | 11,722 | 0 | 16 | 3,682 | 5,673 | 3,019 | 2,654 | 220 | 1 |
module Numeric.Regression.Linear
(Model, compute, regress) where
import Control.Applicative
import Data.Foldable
import Data.Monoid
import Data.Traversable
import Numeric.AD
import Numeric.Regression.Internal
-- | A model using the given @f@ to store parameters of type @a@.
-- Can be thought of as some kind of ve... | alpmestan/regress | src/Numeric/Regression/Linear.hs | bsd-3-clause | 3,337 | 0 | 12 | 847 | 533 | 303 | 230 | 40 | 1 |
------------------------------------------------------------
--
-- Author: Joao H de A Franco (jhafranco@acm.org)
--
-- Description: FFT implementation in Haskell
--
-- Date: 2013-Mar-28
--
-- License: Attribution-NonCommercial-ShareAlike 3.0 Unported
-- (CC BY-NC-SA 3.0)
--
-----------------------------------... | akru/ColorSound | src/FFT.hs | bsd-3-clause | 1,341 | 0 | 15 | 385 | 534 | 287 | 247 | 24 | 3 |
{-
Copyright (c) 2013, Genome Research Limited
Author: Nicholas Clarke <nicholas.clarke@sanger.ac.uk>
Rewrite of hgc-deploy in Haskell, aiming to be more configurable and maintainable.
Steps involved:
1. Become root.
2. Create temporary directories.
3. Modify the config and fstab.
4. Establish a union mount for the r... | wtsi-hgi/hgc-tools | hgc-deploy.hs | bsd-3-clause | 11,197 | 0 | 21 | 2,974 | 2,922 | 1,516 | 1,406 | 221 | 4 |
module Blog.BackEnd.AsyncLogHandler (AsyncLogHandler, asyncHandler) where
import System.Log.Handler
import System.IO
import System.Log
import Utilities ( now )
import Control.Concurrent ( forkIO )
import Control.Concurrent.Chan ( Chan, newChan, readChan, writeChan )
import qualified Control.Exception as CE
type Time... | prb/perpubplat | src/Blog/BackEnd/AsyncLogHandler.hs | bsd-3-clause | 1,704 | 0 | 16 | 612 | 566 | 310 | 256 | 33 | 2 |
module StaticFlags where
import System.Environment
import System.IO.Unsafe
{-# NOINLINE aSSERTIONS #-}
aSSERTIONS :: Bool
aSSERTIONS = not $ "--no-assertions" `elem` (unsafePerformIO getArgs)
{-# NOINLINE qUIET #-}
qUIET :: Bool
qUIET = "-v0" `elem` (unsafePerformIO getArgs)
{-# NOINLINE tERMINATION_CHECK #-}
tERM... | batterseapower/supercompilation-by-evaluation | StaticFlags.hs | bsd-3-clause | 553 | 0 | 7 | 71 | 119 | 72 | 47 | 15 | 1 |
{-# LANGUAGE GADTs, BangPatterns, ScopedTypeVariables #-}
module GHC.Cmm.CommonBlockElim
( elimCommonBlocks
)
where
import GhcPrelude hiding (iterate, succ, unzip, zip)
import GHC.Cmm.BlockId
import GHC.Cmm
import GHC.Cmm.Utils
import GHC.Cmm.Switch (eqSwitchTargetWith)
import GHC.Cmm.ContFlowOpt
import GHC.Cm... | sdiehl/ghc | compiler/GHC/Cmm/CommonBlockElim.hs | bsd-3-clause | 12,845 | 0 | 15 | 3,134 | 3,591 | 1,881 | 1,710 | 189 | 24 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
-- |
--
module Data.Time.Cube.Label
( DateTimeLensT(..)
-- * Raw ... | alphaHeavy/time-cube | fclabels/Data/Time/Cube/Label.hs | bsd-3-clause | 4,750 | 0 | 12 | 1,027 | 1,802 | 966 | 836 | 169 | 1 |
-- | Examples of diagrams using the Turtle data type
import Diagrams.Prelude
import Diagrams.TwoD.Path.Turtle.Internal
import Diagrams.Backend.SVG
import Diagrams.Backend.SVG.CmdLine (defaultMain)
squareTurtle :: Diagram SVG R2
squareTurtle = getTurtleDiagram $
startTurtle #
forward x # right turn # setPenWidth 2.... | deepakjois/hs-logo | examples/Turtles.hs | bsd-3-clause | 575 | 0 | 18 | 105 | 177 | 89 | 88 | 14 | 1 |
module D8Lib.DataSpec where
import Test.Hspec
import qualified Data.Map.Strict as M
import D8Lib.Data
-- `main` is here so that this module can be run from GHCi on its own. It is
-- not needed for automatic spec discovery.
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "initState" $ do
it "c... | wfleming/advent-of-code-2016 | 2017/D8/test/D8Lib/DataSpec.hs | bsd-3-clause | 1,734 | 0 | 18 | 472 | 777 | 405 | 372 | 43 | 1 |
{-# LANGUAGE DataKinds, FlexibleContexts, FlexibleInstances, GADTs #-}
module UI.Drawing
( Shape(..)
, Colour(..)
, DrawingF(..)
, Drawing
, Rendering
, RenderingF
, text
, clip
, drawingRectAlgebra
, renderingRectAlgebra
, drawingCoalgebra
, renderingCoalgebra
, renderingRects
, module Layout
) where
import Control.C... | robrix/ui-effects | src/UI/Drawing.hs | bsd-3-clause | 3,869 | 2 | 17 | 717 | 1,624 | 844 | 780 | 91 | 3 |
-- | Heist 0.5.x
module Heist.Future
( viewWith
, viewWithTemplates
, viewWithText
, mapSplices
) where
import Control.Arrow (second)
import Control.Monad (liftM)
import Data.Text (Text)
import Text.Templating.Heist
import qualified Text.XmlHtml as X
-------... | jystic/mothership | src/Heist/Future.hs | bsd-3-clause | 2,951 | 0 | 10 | 635 | 482 | 266 | 216 | 40 | 1 |
module Test.Interval where
import Data.Interval
import Control.Monad
import Test.SmallCheck
import Test.SmallCheck.Series
instance Monad m => Serial m Interval where
series = cons2 f
where f a (Positive l) = Interval a (a + l)
subintervals :: Monad m => Interval -> Series m Interval
subintervals (Interv... | ian-mi/interval-set | tests/Test/Interval.hs | bsd-3-clause | 454 | 0 | 13 | 108 | 201 | 102 | 99 | -1 | -1 |
-- https://www.hackerrank.com/challenges/plus-minus/problem
import Control.Exception.Base(assert)
import Text.Printf(printf)
readInputList :: IO([Int])
readInputList = do
listSize <- readLn :: IO Int
line <- getLine
let inputList = map (read :: String -> Int) $ words line
assert (listSize == length inputList) ... | julianespinel/trainning | hackerrank/PlusMinus.hs | mit | 825 | 0 | 14 | 142 | 313 | 159 | 154 | 21 | 1 |
--
--
--
-----------------
-- Exercise 6.20.
-----------------
--
--
--
module E'6'20 where
import E'6''8 ( rotate90 )
import Pictures
(
Picture
, invert
, rotate
, invertColour
, horse
)
-- Transform a picture first (using (map reverse (rotate90 picture)) or sth. similar).
-- Then use the functions fr... | pascal-knodel/haskell-craft | _/links/E'6'20.hs | mit | 2,651 | 0 | 11 | 614 | 710 | 397 | 313 | 70 | 1 |
--
--
--
-----------------
-- Exercise 11.7.
-----------------
--
--
--
module E'11''7 where
isNonWhitespace
-- Lambda abstraction:
= \character -> not $ character `elem` whitespace
-- ...
where
whitespace :: [Char]
whitespace = " \t\n"
{- GHCi>
isNonWhitespace 'a'
isNonWhitespace ' '
-}
--... | pascal-knodel/haskell-craft | _/links/E'11''7.hs | mit | 339 | 0 | 7 | 81 | 53 | 38 | 15 | 5 | 1 |
{-|
Module abstracting the peer map implementation.
This is abstracted separately since the speed of peermap updates can
be a significant part of the total runtime, and as such changing the
implementation should be easy in case it's needed.
-}
{-
Copyright (C) 2009 Google Inc.
This program is free software; you ... | ekohl/ganeti | htools/Ganeti/HTools/PeerMap.hs | gpl-2.0 | 2,847 | 0 | 10 | 681 | 537 | 303 | 234 | 43 | 2 |
{- |
Module : PredefinedSign.hs
Description : with inlined axioms
Copyright : (c) Uni and DFKI Bremen 2005-2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
-}
module CASL_DL.PredefinedCASLAxioms
( predefSign
... | spechub/Hets | CASL_DL/PredefinedCASLAxioms.hs | gpl-2.0 | 10,890 | 0 | 15 | 3,980 | 2,972 | 1,650 | 1,322 | 286 | 1 |
----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.WindowMenu
-- Copyright : (c) Jan Vornberger 2009
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : jan.vornberger@informatik.uni-oldenburg.de
-- Stability : unstable
-- Portability : ... | f1u77y/xmonad-contrib | XMonad/Actions/WindowMenu.hs | bsd-3-clause | 2,834 | 0 | 17 | 818 | 589 | 320 | 269 | 42 | 2 |
{-# LANGUAGE ScopedTypeVariables #-}
module Differential where
import Control.Applicative
import Data.Dynamic
import Data.Ratio
import Expr
import Transformation
import Tensor
-- A symbolic partial differentiation.
partial :: forall a. (Typeable a) => Expr Axis -> Expr (Pt -> a) -> Expr (Pt -> a)
partial i f = (Rese... | nushio3/Paraiso | attic/newexp/Differential.hs | bsd-3-clause | 1,147 | 0 | 15 | 274 | 574 | 303 | 271 | 23 | 3 |
{-# LANGUAGE CPP, OverloadedStrings #-}
{-# OPTIONS_GHC -Wall -fwarn-tabs #-}
module Language.Hakaru.Parser.Import (expandImports) where
import Language.Hakaru.Parser.AST
import Language.Hakaru.Parser.Parser (parseHakaruWithImports)
import Control.Monad.Trans.Except
import Cont... | zachsully/hakaru | haskell/Language/Hakaru/Parser/Import.hs | bsd-3-clause | 1,270 | 0 | 14 | 356 | 399 | 208 | 191 | 28 | 4 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-2012
Note [Unarisation]
~~~~~~~~~~~~~~~~~~
The idea of this pass is to translate away *all* unboxed-tuple and unboxed-sum
binders. So for example:
f (x :: (# Int, Bool #)) = f x + f (# 1, True #)
==>
f (x1 :: Int) (x2 :: Bool) = f x1 x2 + f 1 True
It is... | shlevy/ghc | compiler/simplStg/UnariseStg.hs | bsd-3-clause | 26,475 | 0 | 19 | 6,280 | 5,080 | 2,598 | 2,482 | -1 | -1 |
{-|
Module : IRTS.JavaScript.AST
Description : Data structures and functions used with the JavaScript codegen.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE OverloadedStrings #-}
module IRTS.JavaScript.AST where
import Data.Word
import Data.Char... | tpsinnem/Idris-dev | src/IRTS/JavaScript/AST.hs | bsd-3-clause | 11,714 | 0 | 15 | 3,187 | 4,432 | 2,338 | 2,094 | 321 | 10 |
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.Wai.Handler.Warp
import Data.ByteString.Lazy.Char8 (pack)
import qualified Data.ByteString.Char8 as S
main = run 3000 app
app req =
return $ responseLBS (Status s' s) [("Content-Type", "text/plain")]
$ pack $ concat
[ "The sta... | dylex/wai | warp/attic/statuses.hs | mit | 475 | 0 | 10 | 126 | 141 | 79 | 62 | 14 | 1 |
import GHC.Conc
import GHC.IO
import GHC.IO.FD as FD
import System.Posix.IO
import System.Posix.Types
main = do
(rfd,wfd) <- createPipe
(waitread, unregister) <- threadWaitReadSTM rfd
unregister
result0 <- atomically $ (fmap (const False) waitread) `orElse` return True
print result0
fdWrite wfd "test"
th... | ezyang/ghc | libraries/base/tests/T12852.hs | bsd-3-clause | 585 | 0 | 13 | 102 | 224 | 111 | 113 | 19 | 1 |
-- Test that DuplicateRecordFields doesn't affect the metadata
-- generated by GHC.Generics or Data.Data
-- Based on a Stack Overflow post by bennofs
-- (http://stackoverflow.com/questions/24474581)
-- licensed under cc by-sa 3.0
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Da... | ezyang/ghc | testsuite/tests/overloadedrecflds/should_run/overloadedrecflds_generics.hs | bsd-3-clause | 1,851 | 0 | 11 | 373 | 427 | 239 | 188 | 31 | 1 |
{-# LANGUAGE StandaloneDeriving #-}
module T5513 where
deriving instance lowercase_name a
| urbanslug/ghc | testsuite/tests/rename/should_fail/T5513.hs | bsd-3-clause | 91 | 0 | 5 | 12 | 13 | 8 | 5 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.