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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-- |
-- Module : Algebra.Closure.Set.BreadthFirst
-- Copyright : (c) Joseph Abrahamson 2013
-- License : MIT
--
-- Maintainer : [email protected]
-- Stability : experimental
-- Portability : non-portable
--
-- Depth-first closed sets. For a particular endomorphism @(p :: a ->
-- a)@ a 'Closed' set is a set w... | tel/closure | src/Algebra/Closure/Set/BreadthFirst.hs | mit | 6,074 | 0 | 13 | 1,380 | 1,500 | 801 | 699 | 74 | 3 |
module Chapter4Spec (spec)
where
import Test.Hspec
import Chapter4
spec :: Spec
spec =
do
describe "4.1: Convert numbers to words" $ do
it "should convert numbers to words" $ do
convert 23 `shouldBe` "twenty-three"
convert 123 `shouldBe` "one hundred and twenty-three"
convert 3080... | futtetennista/IntroductionToFunctionalProgramming | test/Chapter4Spec.hs | mit | 2,499 | 0 | 16 | 605 | 424 | 211 | 213 | 40 | 1 |
module Main where
import ArExp (Term (..), evalAll)
main :: IO ()
main = do
let e = evalAll (TmIsZero (TmIf TmZero (TmSucc TmZero) TmZero))
print e
| ysukhoverkhov/taplic4 | app/04/Main.hs | mit | 164 | 0 | 16 | 43 | 74 | 39 | 35 | 6 | 1 |
--this program checks if this is a palyndrome
main = interact respondPalindromes
respondPalindromes contents = unlines (map (\xs -> if isPalindrome xs then "palindrome" else "not a palindrome") (lines contents))
where isPalindrome xs = xs == reverse xs | luisgepeto/HaskellLearning | 09 Input and Output/02_files_and_streams_2.hs | mit | 258 | 0 | 11 | 43 | 71 | 36 | 35 | 3 | 2 |
-- Interpolation Phalanx
-- http://www.codewars.com/kata/543cb1d8f6b726292d0000d7/
module Phalanx where
import Data.Monoid
import Data.String
import Control.Monad (liftM, liftM2)
type Name = String
data Phalanx
= Literal String
| Empty
| Join Phalanx Phalanx
| Repeat Int Phalanx
| Lookup Name
instance Is... | gafiatulin/codewars | src/6 kyu/Phalanx.hs | mit | 794 | 0 | 8 | 164 | 290 | 155 | 135 | 26 | 1 |
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module HsToCoq.Util.GHC.DynFlags (module DynFlags) where
import DynFlags
import Control.Monad.Trans
import qualified Control.Monad.Trans.Identity as I
import qualified Control.Monad.Trans.Writer.Strict as WS
import qualified Control.... | antalsz/hs-to-coq | src/lib/HsToCoq/Util/GHC/DynFlags.hs | mit | 1,751 | 0 | 9 | 318 | 546 | 320 | 226 | 29 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Module: TestCase.Network.SIP.Serialization.Uri
-- Description: Test of the URI serialization.
-- Copyright: Copyright (c) 2015-2016 Jan Sipr
-- License: MIT
module TestCase.Network.SIP.Serialization.Uri (tests)
where
import ... | Siprj/ragnarok | test/TestCase/Network/SIP/Serialization/Uri.hs | mit | 1,427 | 0 | 11 | 318 | 321 | 186 | 135 | 27 | 1 |
module Data.OneOrMore (
module Data.OneOrMore.Definition
) where
import Data.OneOrMore.Definition | thinkpad20/oneormore | src/Data/OneOrMore.hs | mit | 102 | 0 | 5 | 13 | 21 | 14 | 7 | 3 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module UserSpec (spec) where
import Test.Hspec (Spec, describe, it, shouldBe)
import AppContext (HasDbConn(..))
import qualified User as U
spec :: HasDbConn a => a -> Spec
spec context = describe "User" $ do
let conn = getDbConn context
it "can find by ... | robertjlooby/scotty-story-board | test/models/UserSpec.hs | mit | 629 | 0 | 16 | 164 | 205 | 104 | 101 | 15 | 1 |
import Data.Char
import Data.Bits
import Data.List
import Data.Ord
toStr xs = concat $ map (\x -> (chr x):"") xs
frequency s = map (\x->([head x], length x)) . group . sort $ s
frequencySorted s = reverse . sortBy (comparing snd) $ frequency s
every n xs = case drop (n-1) xs of
(y:ys) -> y... | stefan-j/ProjectEuler | q58.hs | mit | 1,140 | 2 | 13 | 320 | 561 | 276 | 285 | 30 | 2 |
module GHCJS.DOM.SVGAnimatedString (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/SVGAnimatedString.hs | mit | 47 | 0 | 3 | 7 | 10 | 7 | 3 | 1 | 0 |
module Main where
main =
print $ myButLast [1,2,3,4,5,6,7]
--myLast :: Integer -> Integer
--myButLast [x] = x
myButLast (x:(_:[])) = x
myButLast (x:xs) = myButLast x
| Rsgm/Haskell-problems | 2.hs | mit | 173 | 0 | 10 | 34 | 81 | 47 | 34 | 5 | 1 |
{-# LANGUAGE RankNTypes #-}
-- | Higher-level functions to interact with the elements of a stream. Most of
-- these are based on list functions.
--
-- Note that these functions all deal with individual elements of a stream as a
-- sort of \"black box\", where there is no introspection of the contained
-- elements. Valu... | moonKimura/conduit-1.0.8 | Data/Conduit/List.hs | mit | 12,112 | 1 | 15 | 3,204 | 3,009 | 1,621 | 1,388 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE GADTs #-}
module Ringo.Generator.Internal where
import qualified Data.Map as Map
import qualified Data.Text as Text
import Database.HsSqlPpp.Syntax (ScalarExpr)
import Data.List (find)
import Data.Monoid ((<>... | abhin4v/ringo | ringo-core/src/Ringo/Generator/Internal.hs | mit | 1,096 | 0 | 14 | 235 | 274 | 155 | 119 | 27 | 2 |
import Command.Log ( gtLog )
import Git ( commitLog, commitOid )
import Data.Tagged ( untag )
import qualified Data.Text as Text
main :: IO ()
main = gtLog >>= mapM_ printCommit
where
printCommit c = putStrLn $ unwords
[ take 7 $ show $ untag $ commitOid c
, Text.unpac... | cblp/gt | Command/LogMain.hs | gpl-2.0 | 366 | 0 | 13 | 117 | 122 | 65 | 57 | 9 | 1 |
#!/usr/bin/env runhaskell
-- | Counting DNA Nucleotides
-- Usage: DNA <dataset.txt>
import System.Environment(getArgs)
import Data.List(intercalate)
import qualified Data.ByteString.Char8 as C
main = do
(file:_) <- getArgs
dna <- C.readFile file
display . counts . head . C.lines $ dna
where
display = putStrL... | kerkomen/rosalind-haskell | stronghold/DNA.hs | gpl-2.0 | 395 | 0 | 10 | 72 | 128 | 68 | 60 | 9 | 1 |
-- xmonad: Personal module: Hook Layout
-- Author: Simon L. J. Robin | https://sljrobin.org
--------------------------------------------------------------------------------
module Hook_Layout where
--------------------------------------------------------------------------------
-- * `Appearance` -... | sljrobin/dotfiles | xmonad/.xmonad/lib/Hook_Layout.hs | gpl-2.0 | 2,861 | 0 | 15 | 688 | 322 | 198 | 124 | 30 | 1 |
-- http://conal.net/papers/push-pull-frp/push-pull-frp.pdf
import Control.Monad
import Control.Applicative
import Data.Monoid
type Time = Double
infinity = 1.0 / 0.0::Time
nagInfinity = -1.0 / 0.0 :: Time
type B a = Time -> a
type E a = [(Time, a)]
newtype Behavior a =
Behavior {
at :: B a
}
newtype Event ... | FiveEye/playground | lang/frp.hs | gpl-2.0 | 1,846 | 0 | 15 | 435 | 992 | 521 | 471 | 52 | 1 |
{- -----------------------------------------------------------------------------
ZDCPU16 is a DCPU-16 emulator.
Copyright (C) 2012 Luis Cabellos
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
the Free Software Foundation, eithe... | zhensydow/zdcpu16 | src/ZDCpu16/Render.hs | gpl-3.0 | 4,869 | 14 | 13 | 829 | 1,033 | 584 | 449 | 92 | 1 |
module L.Eval.Pure where
import qualified S.Type as S
import System.Timeout ( timeout )
import Control.Exception ( evaluate )
import Data.Maybe ( isJust )
-- | example due to Barendregt (NF size approx 10^6)
check1 = eval $ read "(ststs)"
-- | huge and quick (guess the size of the NF before evaluating!)
check2 = e... | jwaldmann/s | L/Eval/Pure.hs | gpl-3.0 | 1,605 | 0 | 17 | 438 | 496 | 267 | 229 | 28 | 3 |
module HLinear.NormalForm
( module Import
)
where
import HLinear.NormalForm.PLE as Import
import HLinear.NormalForm.PLH as Import
import HLinear.NormalForm.RREF as Import
| martinra/hlinear | src/HLinear/NormalForm.hs | gpl-3.0 | 178 | 0 | 4 | 26 | 36 | 26 | 10 | 5 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Users/Get.hs | mpl-2.0 | 4,130 | 0 | 16 | 1,025 | 700 | 408 | 292 | 100 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-dynamodb/gen/Network/AWS/DynamoDB/GetItem.hs | mpl-2.0 | 9,992 | 0 | 12 | 2,074 | 1,054 | 644 | 410 | 107 | 1 |
module Hastistics.Distributions where
import Hastistics.Types hiding ((/), (+))
import Hastistics.Fields
header :: [String]
header = ["k", "p"]
data BinominalTable = BinominalTable Integer Double
instance HSTable BinominalTable where
headersOf _ = header
dataOf (Binomina... | fluescher/hastistics | src/Hastistics/Distributions.hs | lgpl-3.0 | 3,378 | 34 | 13 | 915 | 1,342 | 696 | 646 | 57 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module CabalNew.Cabal
( cabal_
, cabalInit
, cabalSandbox_
, setMainIs
, sandbox
, cabalProject
) where
import ClassyPrelude hiding (FilePath)
import qualified D... | erochest/cabal-new | CabalNew/Cabal.hs | apache-2.0 | 2,849 | 0 | 13 | 852 | 684 | 347 | 337 | 65 | 2 |
-- Problem 117
import Data.Ratio ((%))
import Data.List (sort)
-- Assume (x,y) \in [0,1)^2.
circles (x,y) = takeWhile (<= 81 % 1) $ sort [distance (x, y) (a, b) | a <- [-10..10], b <- [-10..10]]
distance (x, y) (a, b) = delX + delY where
delX
| a == 0 = 0
| a > 0 = (a - x)^2
| a < 0 = (x - 1 - a)^2
d... | peterokagey/haskellOEIS | src/Sandbox/GridCircles.hs | apache-2.0 | 574 | 0 | 11 | 187 | 385 | 200 | 185 | 18 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Data.Avro.Parser
(AvroType(..),
parse
)
where
import qualified Data.Attoparsec.ByteString as P
import qualified Data.ByteString.Char8 as B
data AvroType = ANull
| AInt
| ABoolean
| ALong
| AFloat
... | tonicebrian/avro-haskell | Data/Avro/Parser.hs | apache-2.0 | 1,111 | 0 | 12 | 335 | 290 | 163 | 127 | 33 | 1 |
-----------------------------------------------------------------------------
-- Copyright 2012 Microsoft Corporation.
--
-- This is free software; you can redistribute it and/or modify it under the
-- terms of the Apache License, Version 2.0. A copy of the License can be
-- found in the file "license.txt" at the root ... | lpeterse/koka | src/Common/Message.hs | apache-2.0 | 3,043 | 0 | 18 | 837 | 788 | 412 | 376 | 53 | 5 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Template haskell tools for reading DOT files at build time for the purposes
of including the contents of those files in Eureka metadata readable by the
`cartographer-server` program.
-}
module Network.Eureka.Cartographer.TH (
addCartograph... | SumAll/haskell-cartographer-lib | src/Network/Eureka/Cartographer/TH.hs | apache-2.0 | 2,452 | 0 | 27 | 640 | 430 | 243 | 187 | 36 | 1 |
{-|
Module : Text.ABNF
Description : Top-level module
Copyright : (c) Martin Zeller, 2016
License : BSD2
Maintainer : Martin Zeller <[email protected]>
Stability : experimental
Portability : non-portable
-}
module Text.ABNF
( module Text.ABNF.ABNF
, module Text.ABNF.Document
) where
i... | Xandaros/abnf | src/Text/ABNF.hs | bsd-2-clause | 367 | 0 | 5 | 71 | 35 | 24 | 11 | 5 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : System.Ext2.FSChecks
-- Copyright : (C) 2014 Ricky Elrod
-- License : BSD2 (see LICENSE file)
-- Maintainer : Ricky Elrod <[email protected]>
-- Stability : experimental
-- Portability : lens
--
-- This module cont... | relrod/ext2 | src/System/Ext2/FSChecks.hs | bsd-2-clause | 1,139 | 0 | 7 | 169 | 120 | 79 | 41 | 13 | 1 |
twice :: Integer -> (Integer -> Integer) -> Integer
twice x f = f x + f x
square :: Integer -> Integer
square x = x * x
-- main = twice 5 square | capello/Haskell_Premier | Square.hs | bsd-2-clause | 146 | 0 | 8 | 36 | 63 | 32 | 31 | 4 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-|
Module : Web.Lightning.Session
Description : Session management.
Copyright : (c) Connor Moreside, 2016
License : BSD-3
Maintainer : [email protected]
Stability : experimental
Portability : POSIX
Defines interactions with the session endpoint.
-}
module Web.Lightnin... | cmoresid/lightning-haskell | src/Web/Lightning/Session.hs | bsd-3-clause | 1,500 | 0 | 8 | 451 | 155 | 93 | 62 | 18 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.IndependentScreens
-- Copyright : (c) 2009 Daniel Wagner
-- License : BSD3
--
-- Maintainer : <[email protected]>
-- Stability : unstable
-- Portability : unportable
--
-- Utility functi... | eb-gh-cr/XMonadContrib1 | XMonad/Layout/IndependentScreens.hs | bsd-3-clause | 8,282 | 0 | 20 | 1,737 | 1,084 | 639 | 445 | 67 | 4 |
{-# LANGUAGE GADTs, TypeSynonymInstances #-}
import Control.Applicative
import Control.Monad
import Data.Traversable
import Debug.Trace
class Monad m => MonadSuspend m where
suspend :: String -> m Int
data Program instr a where
Return :: a -> Program instr a
Ap :: Program instr (a -> b) -> Progra... | batterseapower/haskell-kata | OperationalSearchApplicative.hs | bsd-3-clause | 2,391 | 0 | 12 | 670 | 805 | 436 | 369 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
module TermTest where
import Control.Exception (ErrorCall(ErrorCall), evaluate)
import Test.HUnit
import Test.HUnit.Tools (assertRaises)
import Term
data Sort = D | F | G
deriving (Show, Eq)
data Fun = M | P | One | Zero | INV
deriving (Show, Eq)
instance Signat... | esengie/algebraic-checker | test/TermTest.hs | bsd-3-clause | 685 | 0 | 8 | 170 | 291 | 161 | 130 | 23 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Evalso.Cruncher.Base64Spec where
import qualified Evalso.Cruncher.FinalResult as FR
import Evalso.Cruncher.Request
import qualified Evalso.Cruncher.SandboxResult as SR
import Evalso.Cruncher.SELinux
import qualified Data.Map as Map
import Test.Hspec
spec :: Spec
spec = paral... | eval-so/cruncher | tests/Evalso/Cruncher/Base64Spec.hs | bsd-3-clause | 784 | 0 | 20 | 129 | 192 | 103 | 89 | 17 | 1 |
module Protocol_test
where
import Test.HUnit
import Protocol
import qualified Data.ByteString.Lazy.Char8 as BL
tests = TestList [TestLabel "Parsing input" parse_input_test,
TestLabel "All input label" label_all_test]
t_input1 = "[\"done\",[[0,\"ok\",0,[[0,\"disco://localhost/ddfs/vol0/blob/b\"... | zuzia/haskell_worker | tests/Protocol_test.hs | bsd-3-clause | 2,852 | 0 | 20 | 298 | 431 | 214 | 217 | 32 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
module Agon.APIConstructors where
import Agon.Types
import Agon.Agon
import Control.Monad.Trans.Either
import Servant
type ServantM = EitherT ServantErr IO
type AppM = AgonM ServantM
type AuthT... | Feeniks/Agon | app/Agon/APIConstructors.hs | bsd-3-clause | 940 | 0 | 10 | 169 | 322 | 178 | 144 | 22 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Geometry
-- Copyright : (c) 2011-2017 diagrams team (see LICENSE)
-- License : BSD-style (see LICENSE)
-- Maintainer : [email protected]
--
-- This module reexports the geometry library. Constr... | cchalmers/geometry | src/Geometry.hs | bsd-3-clause | 3,971 | 0 | 6 | 1,077 | 634 | 426 | 208 | 86 | 0 |
{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module Facebook.Gen.Environment
where
import Control.Monad
import Control.Lens hiding (coerce)
import qualified Data.Map.Strict as Map
import Data.Vector hiding (map, length, head, tail, (++), concat)
import qualified Data.Vector as V
import Data.Text hiding (map, length... | BeautifulDestinations/fb | gen/src/Facebook/Gen/Environment.hs | bsd-3-clause | 10,099 | 0 | 20 | 3,405 | 2,708 | 1,450 | 1,258 | 192 | 3 |
{-# LANGUAGE CPP #-}
module Main where
import Control.Monad.State (evalState, put, get)
import Data.Chimera
import Gauge.Main
import System.Random
#ifdef MIN_VERSION_ral
import qualified Data.RAList as RAL
#endif
sizes :: Num a => [a]
sizes = [100, 200, 500, 1000]
main :: IO ()
main = defaultMain
[ bgroup "read/... | Bodigrim/bit-stream | bench/Bench.hs | bsd-3-clause | 1,495 | 0 | 13 | 287 | 551 | 293 | 258 | 36 | 1 |
-----------------------------------------------------------------------------
-- | Command Line Config Options --------------------------------------------
-----------------------------------------------------------------------------
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module L... | abakst/liquidhaskell | src/Language/Haskell/Liquid/UX/Config.hs | bsd-3-clause | 3,216 | 0 | 9 | 852 | 356 | 239 | 117 | 44 | 0 |
{- |
Left-biased finite automata
-}
module FST.LBFA (
module FST.Automaton,
-- * Types
LBFA,
-- * Functions on LBFA
initial,
compileToLBFA,
compileToAutomaton
) where
import Control.Monad.State
import FST.RegTypes
import FST.Automaton
import FST.Deterministic
import FST.Complete
import FST.Utils (r... | johnjcamilleri/fst | FST/LBFA.hs | bsd-3-clause | 7,326 | 0 | 17 | 2,403 | 2,564 | 1,349 | 1,215 | 181 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Text
import Data.Text.Encoding (encodeUtf8)
import Pipes
import Pipes.Prelude (discard)
import Pipes.ByteString (writeHandle)
import Pipes.Parse (unwrap, wrap)
import Pipes.Tar
import Data.Time (getCurrentTime)
import System.IO (withFile, IOMode(WriteMode))
main :: IO ()
... | ocharles/pipes-tar | examples/writer.hs | bsd-3-clause | 666 | 0 | 17 | 117 | 232 | 123 | 109 | -1 | -1 |
module DX200 where
data DXVoiceParameters = DXVoiceParameters {
voice1 :: Voice
, voice2 :: Voice
, voice3 :: Voice
, voice4 :: Voice
, voice5 :: Voice
, voice6 :: Voice
, pitchEnvelope :: EnvelopeGenerator
, algorithm :: Int
, feedbackLevel :: Int
, oscPhaseInit :: OnOff
, pitchModulationDepth... | rumblesan/dx200-programmer | src/DX200.hs | bsd-3-clause | 2,628 | 0 | 9 | 540 | 678 | 425 | 253 | 82 | 0 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Network.QiitaTest where
import Network.Qiita
import Control.Monad.State
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as LB
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy.Char8 a... | jabaraster/network-qiita | src/Network/QiitaTest.hs | bsd-3-clause | 23,942 | 0 | 15 | 4,927 | 8,002 | 3,777 | 4,225 | 539 | 2 |
module Hearthstone where
import qualified System.Random.Shuffle as Rand
import Data.List(sort)
import Control.Monad.Random
type Card = Int
type Deck = [Card]
type Hand = [Card]
type Health = Int
type Mana = Int
data Player = Player Health Mana Hand Deck
fullDeck :: [Card]
fullDeck = [0,0,1,1,2,2,2,3,3,3,3,4,4,4,5,5... | steveshogren/haskell-katas | src/Hearthstone.hs | bsd-3-clause | 1,213 | 0 | 14 | 310 | 540 | 310 | 230 | 40 | 2 |
module Moodle.Translator (toLatex)
where
import Data.List (intercalate)
import Data.Scientific (floatingOrInteger)
import Moodle.Types (MoodleVal(..))
group :: String -> String
group s = '{':s ++ "}"
-- TODO: Use printf instead of string concatenation
-- | Convert a 'MoodleVal' value into a Latex string.
toLate... | rubik/moodle-to-latex | src/Moodle/Translator.hs | bsd-3-clause | 1,156 | 0 | 12 | 252 | 455 | 229 | 226 | 24 | 3 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Monad(
ServerEnv(..)
, ServerM
, newServerEnv
, runServerM
, runServerMIO
, serverMtoHandler
, AuthM(..)
, runAuth
) where
import Control.Monad.Base
import Control.Monad.Catch (MonadCatch, MonadThrow)
import Control.Monad.Except
import Control.Monad.Logg... | ivan-m/servant-auth-token | example/acid/src/Monad.hs | bsd-3-clause | 3,126 | 0 | 12 | 580 | 811 | 437 | 374 | -1 | -1 |
{-#LANGUAGE DeriveDataTypeable#-}
module Tc.TcDecl where
import Control.Monad
import Control.Monad.Trans
import Data.Generics
import Data.List (partition,union, intersect,(\\), nub)
import Language.Haskell.Exts hiding (name)
import BuiltIn.BuiltInTypes
import Tc.Assumption
import {-# SOURCE #-}Tc.TcExp
import Tc.T... | rodrigogribeiro/mptc | src/Tc/TcDecl.hs | bsd-3-clause | 8,622 | 4 | 16 | 2,816 | 3,338 | 1,701 | 1,637 | 227 | 3 |
-- | Simple textual diffing of JavaScript programs for inspecting test
-- failures
module Language.ECMAScript3.SourceDiff where
import Data.Algorithm.Diff
import Data.Algorithm.DiffOutput
import Language.ECMAScript3.Syntax
import Language.ECMAScript3.PrettyPrint
import Data.List (intersperse, intercalate)
jsDiff :: J... | sinelaw/language-ecmascript | src/Language/ECMAScript3/SourceDiff.hs | bsd-3-clause | 489 | 0 | 11 | 72 | 119 | 66 | 53 | 11 | 1 |
module Lib.Binary (runGet, runPut, encode, decode) where
import Data.Binary (Binary, Get, Put)
import Lib.ByteString (strictify, lazify)
import qualified Data.Binary as Binary
import qualified Data.Binary.Get as Get
import qualified Data.Binary.Put as Put
import qualified Data.ByteString as BS
{-# INLINE runGet #-}
r... | sinelaw/buildsome | src/Lib/Binary.hs | gpl-2.0 | 671 | 0 | 7 | 108 | 202 | 120 | 82 | 19 | 1 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1998
This module contains definitions for the IdInfo for things that
have a standard form, namely:
- data constructors
- record selectors
- method and superclass selectors
- primitive operations
-}
{-# LANGUAGE CPP #-}
module MkId (
... | christiaanb/ghc | compiler/basicTypes/MkId.hs | bsd-3-clause | 54,371 | 0 | 21 | 14,929 | 7,040 | 3,839 | 3,201 | 549 | 6 |
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
#include "ghcconfig.h"
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2004
--
-- runghc program, for invoking from a #! line in a script. For example:
--
-- script.lhs:
-- #!/usr/bin/env /usr/bin/r... | lukexi/ghc-7.8-arm64 | utils/runghc/runghc.hs | bsd-3-clause | 6,273 | 10 | 25 | 1,944 | 1,523 | 801 | 722 | 105 | 6 |
module System.Taffybar.DBus
( module System.Taffybar.DBus.Toggle
, appendHook
, startTaffyLogServer
, withLogServer
, withToggleServer
) where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Reader
import System.Log.DBus.Server
import System.Taffybar.Context
import System.Taffybar.DBus.Toggle
... | teleshoes/taffybar | src/System/Taffybar/DBus.hs | bsd-3-clause | 616 | 0 | 7 | 72 | 120 | 74 | 46 | 18 | 1 |
module MediaWiki.API.Query.ImageInfo.Import where
import MediaWiki.API.Types
import MediaWiki.API.Utils
import MediaWiki.API.Query.ImageInfo
import Text.XML.Light.Types
import Control.Monad
import Data.Maybe
stringXml :: String -> Either (String,[{-Error msg-}String]) ImageInfoResponse
stringXml s = parseDoc xml s
... | neobrain/neobot | mediawiki/MediaWiki/API/Query/ImageInfo/Import.hs | bsd-3-clause | 2,128 | 0 | 12 | 541 | 850 | 419 | 431 | 62 | 2 |
{-# LANGUAGE TypeFamilies #-}
module OverDirectThisModA (C, D)
where
import Data.Kind (Type)
data family C a b :: Type
type family D a b :: Type
| sdiehl/ghc | testsuite/tests/indexed-types/should_fail/OverDirectThisModA.hs | bsd-3-clause | 149 | 0 | 5 | 30 | 42 | 29 | 13 | -1 | -1 |
-- !!! Tests the various character classifications for a selection of Unicode
-- characters.
module Main where
import Data.Char
main = do
putStrLn (" " ++ concat (map (++" ") strs))
mapM putStrLn (map do_char chars)
where
do_char char = s ++ (take (12-length s) (repeat ' ')) ++ concat (map f bs)
... | ezyang/ghc | libraries/base/tests/unicode001.hs | bsd-3-clause | 1,369 | 0 | 13 | 395 | 330 | 190 | 140 | 34 | 2 |
module T10618 where
foo = Just $ Nothing <> Nothing
| urbanslug/ghc | testsuite/tests/rename/should_fail/T10618.hs | bsd-3-clause | 53 | 0 | 6 | 11 | 17 | 10 | 7 | 2 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.IO.Error
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :... | tolysz/prepare-ghcjs | spec-lts8/base/System/IO/Error.hs | bsd-3-clause | 11,609 | 0 | 11 | 2,369 | 1,342 | 791 | 551 | 156 | 1 |
{-# LANGUAGE ForeignFunctionInterface #-}
module Foo where
foreign export ccall foo :: Int -> IO Int
foo :: Int -> IO Int
foo n = return (length (f n))
f :: Int -> [Int]
f 0 = []
f n = n:(f (n-1))
| urbanslug/ghc | testsuite/tests/ffi/should_run/ffi002.hs | bsd-3-clause | 201 | 0 | 9 | 47 | 104 | 55 | 49 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Text.Dot.Attributes (
module Text.Dot.Attributes
-- * Arrows
, module Text.Dot.Attributes.Arrows
-- * Styles
, module Text.Dot.Attributes.Styles
) where
import Text.Dot.Attributes.Arrows
import Text.Dot.Attributes.Styles
import ... | NorfairKing/haphviz | src/Text/Dot/Attributes.hs | mit | 799 | 0 | 5 | 166 | 158 | 103 | 55 | 28 | 1 |
-- | SDL2 OpenGL contexts for Caramia.
--
-- This module provides functions to initialize SDL2 and use it to provide an
-- OpenGL context to Caramia library.
--
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings #-}
module Caramia.SDL2Context
(
-- * Running contexts
runSDL2Context
, ContextCreation(... | Noeda/caramia-sdl2 | src/Caramia/SDL2Context.hs | mit | 4,787 | 0 | 21 | 1,357 | 881 | 476 | 405 | 102 | 6 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE ScopedTypeVariables #-}
module
SynthMain
where
import Prelude hiding (id, (.))
import Control.Arrow
import FRP.Yampa
import Graphics.Gloss
import qualified Graphics.Gloss.Interface.IO.Game as G
import Buttons
import GlossInterface
import Mealy (stateTrans)
mainSF :: SF (Ev... | santolucito/Euterpea_Projects | QuantumArt/SynthMain.hs | mit | 829 | 1 | 12 | 225 | 254 | 140 | 114 | 30 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Main where
import Protolude
import Pipes
import Pipes.Concurrent
import ServerInputParser
import Console
import RemoteConsole
import Logger
import Drifter
import Event
import CommandExecutor
import Mapper
import Person
import Pipes.Safe
imp... | tort/mud-drifter | app/Main.hs | mit | 2,485 | 0 | 16 | 787 | 519 | 264 | 255 | 46 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Geometry.Point where
import Data.Aeson ((.=), ToJSON, toJSON)
import qualified Data.Aeson as J
data Point a = P a a
deriving (Eq, Ord)
instance (Show a) => Show (Point a) where
show (P x y) = "(P " ++ show x ++ " " ++ show y ++ ")"
instance (ToJSON a) => ToJSON (Point... | mietek/map-cutter | src/Geometry/Point.hs | mit | 1,060 | 0 | 10 | 241 | 440 | 232 | 208 | 25 | 1 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.HTMLKeygenElement
(js_checkValidity, checkValidity, js_setCustomValidity,
setCustomValidity, js_setAutofocus, setAutofocus, js_getAutofocus,
getAutofocus, js_setChallenge, setChallenge, js_g... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/HTMLKeygenElement.hs | mit | 9,391 | 120 | 11 | 1,402 | 1,909 | 1,033 | 876 | 139 | 1 |
module P04 where
-- | Length of list
-- >>> myLength [123, 456, 789]
-- 3
-- >>> myLength "Hello, world!"
-- 13
myLength :: [a] -> Int
myLength [] = 0
myLength (_:xs) = 1 + myLength xs
| briancavalier/h99 | p04.hs | mit | 186 | 0 | 7 | 40 | 53 | 31 | 22 | 4 | 1 |
import Data.Char (intToDigit)
import Numeric (showIntAtBase)
toBinary :: Int -> String
toBinary x = showIntAtBase 2 intToDigit x ""
doubleBasePalindromes :: Int -> Int
doubleBasePalindromes limit = sum [ x |
x <- [0..limit],
let y = show x,
let b = toBinary x,
y == reverse y,
b == rev... | samidarko/euler | problem036.hs | mit | 373 | 0 | 11 | 94 | 130 | 66 | 64 | 11 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
module TT.Example where
import TT.Operator
import TT.Judge
import TT.Context
import TT.Monad
import Abt.Concrete.LocallyNameless
import Abt.Class
import Control.Monad hiding (void)
import... | jonsterling/tt-singletons | src/TT/Example.hs | mit | 1,254 | 0 | 18 | 374 | 515 | 262 | 253 | -1 | -1 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Betfair.StreamingAPI.API.Context
( Context(..)
, initializeContext
) where
import Data.String.Conversions (cs)
import Data.Time
import ... | joe9/streaming-betfair-api | src/Betfair/StreamingAPI/API/Context.hs | mit | 1,472 | 0 | 14 | 297 | 336 | 200 | 136 | 35 | 1 |
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
-- | Sound support for the Spectrum 48k.
-- Largely based on this post: https://chuntey.wordpress.com/2013/02/28/how-to-write-zx-spectrum-games-chapter-3/.
-- | Most of the stuff in here uses (at least) the HL, BC, DE, and IX registers. If you are
-- making use of any of ... | dpwright/zxspectrum | src/ZXSpectrum/Sound.hs | mit | 2,173 | 0 | 10 | 537 | 571 | 311 | 260 | 54 | 1 |
module FreeTracker.Api.TH
( deriveJSONPrefixed
)where
import Data.Aeson.TH
import Data.Char
import Data.List.Split
import Language.Haskell.TH.Syntax
deriveJSONPrefixed :: Name -> Q [Dec]
deriveJSONPrefixed name =
deriveJSON (jsonOptions . length . last . splitOn "." . sho... | sirius94/free-tracker | free-tracker-server/src/FreeTracker/Api/TH.hs | gpl-3.0 | 819 | 0 | 11 | 294 | 185 | 101 | 84 | 17 | 1 |
{-# LANGUAGE TemplateHaskell, FlexibleInstances #-}
module Prolog.Quote (t,ts,c,pl) where
import Import hiding(lift)
import Language.Haskell.TH (listE, varE, viewP, mkName, Q, Exp, Pat)
import Language.Haskell.TH.Syntax (Lift(lift))
import Language.Haskell.TH.Lift (deriveLiftMany)
import Language.Haskell.TH.Quote (Qua... | nishiuramakoto/logiku | prolog/Prolog/Quote.hs | gpl-3.0 | 2,622 | 0 | 21 | 667 | 800 | 449 | 351 | 47 | 6 |
{-# LANGUAGE OverloadedStrings #-}
import SecondTransfer(
CoherentWorker
, DataAndConclusion
, tlsServeWithALPN
, http2Attendant
, enableConsoleLogging
)
import SecondTransfer.Http2(
makeSessionsContext
, defaultSessionsConfig
)
import Data.Conduit
import Data.ByteString.Char8 (pa... | alcidesv/lock_step_transfer | hs-src/Main.hs | gpl-3.0 | 2,434 | 2 | 12 | 772 | 433 | 232 | 201 | 54 | 3 |
import Control.Monad
import Data.Char
main = do
colors <- forM [1..5] (\a -> do
putStrLn $ show a ++ "?"
color <- getLine
return color)
mapM_ putStrLn colors
| prannayk/conj | Learning/control_monad.hs | gpl-3.0 | 175 | 0 | 15 | 45 | 76 | 36 | 40 | 8 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Students/Get.hs | mpl-2.0 | 5,949 | 0 | 18 | 1,370 | 798 | 470 | 328 | 117 | 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/RegionURLMaps/Validate.hs | mpl-2.0 | 4,510 | 0 | 18 | 1,071 | 551 | 328 | 223 | 90 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Services/Versions/Instances/List.hs | mpl-2.0 | 7,703 | 0 | 23 | 1,782 | 1,053 | 610 | 443 | 160 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-taskqueue/gen/Network/Google/Resource/TaskQueue/Tasks/List.hs | mpl-2.0 | 3,009 | 0 | 15 | 745 | 388 | 233 | 155 | 62 | 1 |
lucky :: (Integral a) => a -> String
lucky 7 = "Lucky Number Seven!"
lucky x = "Sorry pal, you're out of luck!"
sayMe :: (Integral a) => a -> String
sayMe 1 = "One!"
sayMe 2 = "Two!"
sayMe 3 = "Three!"
sayMe 4 = "Four!"
sayMe 5 = "Five!"
sayMe x = "Not between 1 and 5"
--this seems as bad as if statements but whatever... | alexliew/learn_you_a_haskell | 3_syntax_in_functions.hs | unlicense | 6,224 | 6 | 11 | 1,626 | 1,247 | 695 | 552 | 72 | 3 |
import System.Random
import Data.List
import Control.Applicative
import Control.Monad
import Graphics.GD
import Data.Function
import System.Environment
import System.Exit
type Polygon = [Point]
type Site = (Point, Color)
imgsize = (600, 400)
numpoints = 20
sitecolor = rgb 0 0 0 -- black
outlinecolor = rgb 255 0 0 ... | yshklarov/voronoi | voronoi.hs | unlicense | 3,072 | 1 | 14 | 867 | 1,311 | 687 | 624 | 75 | 1 |
module Graham.A300518 (a300518) where
import HelperSequences.A006530 (a006530)
import HelperSequences.A007913 (a007913)
a300518 :: Integer -> Integer
a300518 = a006530 . a007913
| peterokagey/haskellOEIS | src/Graham/A300518.hs | apache-2.0 | 179 | 0 | 5 | 21 | 49 | 29 | 20 | 5 | 1 |
{- |
Module : Lambda.Name
Description : Binding name.
Copyright : (c) Paweł Nowak
License : Apache v2.0
Maintainer : [email protected]
Stability : experimental
Portability : portable
-}
module Lambda.Name where
import Data.String
import Data.Text.Lazy (Text, pack)
-- Use a simple text for now... | pawel-n/lambda | Lambda/Name.hs | apache-2.0 | 612 | 0 | 6 | 129 | 83 | 50 | 33 | 9 | 1 |
module Main where
import Options.Applicative
import Data.Monoid
import Util.Test
import Util.DiffParser
main :: IO ()
main = do
op <- execParser optsHelper
case op of
Conflict f -> processConflictFolder f >> return ()
Patch s d j _ -> patchFiles s d j
Preprocess f -> runMinify f
data Opts =
Confl... | nazrhom/vcs-clojure | app/Main.hs | bsd-3-clause | 1,411 | 0 | 17 | 415 | 437 | 215 | 222 | 59 | 3 |
--
-- (c) The University of Glasgow
--
module Avail (
Avails,
AvailInfo(..),
IsPatSyn(..),
avail,
patSynAvail,
availsToNameSet,
availsToNameSetWithSelectors,
availsToNameEnv,
availName, availNames, availNonFldNames,
availNamesWithSelectors,
availFlds,
stableAvailCmp
) ... | vikraman/ghc | compiler/basicTypes/Avail.hs | bsd-3-clause | 7,066 | 0 | 15 | 2,070 | 1,233 | 647 | 586 | 98 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-- |
-- Module : Data.Array.Nikola.Backend.C.Codegen
--... | mainland/nikola | src/Data/Array/Nikola/Backend/C/Codegen.hs | bsd-3-clause | 45,486 | 2 | 22 | 14,397 | 13,182 | 6,974 | 6,208 | -1 | -1 |
-- | Auxiliary functions for traversing recursive data structures such as
-- grammars, and for converting mappings to arrays.
module Data.Parser.Grempa.Auxiliary.Auxiliary where
import Control.Monad.State
import Data.Array
import Data.Map(Map)
import qualified Data.Map as M
import Data.Maybe
import Data.Set(Set)
impo... | ollef/Grempa | Data/Parser/Grempa/Auxiliary/Auxiliary.hs | bsd-3-clause | 3,150 | 0 | 11 | 869 | 926 | 496 | 430 | 56 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
module Protocol.ROC.PointTypes.PointType42 where
import Data.Binary.Get (getByteString,
Get)
import Data.ByteString (ByteString)
import Prelude (($),
return,
Eq,
... | plow-technologies/roc-translator | src/Protocol/ROC/PointTypes/PointType42.hs | bsd-3-clause | 9,208 | 0 | 9 | 5,055 | 755 | 418 | 337 | 164 | 1 |
{-# LANGUAGE DeriveGeneric #-}
module Budget.Core.Data
( module Budget.Core.Data.Amount
, module Budget.Core.Data.Category
, module Budget.Core.Data.Date
, module Budget.Core.Data.Item
, module Budget.Core.Data.ItemTemplate
, module Budget.Core.Data.Income
, module Budget.Core.Data.Expense
... | utky/budget | src/Budget/Core/Data.hs | bsd-3-clause | 1,277 | 0 | 8 | 269 | 212 | 146 | 66 | 28 | 0 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Flexi... | FranklinChen/music-score | src/Music/Score/Export/Lilypond.hs | bsd-3-clause | 24,372 | 0 | 28 | 7,373 | 5,236 | 2,773 | 2,463 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module System.Sound where
import Control.Monad.State
import Data.ECS
import Control.Lens.Extra
import Data.Yaml
import GHC.Generics
data SoundSystem = SoundSystem { _ssBlah :: Int } derivin... | lukexi/extensible-ecs | app/System/Sound.hs | bsd-3-clause | 915 | 0 | 9 | 147 | 236 | 125 | 111 | 26 | 1 |
module Lib
( baseIntegral
, sqrIntegral
) where
import Prelude hiding ((.))
import Control.Wire
import FRP.Netwire
baseIntegral :: (Monad m, HasTime t s, Fractional a) => Wire s () m a a
baseIntegral = integral 0 . 1
sqrIntegral :: (Monad m, HasTime t s, Fractional t) => Wire s () m a t
sqrIntegral = int... | rmcmaho/tasklib | src/Lib.hs | bsd-3-clause | 337 | 0 | 7 | 77 | 139 | 76 | 63 | 10 | 1 |
module Enemy where
import Types.Hitbox
import Types.Drawable
import Graphics.Gloss.Data.Vector
import Graphics.Gloss.Data.Point
class (Drawable a, Hitbox a)=>Enemy a where
health :: a -> Int
moveV :: a -> Vector
xy :: a -> (Point, Point)
| Smurf/dodgem | src/Types/Enemy.hs | bsd-3-clause | 267 | 0 | 8 | 63 | 85 | 50 | 35 | 9 | 0 |
-- Testcases for assertion optimization and Ivory to ACL2 compilation.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main (main) where... | GaloisInc/ivory-backend-acl2 | Testcases.hs | bsd-3-clause | 5,648 | 0 | 16 | 1,516 | 2,134 | 1,070 | 1,064 | 138 | 2 |
-- | Holds the default definition string.
module Data.Quantities.DefaultUnits (defaultDefString) where
-- | View the source code for this declaration to see what units and prefixes
-- are defined by default.
--
-- This string holds the definitions for units and prefixes. Base units are
-- defined by the name of the un... | jdreaver/quantities | library/Data/Quantities/DefaultUnits.hs | bsd-3-clause | 12,394 | 0 | 6 | 2,852 | 809 | 558 | 251 | 244 | 1 |
module Problem84Tests
( problem84Tests
) where
import Test.HUnit
import Problem84
testFindPosition :: Test
testFindPosition = TestCase $ do
assertEqual "GO position" 0 (findPosition "GO")
assertEqual "JAIL position" 10 (findPosition "JAIL")
testNextCellFromGroup :: Test
testNextCellFromGroup = TestCase $... | candidtim/euler | test/Problem84Tests.hs | bsd-3-clause | 670 | 0 | 12 | 99 | 181 | 91 | 90 | 14 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Test.Sunlight
( Description
, Compiler
, GhcPkg
, Cabal
, TestInputs(..)
, runTests
) where
import Distribution.Package
import Distribution.Text
import Test.Sunlight.Shell
import System.Directory
import Distribution.PackageDescription
import Distribution.PackageD... | massysett/sunlight | lib/Test/Sunlight.hs | bsd-3-clause | 17,225 | 0 | 20 | 3,918 | 3,774 | 2,020 | 1,754 | 366 | 3 |
{-# LANGUAGE ViewPatterns, OverloadedStrings #-}
module Insomnia.Typecheck.Selfify
( selfifySignature
, selfifyTypeDefn
) where
import Data.Monoid (Monoid(..), (<>))
import qualified Unbound.Generics.LocallyNameless as U
import qualified Unbound.Generics.LocallyNameless.Unsafe as UU
import Insom... | lambdageek/insomnia | src/Insomnia/Typecheck/Selfify.hs | bsd-3-clause | 4,286 | 0 | 21 | 1,081 | 1,038 | 554 | 484 | 76 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.