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 DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/Templates/Create.hs | mpl-2.0 | 5,773 | 0 | 18 | 1,303 | 786 | 459 | 327 | 116 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Autoscalers/Update.hs | mpl-2.0 | 3,983 | 0 | 17 | 977 | 550 | 326 | 224 | 83 | 1 |
module AlecAirport.A281511Spec (main, spec) where
import Test.Hspec
import AlecAirport.A281511 (a281511)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A281511" $
it "correctly computes the first 20 elements" $
take 20 (map a281511 [1..]) `shouldBe` expectedValue where
expectedValue = [1,1,... | peterokagey/haskellOEIS | test/AlecAirport/A281511Spec.hs | apache-2.0 | 357 | 0 | 10 | 59 | 160 | 95 | 65 | 10 | 1 |
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
module Format where
import Foreign
import Foreign.C
import Foreign.Marshal.Alloc
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as BU
import Data.Monoid
import System.Posix.Files
data Format = F {
formatName :: String,
formatEntry... | lih/Alpha | src/Format.hs | bsd-2-clause | 1,277 | 0 | 12 | 201 | 313 | 171 | 142 | -1 | -1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QDial_h.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 m... | keera-studios/hsQt | Qtc/Gui/QDial_h.hs | bsd-2-clause | 58,905 | 0 | 18 | 13,243 | 20,387 | 9,841 | 10,546 | -1 | -1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- Create a source distribution tarball
module Stack.SDist
( getSDistTarball
) where
import qualified Codec.Archive.Tar as Tar
import qualified Codec.Archi... | bixuanzju/stack | src/Stack/SDist.hs | bsd-3-clause | 7,020 | 0 | 20 | 1,779 | 1,653 | 891 | 762 | 124 | 4 |
{-# LANGUAGE DeriveDataTypeable, CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Xmobar
-- Copyright : (c) Andrea Rossato
-- License : BSD-style (see LICENSE)
--
-- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org>
-- Stability : unstable
-- Portabi... | raboof/xmobar | src/Xmobar.hs | bsd-3-clause | 9,113 | 0 | 19 | 3,129 | 2,830 | 1,433 | 1,397 | 183 | 10 |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_hdr_metadata - device extension
--
-- == VK_EXT_hdr_metadata
--
-- [__Name String__]
-- @VK_EXT_hdr_metadata@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 106
--
-- [__Revision__]
-- 2
--
-- [__Extension and Versi... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_hdr_metadata.hs | bsd-3-clause | 16,530 | 0 | 17 | 3,155 | 3,202 | 1,858 | 1,344 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables, DeriveGeneric #-}
import qualified Data.ByteString.Lazy as BL
import Data.Csv
import qualified Data.Vector as V
import GHC.Generics
data Person = Person String Int deriving Generic
instance FromRecord Person
instance ToRecord Person
persons :: [Person]
persons = [Person "John" 5000... | mikeizbicki/cassava | examples/IndexBasedGeneric.hs | bsd-3-clause | 669 | 0 | 15 | 140 | 210 | 107 | 103 | 18 | 2 |
-- |Basic types and interfaces
module Data.Deciparsec.Parser ( -- * Types
Parser, Result, ParserT, IResult(..), TokenSeq
-- * Running Parsers
-- ** Resupplyable parsers
, runParserT, feedT, runP... | d3tucker/deciparsec | src/Data/Deciparsec/Parser.hs | bsd-3-clause | 5,712 | 1 | 13 | 1,661 | 1,324 | 700 | 624 | 73 | 3 |
{-# LANGUAGE PatternGuards #-}
module Common.Draw
(drawLineU, drawLineA)
where
-- Repa
import Data.Array.Repa (Z (..), (:.) (..), U, DIM2, Array)
import qualified Data.Array.Repa as R
-- Acc
import Data.Array.Accelerate.IO
-- base
import Control.Monad
import Control.Monad.ST
import qualified D... | tranma/falling-turnip | common/Draw.hs | bsd-3-clause | 3,473 | 0 | 17 | 1,269 | 1,341 | 730 | 611 | 65 | 5 |
module Notate.Actions
( runInstall
, runNotebook
, runKernel
, runEval
) where
import Control.Monad (unless, forM_)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.State.Strict
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy as BL
import Data.List (findIndex)
import IHaskel... | ejconlon/notate | src/Notate/Actions.hs | bsd-3-clause | 2,885 | 0 | 16 | 692 | 771 | 414 | 357 | 80 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Overlo... | byteally/webapi | webapi/src/WebApi/Internal.hs | bsd-3-clause | 13,144 | 0 | 28 | 3,842 | 3,611 | 1,906 | 1,705 | 214 | 7 |
#!/usr/bin/env runhaskell
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
import Control.Monad
import Data... | pepeiborra/narradar | strategies/FLOPS08-search.hs | bsd-3-clause | 2,230 | 0 | 13 | 356 | 615 | 329 | 286 | -1 | -1 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, DeriveDataTypeable, RecordWildCards#-}
module CommandLine(withArgs,OutputFormat(..)) where
import System.Console.CmdLib
import qualified Math.Statistics.WCC as T
data OutputFormat = PNG | RAW deriving (Eq,Data,Typeable,Show)
data Opts = Opts { windowIncrement :: In... | runebak/wcc | Source/CommandLine.hs | bsd-3-clause | 3,720 | 0 | 13 | 1,296 | 708 | 387 | 321 | 44 | 1 |
module Main (main) where
import Control.Concurrent (forkIO)
import Control.Concurrent.MVar (newEmptyMVar,
MVar,
takeMVar,
putMVar)
import Control.Concurrent.STM (TVar,
atomically,
... | zalora/Angel | src/Angel/Main.hs | bsd-3-clause | 3,527 | 0 | 13 | 1,051 | 737 | 380 | 357 | 76 | 1 |
module Rash.Runtime.Interpreter where
import Control.Monad.IO.Class (liftIO)
import qualified Control.Monad.Trans.State as State
import qualified Data.Map.Strict as Map
import Data.Maybe (fromMaybe)
import qualified GHC.IO.Handle as Handle
import qualified Sy... | pbiggar/rash | src/Rash/Runtime/Interpreter.hs | bsd-3-clause | 4,274 | 0 | 14 | 1,002 | 1,626 | 794 | 832 | 113 | 5 |
{-# LANGUAGE FlexibleContexts #-}
module TypeCheck where
import Control.Monad.Except
import Control.Monad.Reader
import Data.List
import Text.Printf
type TypeVar = String
data Type = Type :->: Type
| TVar TypeVar
| ForAll TypeVar Type
deriving (Show)
infixr :->:
instance Eq Type wh... | SergeevPavel/system-f-typecheck | src/TypeCheck.hs | bsd-3-clause | 4,261 | 0 | 15 | 1,678 | 1,297 | 666 | 631 | 89 | 5 |
{-# language CPP #-}
-- No documentation found for Chapter "BufferView"
module Vulkan.Core10.BufferView ( createBufferView
, withBufferView
, destroyBufferView
, BufferViewCreateInfo(..)
... | expipiplus1/vulkan | src/Vulkan/Core10/BufferView.hs | bsd-3-clause | 20,307 | 0 | 17 | 3,415 | 2,604 | 1,545 | 1,059 | -1 | -1 |
module BowlingKata.Day6Spec (spec) where
import Test.Hspec
import BowlingKata.Day6 (score)
spec :: Spec
spec = do
it "is a gutter game"
((score . replicate 20 $ 0) == 0)
it "rolls all ones"
((score . replicate 20 $ 1) == 20)
it "rolls one spare"
... | Alex-Diez/haskell-tdd-kata | old-katas/test/BowlingKata/Day6Spec.hs | bsd-3-clause | 537 | 0 | 14 | 199 | 211 | 108 | 103 | 15 | 1 |
{-# LANGUAGE BangPatterns #-}
module BinaryHeapSTMSpec where
import Control.Concurrent.STM
import Data.IORef (readIORef)
import Data.List (group, sort)
import Test.Hspec
import qualified BinaryHeapSTM as P
spec :: Spec
spec = do
describe "base priority queue" $ do
it "queues entries based on weight" $ d... | kazu-yamamoto/http2 | bench-priority/test/BinaryHeapSTMSpec.hs | bsd-3-clause | 1,801 | 0 | 19 | 627 | 676 | 319 | 357 | 45 | 2 |
{-- snippet all --}
module PodParser where
import PodTypes
import Text.XML.HaXml
import Text.XML.HaXml.Parse
import Text.XML.HaXml.Html.Generate(showattr)
import Data.Char
import Data.List
data Item = Item {itemtitle :: String,
enclosureurl :: String
}
deriving (Eq, Show,... | binesiyu/ifl | examples/ch23/PodParser.hs | mit | 3,472 | 0 | 14 | 1,009 | 721 | 391 | 330 | 64 | 2 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
-- Note: this file may contain spoilers
-- (although I would be really surprised if it did, I haven't seen the films... | kcsongor/generic-lens | generic-optics/examples/StarWars.hs | bsd-3-clause | 1,786 | 0 | 9 | 464 | 435 | 266 | 169 | 52 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TypeOperators #-}
module CommonServer where
import Data.Aeson
import GHC.Generics
------------------------------
-- File Structure
------------------------------
data File = File {
fileName :: FilePath,
... | Coggroach/Gluon | .stack-work/intero/intero8374TU0.hs | bsd-3-clause | 2,366 | 0 | 8 | 420 | 462 | 267 | 195 | 67 | 0 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
module Network.Wai.Handler.Warp.Request (
recvRequest
, headerLines
, pauseTimeoutKey
, getFileInfoKey
, getClientCertificateKey
, NoKeepAli... | kazu-yamamoto/wai | warp/Network/Wai/Handler/Warp/Request.hs | mit | 12,688 | 0 | 19 | 3,703 | 2,527 | 1,344 | 1,183 | 226 | 7 |
{-# LANGUAGE JavaScriptFFI, DeriveDataTypeable #-}
module InnerEar.WebSocket where
import Reflex
import qualified Reflex.Dom as R
import Text.JSON
import Text.JSON.Generic
import Data.Time.Clock
import Data.Time.Calendar (Day(ModifiedJulianDay))
import GHC.IORef
import qualified GHCJS.Prim as Prim
import qu... | d0kt0r0/InnerEar | src/InnerEar/WebSocket.hs | gpl-3.0 | 3,520 | 15 | 16 | 700 | 1,040 | 540 | 500 | 71 | 2 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
\section[WwLib]{A library for the ``worker\/wrapper'' back-end to the strictness analyser}
-}
{-# LANGUAGE CPP #-}
module WwLib ( mkWwBodies, mkWWstr, mkWorkerArgs
, deepSplitProductType_maybe, findTypeShape
) where
#include "HsVersions.h"
... | nushio3/ghc | compiler/stranal/WwLib.hs | bsd-3-clause | 31,859 | 0 | 18 | 9,496 | 3,840 | 2,092 | 1,748 | 266 | 2 |
-- |Auxiliary functions to vectorise type abstractions.
module Vectorise.Utils.Poly
( polyAbstract
, polyApply
, polyVApply
, polyArity
)
where
import GhcPrelude
import Vectorise.Vect
import Vectorise.Monad
import Vectorise.Utils.PADict
import CoreSyn
import Type
import FastString
import Control.Monad
--... | ezyang/ghc | compiler/vectorise/Vectorise/Utils/Poly.hs | bsd-3-clause | 2,148 | 0 | 16 | 511 | 477 | 260 | 217 | 38 | 2 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Record... | fpinsight/hadron | src/Hadron/Basic.hs | bsd-3-clause | 9,521 | 0 | 21 | 2,506 | 1,755 | 931 | 824 | 192 | 5 |
<?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="si-LK">
<title>Directory List v2.3</title>
<maps>
<homeID>directorylistv2_3</homeID>
<m... | thc202/zap-extensions | addOns/directorylistv2_3/src/main/javahelp/help_si_LK/helpset_si_LK.hs | apache-2.0 | 978 | 78 | 66 | 157 | 412 | 209 | 203 | -1 | -1 |
{-# LANGUAGE FlexibleContexts, BangPatterns #-}
import Data.Array.Repa
import Data.Array.Repa.IO.DevIL
import System.Environment
import Data.Array.Repa.Repr.ForeignPtr
import Data.Word
-- <<main
main :: IO ()
main = do
[n, f1,f2] <- getArgs
runIL $ do
(RGB v) <- readImage f1 ... | lywaterman/parconc-examples | rotateimage.hs | bsd-3-clause | 1,427 | 0 | 14 | 668 | 456 | 237 | 219 | 29 | 1 |
module Way.Type where
import Data.IntSet (IntSet)
import qualified Data.IntSet as Set
import Data.List
import Data.Maybe
import Development.Shake.Classes
import Hadrian.Utilities
-- Note: order of constructors is important for compatibility with the old build
-- system, e.g. we want "thr_p", not "p_thr" (see instance... | bgamari/shaking-up-ghc | src/Way/Type.hs | bsd-3-clause | 2,727 | 0 | 13 | 725 | 756 | 404 | 352 | 56 | 1 |
import System.IO
import System.Cmd
import System.FilePath
import Text.Printf
import System.Directory
import Control.Monad
testdir = "openFile008_testdir"
-- Test repeated opening/closing of 1000 files. This is useful for guaging
-- the performance of open/close and file locking.
main = do
system ("rm -rf " ++ test... | urbanslug/ghc | libraries/base/tests/IO/openFile008.hs | bsd-3-clause | 585 | 0 | 15 | 106 | 169 | 85 | 84 | 16 | 1 |
module Crosscells.Region where
data Coord = Coord Int Int -- ^ row col
deriving (Read, Show, Eq, Ord)
data Region = Region Coord Coord
deriving (Read, Show, Eq, Ord)
data Direction = U | D | L | R
deriving (Read, Show, Eq, Ord)
coordRow, coordCol :: Coord -> Int
coordRow (Coord r _) = r
coordCol (Coord _ c) =... | glguy/5puzzle | Crosscells/Region.hs | isc | 1,257 | 0 | 11 | 286 | 637 | 327 | 310 | 31 | 1 |
-- file ch03/ex05.hs
-- Write a function that determines whether its input list is a palindrome.
isPali :: (Eq a) => [a] -> Bool
isPali [] = True
isPali (x:[]) = True
isPali (x:xs) = x == last(xs) && isPali(init xs)
-- init is defined as: init (xs) = take (length xs - 1) xs | imrehg/rwhaskell | ch03/ex05.hs | mit | 274 | 0 | 8 | 54 | 90 | 48 | 42 | 4 | 1 |
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-}
{-# LANGUAGE FlexibleContexts #-}
--{-# LANGUAGE NoMonomorphismRestriction #-}
module Sudoku where
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import "mtl" Control.Monad... | vladfi1/hs-misc | Sudoku.hs | mit | 2,098 | 0 | 12 | 506 | 810 | 449 | 361 | 66 | 1 |
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics (Generic)
import Data.Hashable
data Color = Red | Green | Blue deriving (Generic, Show)
instance Hashable Color where
example1 :: Int
example1 = hash Red
-- 839657738087498284
example2 :: Int
example2 = hashWithSalt 0xDEADBEEF Red
-- 62679985974121021
| riwsky/wiwinwlh | src/hashable.hs | mit | 308 | 0 | 6 | 48 | 79 | 45 | 34 | 9 | 1 |
module PuzzleIO where
import Data.Char
import Data.Matrix
type Puzzle = Matrix (Maybe Int)
showPuzzle = unlines . (map showRow) . toLists
showRow = unwords . map showNumber
showNumber :: Maybe Int -> String
showNumber (Just n) = show n
showNumber Nothing = "-"
readPuzzle :: IO Puzzle
readPuzzle = do
lines <- se... | matthayter/haskell_sudoku | PuzzleIO.hs | mit | 600 | 0 | 12 | 123 | 231 | 114 | 117 | 18 | 2 |
module ARD.World where
import ARD.Camera
import ARD.Color
import ARD.Light
import ARD.Randomize
import ARD.Ray
import ARD.Shape
import ARD.ViewPlane
data World
= World
{ camera :: Camera
, viewPlane :: ViewPlane
, sceneObjects :: [Shape]
, lights :: [Light]
, ambientLight :: Light
, backgroundColor :: C... | crazymaik/ard-haskell | lib/ARD/World.hs | mit | 356 | 0 | 9 | 71 | 98 | 62 | 36 | 17 | 0 |
{-# LANGUAGE FlexibleContexts, UndecidableInstances #-}
-----------------------------------------------------------------------------
--
-- Module : RunID3Weka
-- Copyright :
-- License : MIT
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- |
--
-------------------------------------------------... | fehu/min-dat--decision-trees | src/RunID3Weka.hs | mit | 4,305 | 0 | 14 | 914 | 970 | 516 | 454 | -1 | -1 |
module JSON where
import Text.JSON
import DB0
import DB.Get
import DB0
instance JSON Event where
showJSON (EvNewMessage mid) = makeObj [("newmessage",JSRational False $ fromIntegral mid)]
showJSON _ = JSNull
instance JSON Exposed where
showJSON (Exposed mid mdate mpid mtext mvote fs (Interface cv cp ci ... | paolino/mootzoo | JSON.hs | mit | 1,031 | 0 | 12 | 349 | 328 | 180 | 148 | 23 | 0 |
module Parser where
import Monad
import Types
import Data.Maybe (fromJust)
import Options.Applicative
import Options.Applicative.Types (ReadM (..), readerAsk, readerError)
fullParser :: Parser Args
fullParser = argParser
uriReadM :: ReadM URI
uriRe... | NorfairKing/hess | src/Parser.hs | mit | 1,882 | 0 | 18 | 628 | 438 | 210 | 228 | 59 | 2 |
-- |
-- Module : Text.XML.Mapping.Schema.Mixed
-- Copyright : (c) Joseph Abrahamson 2013
-- License : MIT
-- .
-- Maintainer : me@jspha.com
-- Stability : experimental
-- Portability : non-portable
-- .
-- XML \"mixed\" content.
module Text.XML.Mapping.Schema.Mixed (
Mixed (Mixed, unMixed), textOnly, ... | tel/xml-mapping | src/Text/XML/Mapping/Schema/Mixed.hs | mit | 633 | 0 | 9 | 147 | 138 | 88 | 50 | 12 | 1 |
module Main where
import qualified Data.ByteString.Lazy as Bs
import Data.List
import Data.Word (Word8)
import Data.Bits
import Data.Ord (comparing)
import System.Exit
import System.Environment
import System.Console.GetOpt
import Control.Monad.Error
data RleCode = EqRle {len::Int, byte::Word8}
| ... | romhack/eintourname | eintourname.hs | mit | 5,824 | 4 | 16 | 1,376 | 1,917 | 986 | 931 | 118 | 2 |
module HConsole where
import Block
import Mino
import Graphics.Gloss
-- constants
scorePaneBackgroundColor, scorePaneBorderColor, scorePaneTextColor :: Color
scorePaneWidth, scorePaneInnerWidth, scorePaneHeight, scorePaneInnerHeight, scoreTextScale :: Float
scorePaneTextLocation, scorePaneBoxLocation, scorePaneLabel... | maple-shaft/HaskellTetris | src/HConsole.hs | mit | 6,272 | 0 | 13 | 1,806 | 1,295 | 737 | 558 | 133 | 2 |
{-# LANGUAGE ScopedTypeVariables #-}
import Gauge.Main
import qualified Data.ByteString.Char8 as S
import qualified Data.ByteString.Builder as BB
import Data.Monoid
import qualified Data.Streaming.ByteString.Builder as BB
main :: IO ()
main = defaultMain [ bgroup "Data.Streaming.ByteString.Builder.toByteStringIO"
... | fpco/streaming-commons | bench/builder-to-bytestring-io.hs | mit | 1,310 | 0 | 14 | 328 | 375 | 197 | 178 | 24 | 1 |
--
-- Manage asynchronous evaluation tasks
--
module Codex.Tasks (
TaskGroup, Queue,
createTaskGroup, forkTask,
createQueue, addQueue, cancelAll
) where
import Control.Monad.IO.Class
import Control.Concurrent
import Control.Exception (bracket_)
-- | a task group
-- a quantit... | pbv/codex | src/Codex/Tasks.hs | mit | 1,210 | 0 | 11 | 247 | 366 | 193 | 173 | 23 | 1 |
module Nagari where
import Control.Monad
import Data.Char
import qualified Data.List as L
import Data.Monoid
import Prelude hiding (filter, iterate, take, takeWhile, map)
import qualified Prelude as P
----------------
-- Data types --
----------------
-- | Parser combinator type.
newtype Parser a = Parser { runParse... | davesque/nagari | Nagari.hs | mit | 5,631 | 0 | 16 | 1,371 | 1,667 | 883 | 784 | 106 | 3 |
module Alder.Unique
( -- * Unique values
Unique
-- * Supplying 'Unique's
, MonadSupply(..)
-- * Tagging values
, Tagged(..)
, tag
, untag
) where
import Control.Monad
type Unique = Int
class Monad m => MonadSupply m where
getUnique :: m Unique
data Tagged a = !Unique :<... | ghcjs/ghcjs-sodium | src/Alder/Unique.hs | mit | 440 | 0 | 9 | 131 | 151 | 84 | 67 | 18 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-trigger-action.html
module Stratosphere.ResourceProperties.GlueTriggerAction where
import Stratosphere.... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/GlueTriggerAction.hs | mit | 1,688 | 0 | 12 | 203 | 252 | 145 | 107 | 27 | 1 |
{-# htermination (inRangeChar :: Tup2 Char Char -> Char -> MyBool) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Tup2 a b = Tup2 a b ;
data Char = Char MyInt ;
data MyInt = Pos Nat | Neg Nat ;
data Nat = Succ Nat | Zero ;
data Ordering = LT | EQ | G... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/inRange_2.hs | mit | 1,938 | 0 | 9 | 411 | 799 | 432 | 367 | 51 | 1 |
{-# LANGUAGE OverloadedStrings, Arrows #-}
module Main where
import Text.XML.HXT.Core
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.List
import Text.XML.HXT.Arrow.XmlState.RunIOStateArrow
import Text.XML.HXT.Arrow.XmlState.TypeDefs
type ImgState = [Image]
type ImgArrow = IOSLA (XIOState ImgState) Xml... | danchoi/datauri | Main.hs | mit | 1,775 | 0 | 13 | 455 | 392 | 212 | 180 | -1 | -1 |
-- ArbolBinPropiedades.hs
-- Generador de árboles binarios de búsqueda y propiedades del TAD.
-- Tablas mediante matrices.
-- José A. Alonso Jiménez https://jaalonso.github.com
-- =====================================================================
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{... | jaalonso/I1M-Cod-Temas | src/Tema_19/ArbolBinPropiedades.hs | gpl-2.0 | 9,576 | 0 | 19 | 1,998 | 1,105 | 656 | 449 | 78 | 2 |
module Paths_HTF_tutorial (
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... | AntoineSavage/haskell | cabal_htf_tutorial/dist/build/autogen/Paths_HTF_tutorial.hs | gpl-2.0 | 1,158 | 0 | 10 | 164 | 323 | 184 | 139 | 25 | 1 |
-- Exercício 05: Faça uma função que calcule a soma dos dígitos de um número.
module Main where
sumDigits :: Integer -> Integer
sumDigits n = foldl (+) 0 (toDigits' n)
where
toDigits' x
| x < 10 = [x]
| otherwise = toDigits' (div x 10) ++ [mod x 10]
main :: IO ()
main = do
print(sumDigi... | danielgoncalvesti/BIGDATA2017 | Atividade01/Haskell/Activity1/Exercises2/Ex5.hs | gpl-3.0 | 332 | 0 | 11 | 92 | 119 | 60 | 59 | 9 | 1 |
module Sound.Tidal.Config where
{-
Config.hs - For default Tidal configuration values.
Copyright (C) 2020, Alex McLean and contributors
This library 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 Founda... | tidalcycles/Tidal | src/Sound/Tidal/Config.hs | gpl-3.0 | 1,776 | 0 | 8 | 707 | 154 | 101 | 53 | 22 | 1 |
module Cache where
import Data.Functor
import Data.Binary
import Data.Digest.Pure.SHA
import System.IO.Error
-- FIXME hardcoded cache directory
-- |Performs IO action via cache. If key is cached, then it is
-- returned from there. Otherwise the action is performed for
-- real. The cache is a flat directory where old... | zouppen/hsgeocoder | Cache.hs | gpl-3.0 | 1,018 | 0 | 13 | 281 | 288 | 143 | 145 | 24 | 4 |
module Paths_eksaktnaRealna (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> ... | aljosaVodopija/eksaktnaRealna | dist/build/autogen/Paths_eksaktnaRealna.hs | gpl-3.0 | 1,527 | 0 | 10 | 182 | 371 | 213 | 158 | 28 | 1 |
import FRP.Yampa
import SDL hiding (Event,initialize,delay)
import Sdl2
import Types
import IO
import StopWatch
import Bluefish
import Core
import Control.Monad
import Helper
import qualified Data.Text as Text
import Foreign.C.Types
import qualified Linear as L
import Linear.Affine
import qualified Text.Show.Pretty ... | eniac314/aquarium | src/main.hs | gpl-3.0 | 3,257 | 0 | 14 | 931 | 655 | 355 | 300 | -1 | -1 |
-- -*-haskell-*-
-- Vision (for the Voice): an XMMS2 client.
--
-- Author: Oleg Belozeorov
-- Created: 28 Jun. 2010
--
-- Copyright (C) 2010, 2011 Oleg Belozeorov
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License as
-- published by... | upwawet/vision | src/Location/UI.hs | gpl-3.0 | 5,598 | 0 | 20 | 1,596 | 1,359 | 664 | 695 | 148 | 3 |
-- Author: Viacheslav Lotsmanov
-- License: GPLv3 https://raw.githubusercontent.com/unclechu/crop-detector/master/LICENSE
module Main where
-- import Debug.Hood.Observe (runO, observe)
import System.Environment (getArgs)
import Data.List (find, minimumBy)
import Data.List.Split (chunksOf)
import Data.Word (Word8)
im... | unclechu/crop-detector | src/Main.hs | gpl-3.0 | 6,520 | 0 | 19 | 2,487 | 1,813 | 1,002 | 811 | 122 | 12 |
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-}
module Java2js.GenFun(compileMethod, compileConstant) where
--
import Java2js.Type
import Java2js.Mangle
import Java2js.JVM.Assembler
import Java2js.JVM.ClassFile
import Data.Int (Int16, Int8)
import Data.ByteString.Lazy.Char8 (unpack, ByteString)
import Data.Text.Te... | ledyba/java.js | lib/Java2js/GenFun.hs | gpl-3.0 | 23,815 | 46 | 21 | 3,918 | 6,629 | 3,369 | 3,260 | 357 | 13 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Posts/List.hs | mpl-2.0 | 6,647 | 0 | 23 | 1,819 | 1,148 | 659 | 489 | 160 | 1 |
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Small layer on top of @fast-logger@ which... | twittner/tinylog | src/System/Logger.hs | mpl-2.0 | 5,658 | 0 | 18 | 1,400 | 1,506 | 800 | 706 | 128 | 4 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Projects/Locations/Operations/Cancel.hs | mpl-2.0 | 6,661 | 0 | 16 | 1,372 | 797 | 472 | 325 | 116 | 1 |
module Relude
( module Data.Foldable
, module Data.Traversable
, module Data.Monoid
, module Control.Arrow
, module Control.Applicative
, module Control.Lens
, module Data.String
, module Prelude
, module System.Environment
, ByteString, Map, Set, Text
, intersperse, catMaybes
) where
import Co... | bsummer4/gcal | src/Relude.hs | agpl-3.0 | 981 | 0 | 5 | 272 | 245 | 157 | 88 | 30 | 0 |
import Control.Monad
main = do
[n, k, q] <- fmap ((take 3) . (map read) . words) getLine
xs <- fmap ((take n) . words) getLine
let xs' = reverse $ take n $ drop k $ cycle $ reverse xs
qs <- replicateM q readLn
mapM putStrLn $ map (xs' !!) qs
| itsbruce/hackerrank | alg/warmup/car.hs | unlicense | 263 | 0 | 14 | 74 | 145 | 70 | 75 | 7 | 1 |
module Server where
import Data.IORef
import Text.Printf
import Control.Monad
import Network.Socket
import Data.Time.Clock
import Data.Time.Format
import Control.Concurrent
import Control.Applicative
info :: String -> IO ()
info msg = do
time <- formatTime defaultTimeLocale rfc822DateFormat <$> getCurrentTime
put... | dgvncsz0f/pong | src/Server.hs | unlicense | 1,623 | 0 | 19 | 434 | 727 | 348 | 379 | 55 | 2 |
data Dict
data Type s = Auto s
| Hira s
| Kata s
toKana :: Dict -> Type String -> String
toKana d t = genConvert d $ unwrapType t
genConvert :: Dict -> String -> String
genConvert d s = concatMap (convertWord d) (words s)
convertWord :: Dict -> String -> String
convertWord d s = concatMap (co... | SiIky/libr2k | proto.hs | unlicense | 1,287 | 0 | 12 | 361 | 573 | 299 | 274 | -1 | -1 |
module Main where
factors :: Int -> [Int]
factors n = [x | x <- [1..n], n `mod` x == 0]
prime :: Int -> Bool
prime n = factors n == [1, n]
primesTo :: Int -> [Int]
primesTo n = [x | x <- [2..n], prime x]
| Crossroadsman/ProgrammingInHaskell | 05/primes.hs | apache-2.0 | 231 | 0 | 8 | 76 | 127 | 70 | 57 | 7 | 1 |
module Main ( main ) where
import Control.Eff.Exception
import Control.Eff.Lift
import System.Environment ( getArgs )
import Codec.FFMpeg
import Codec.FFMpeg.Format
probe :: String -> IO ()
probe fn = do
putStrLn fn
me <- runLift $ runExc (openInput fn (return (1 :: Int)))
case me of
Left e ->... | waldheinz/ffmpeg-effects | demos/Probe.hs | apache-2.0 | 447 | 0 | 14 | 112 | 177 | 91 | 86 | 16 | 2 |
{-# LANGUAGE FlexibleContexts #-}
import qualified Data.Text as T
import qualified Data.ByteString as B
import JtagRW ( UsbBlasterState
, withUSBBlaster
, toBits, fromBits
, virWrite, vdrWrite, vdrWriteRead
... | tau-tao/FPGAIPFilter | test/FtdiTest1.hs | bsd-3-clause | 1,437 | 0 | 13 | 453 | 364 | 193 | 171 | 30 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
module Text.RE.Internal.QQ where
import Control.Exception
import Data.Typeable
import Language.Haskell.TH.Quote
data QQFailure =
QQFailure
{ _qqf_context :: String
, _qqf_component :: String
}
deriving (Show,Typeable)
insta... | cdornan/idiot | Text/RE/Internal/QQ.hs | bsd-3-clause | 646 | 0 | 8 | 169 | 161 | 91 | 70 | 18 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Linear.Extra.Random where
import Control.Monad.Random
import Linear
import Control.Lens
instance Random r => Random (V2 r) where
randomR (a,b) g = flip runRand g $ do
x <- getRandomR (a^._x,b^._x)
y <- getRandomR (a^._y,b^._y)
return (V2 x y)
... | lukexi/linear-extra | src/Linear/Extra/Random.hs | bsd-3-clause | 1,196 | 0 | 12 | 401 | 586 | 285 | 301 | 38 | 0 |
{-# LANGUAGE TemplateHaskell #-}
module Render.MEdgeT where
import Data.Word (Word16)
import Control.Lens (makeLenses)
import qualified Data.ByteString.Lazy as BL
import Types
import Util.Binary
import qualified Constants
mEdgeDiskSize :: Int
mEdgeDiskSize = 2 * Constants.sizeOfShort
makeLenses ''MEdgeT
newMEdgeT ... | ksaveljev/hake-2 | src/Render/MEdgeT.hs | bsd-3-clause | 529 | 0 | 9 | 115 | 131 | 75 | 56 | 18 | 1 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Interface between OpenCV and inline-c(pp) (Haskell)
module OpenCV.Internal.C.Inline ( openCvCtx ) where
import "base" Foreign.Ptr ( FunPtr )
import "base" Data.Monoid ( (<>) )
import qualified "containers" Data.Map as M
import qualified "inline-c"... | Cortlandd/haskell-opencv | src/OpenCV/Internal/C/Inline.hs | bsd-3-clause | 5,328 | 0 | 9 | 1,614 | 1,453 | 974 | 479 | -1 | -1 |
{-# LANGUAGE CPP #-}
---------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : experimental
-- Portability : non-portable
--
-- Common... | phaazon/linear | src/Linear/Projection.hs | bsd-3-clause | 5,852 | 2 | 12 | 1,856 | 2,144 | 1,171 | 973 | 183 | 1 |
module DepthFirstSearchTest where
import qualified DepthFirstSearch as DFS
import qualified Data.Set as Set
import Test.Hspec
import Test.QuickCheck
import Debug.Trace
makeGraph :: DFS.Graph
makeGraph = DFS.AdjList [ [1, 2] -- 0
, [0, 3] -- 1
, [0] -- 2
, [1, 4] ... | ashishnegi/hsalgos | test/DepthFirstSearchTest.hs | bsd-3-clause | 895 | 0 | 18 | 331 | 236 | 135 | 101 | 26 | 1 |
{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, UnboxedTuples #-}
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2005-2007
--
-- Running statements interactively
--
-- -------------------------------------------------------------------------... | alexander-at-github/eta | compiler/ETA/Main/InteractiveEval.hs | bsd-3-clause | 42,109 | 13 | 34 | 11,838 | 9,071 | 4,660 | 4,411 | 2 | 0 |
{-# LANGUAGE CPP, BangPatterns #-}
--------------------------------------------------------------------------------
-- |
-- Module : GalFld.Algorithmen.Berlekamp
-- Note : Implementiert eine Berlekamp Faktorisierung
--
-- Funktioniert nur auf Quadratfreien Polynomen
--
-- Enthält den 1967 von Elwyn Berlekam... | maximilianhuber/softwareProjekt | src/GalFld/Algorithmen/Berlekamp.hs | bsd-3-clause | 7,557 | 0 | 19 | 2,749 | 1,893 | 985 | 908 | 78 | 1 |
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Network.DHT.Kademlia.Workers.Persistence (persistRoutingTable) where
import Control.Concurrent
import Control.Concurrent.STM
import Control.Concurre... | phylake/kademlia | Network/DHT/Kademlia/Workers/Persistence.hs | bsd-3-clause | 1,315 | 0 | 9 | 268 | 251 | 162 | 89 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Bot.Action.Maven
( maven
, version
, parentVersion
, changeDependencyVersion
, updateDependencyVersions
, properties
, snapshots
) where
import Bot.Action.Action
import Bot.Action.XML
import Bot.Types
import Bot.Util
import Control.Arrow
import Control.Monad
i... | andregr/bot | lib/Bot/Action/Maven.hs | bsd-3-clause | 4,303 | 0 | 16 | 918 | 1,455 | 742 | 713 | -1 | -1 |
-- This afternoon
-- 1. How do we constrain fully crossed?
-- 2. Set up minimal example
-- a. Minimal block rewrite
-- b. Does it desugar correctly?
-- c. Write tests & update the error handling
-- 3. Deal with blocks for real
-- 4. Deal with exact constraint syntax/wording & wtf is going on with transitions
... | anniecherk/pyschocnf | notes/parser_interface/minimal.hs | bsd-3-clause | 1,067 | 0 | 10 | 263 | 131 | 78 | 53 | 7 | 1 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.AMD.FramebufferSamplePositions
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
... | haskell-opengl/OpenGLRaw | src/Graphics/GL/AMD/FramebufferSamplePositions.hs | bsd-3-clause | 1,028 | 0 | 5 | 122 | 81 | 58 | 23 | 15 | 0 |
{-# LANGUAGE TypeOperators #-}
{-# Language RebindableSyntax #-}
{-# Language ScopedTypeVariables #-}
{-# Language FlexibleContexts #-}
module Main where
import Prelude hiding ((>>=), (>>), fail, return, id, print, mod)
import Symmetry.Language
import Symmetry.Verify
import Symmetry.SymbEx
import SrcHelper
type Msg ... | abakst/symmetry | checker/tests/todo/SrcSieve.hs | mit | 4,162 | 0 | 24 | 1,849 | 1,392 | 679 | 713 | -1 | -1 |
module SymBoilerPlate where
{-@ nonDet :: a -> x:Int -> {v:Int | 0 <= v && v < x } @-}
nonDet :: a -> Int -> Int
nonDet = undefined
{-@ nonDetRange :: x:Int -> y:Int -> {v:Int | x <= v && v < y} @-}
nonDetRange :: Int -> Int -> Int
nonDetRange = undefined
{-@
data Val p = VUnit {}
| VUnInit {}
... | abakst/symmetry | checker/include/SymBoilerPlate.hs | mit | 1,749 | 2 | 9 | 636 | 379 | 219 | 160 | 34 | 1 |
module EvalTest where
import Test.Tasty
import Test.Tasty.HUnit
import qualified Control.Exception as Exc
import EvaluationMonad
import GenStrat
import SolutionContext
import NormalizationStrategies
import CoreS.AST
import qualified CoreS.ASTUnitype as AST
import CoreS.Parse
import Norm.AllNormalizations as ALL
norm... | DATX02-17-26/DATX02-17-26 | Test/EvalTest.hs | gpl-2.0 | 3,113 | 0 | 17 | 804 | 647 | 337 | 310 | 73 | 2 |
{-|
Module : Devel.Args
Description : For handling command line arguments.
Copyright : (c) 2015 Njagi Mwaniki
License : MIT
Maintainer : njagi@urbanslug.com
Stability : experimental
Portability : POSIX
We handle command line arguments for yesod devel here.
-}
module Devel.CmdArgs
( cmdArgs
, CmdArgs (.... | urbanslug/yesod-devel | src/Devel/CmdArgs.hs | gpl-3.0 | 1,937 | 0 | 16 | 754 | 301 | 154 | 147 | 40 | 1 |
module PMC8 where
main :: Int
main = lengte (filter even [1..1000])
lengte :: [a] -> Int
lengte xs =
len xs 0
len :: [a] -> Int -> Int
len xs n =
case xs of
[] -> n
y:ys -> len ys $! (n + 1)
| roberth/uu-helium | test/correct/PMC8.hs | gpl-3.0 | 225 | 0 | 10 | 82 | 117 | 62 | 55 | 11 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-autoscaling/gen/Network/AWS/AutoScaling/TerminateInstanceInAutoScalingGroup.hs | mpl-2.0 | 5,744 | 0 | 13 | 1,057 | 626 | 376 | 250 | 88 | 1 |
module SimpleJSON
(
JValue(..)
, getString
, getInt
, getDouble
, getBool
, getObject
, getArray
, isNull
) where
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
| JArra... | timstclair/experimental | haskell/real_world_haskell/ch05/SimpleJSON.hs | unlicense | 818 | 0 | 8 | 310 | 273 | 145 | 128 | 31 | 1 |
{-# LANGUAGE GADTs, PolyKinds, RankNTypes #-}
module GADTVars where
import Data.Kind
import Data.Proxy
data T (k1 :: Type) (k2 :: Type) (a :: k2) (b :: k2) where
MkT :: T x1 Type (Proxy (y :: x1), z) z
| sdiehl/ghc | testsuite/tests/dependent/should_compile/mkGADTVars.hs | bsd-3-clause | 207 | 0 | 10 | 44 | 76 | 49 | 27 | -1 | -1 |
module MyHttp (RequestType (..), Request(..), Response(..), Context(..), ServerPart) where
data RequestType = Get | Post
data Request = Request
{ route :: String
, reqtype :: RequestType
}
data Response = Response
{ content :: String
, statusCode :: Int
}
instance Show Response where
show (Re... | nicolocodev/learnhappstack | 3_Composition/MyHttp.hs | mit | 527 | 0 | 10 | 123 | 166 | 99 | 67 | 15 | 0 |
module Model.Project.Sql where
import Import
import Model.Wiki.Sql
-- | Query that returns all WikiEdits made on any WikiPage on this Project
querProjectWikiEdits :: ProjectId -> SqlQuery (SqlExpr (Value WikiEditId))
querProjectWikiEdits project_id =
from $ \(wp `InnerJoin` we) -> do
on_ (wp ^. WikiPageId ==... | Happy0/snowdrift | Model/Project/Sql.hs | agpl-3.0 | 421 | 0 | 13 | 74 | 115 | 61 | 54 | 9 | 1 |
{-
(c) The AQUA Project, Glasgow University, 1993-1998
\section{Common subexpression}
-}
{-# LANGUAGE CPP #-}
module ETA.SimplCore.CSE (cseProgram) where
#include "HsVersions.h"
import ETA.Core.CoreSubst
import ETA.BasicTypes.Var ( Var )
import ETA.BasicTypes.Id ( Id, idType, idInlineAct... | alexander-at-github/eta | compiler/ETA/SimplCore/CSE.hs | bsd-3-clause | 12,560 | 0 | 12 | 4,082 | 2,021 | 1,097 | 924 | 117 | 3 |
{-
Copyright (C) 2009 John Goerzen <jgoerzen@complete.org>
All rights reserved.
For license and copyright information, see the file COPYRIGHT
-}
module TestInfrastructure where
import qualified Test.QuickCheck as QC
import qualified Test.HUnit as HU
import Test.HUnit.Tools
q :: QC.Testable a => String -> a -> HU.Tes... | cabrera/hdbc | testsrc/TestInfrastructure.hs | bsd-3-clause | 410 | 0 | 8 | 67 | 91 | 52 | 39 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module OperationalTests where
import Type
import Operational
base_send1 :: Test
base_send1 = Test "Base" "send1" [
Transactional [NewStream StringT "s_"] [(StreamSinkT StringT, "s_", s)],
NewList StringT out,
Transactional [Listen "l_" s (StringT, "a") [AppendList out (... | kevintvh/sodium | common-tests/OperationalTests.hs | bsd-3-clause | 604 | 0 | 13 | 134 | 217 | 121 | 96 | 19 | 1 |
-------------------------------------------------------------------------------
-- |
-- Module : CCO.Tree
-- Copyright : (c) 2008 Utrecht University
-- License : All rights reserved
--
-- Maintainer : stefan@cs.uu.nl
-- Stability : provisional
-- Portability : portable
--
-- A straightforward implem... | UU-ComputerScience/uu-cco | uu-cco/src/CCO/Tree.hs | bsd-3-clause | 1,078 | 0 | 6 | 227 | 108 | 81 | 27 | 9 | 0 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.GHC
-- Copyright : Isaac Jones 2003-2007
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is a fairly large module. It... | thoughtpolice/cabal | Cabal/Distribution/Simple/GHC.hs | bsd-3-clause | 52,313 | 0 | 23 | 16,008 | 9,753 | 5,117 | 4,636 | 826 | 19 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Utils.Http (send) where
import qualified Control.Exception as E
import Control.Monad.Error.Class (MonadError, throwError)
import Control.Monad.Trans (MonadIO, liftIO)
import qualified Data.ByteString.Char8 as BSC
import qualified Data.List as ... | laszlopandy/elm-package | src/Utils/Http.hs | bsd-3-clause | 1,824 | 0 | 21 | 414 | 587 | 304 | 283 | 45 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.