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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE
FlexibleContexts
, FlexibleInstances
, FunctionalDependencies
, MultiParamTypeClasses
, KindSignatures
, UndecidableInstances #-}
module T7875 where
class Het a b | a -> b where
het :: m (f c) -> a -> m b
class GHet (a :: * -> *) ... | urbanslug/ghc | testsuite/tests/typecheck/should_compile/T7875.hs | bsd-3-clause | 653 | 0 | 10 | 182 | 248 | 132 | 116 | -1 | -1 |
import Data.Char (ord, chr)
chunksOf _ [] = []
chunksOf n xs = take n xs : (chunksOf n $ drop n xs)
score = (+10) . sum . map ord
word = chr . (`rem` 128) . sum
main = do
contents <- getContents
let scores = map (word . map score) $ chunksOf 1000 $ lines contents
putStrLn scores
| MAPSuio/spring-challenge16 | words_words_words/larstvei.hs | mit | 289 | 0 | 15 | 70 | 155 | 78 | 77 | 9 | 1 |
module Main where
import LatexNodes (emitDoc,varDecs)
import Parser (parseDoc)
import Text.ParserCombinators.Parsec (parse)
import Text.Printf (printf)
import System.Environment
doIO :: String -> String -> String -> IO ()
doIO proLF texF outFile = do
p <- readFile proLF
txt <- readFile texF
txt' <- case p... | ezrosent/latexnodes | Main.hs | mit | 648 | 0 | 12 | 158 | 242 | 122 | 120 | 18 | 2 |
{-# LANGUAGE RecursiveDo, LambdaCase #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE TypeOperators, TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Do... | literate-unitb/literate-unitb | src/Document/Machine.hs | mit | 11,584 | 0 | 26 | 4,187 | 3,808 | 2,040 | 1,768 | -1 | -1 |
{-# LANGUAGE CPP, OverloadedStrings #-}
module Haste.App.Server (serverLoop) where
import Haste.App.Transport
import Haste.App.Server.Type
import Data.Typeable
#ifdef __HASTE__
serverLoop _ _ = pure undefined
instance Typeable a => MonadClient (EnvServer a) where
remoteCall _ _ _ = pure undefined
#else
import Contro... | valderman/haste-app | src/Haste/App/Server.hs | mit | 3,123 | 0 | 7 | 684 | 83 | 47 | 36 | 66 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Network.Monitoring.Riemann.UDP (
module Network.Monitoring.Riemann.Types,
module Data.Int,
Client, makeClient,
sendEvent, sendEvent'
{-, sendEvent'-}
) where
import Network.Monitoring.Riemann.Types
import Data.Default
import Data.Int... | capital-match/riemann-hs | src/Network/Monitoring/Riemann/UDP.hs | mit | 5,279 | 0 | 18 | 1,357 | 604 | 337 | 267 | 51 | 2 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Haggcat.JSON.Address where
import qualified Data.Aeson as Aeson
import Data.Text (Text)
import GHC.Generics
data Address = Address { address1 :: Maybe Text
, address2 :: Maybe... | carymrobbins/haggcat | src/Haggcat/JSON/Address.hs | mit | 694 | 0 | 9 | 294 | 137 | 78 | 59 | 16 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
module UI ( uiMain ) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Concurrent.STM (atomically, newTMVar, readTMVar,
swapTMVar)
import ... | Bogdanp/ff | src/UI.hs | mit | 5,212 | 0 | 20 | 1,593 | 1,352 | 669 | 683 | 110 | 3 |
module LLMH_TypeInference where
import LLMH_ExpType
import LLMH_TypeEnvironments
--------------------------------------------------------------------------
inferType :: TypeEnv -> Exp -> [String] -> (TypeSubst, Type, [String])
-- inferType tenv exp as
--
---- Performs type inference for expression exp in type envir... | jaanos/TPJ-2015-16 | homework2/LLMH_TypeInference.hs | mit | 4,014 | 0 | 13 | 947 | 1,629 | 864 | 765 | 75 | 2 |
{-# LANGUAGE ViewPatterns #-}
module FrontEnd.Lex.Layout(doLayout,preprocessLexemes,Token(..)) where
import Control.Applicative
import Control.Monad.Reader
import Data.Char(toUpper,ord)
import FrontEnd.Lex.Lexer
import FrontEnd.SrcLoc
import Options
import PackedString
import qualified Data.IntMap as IM
import qualifi... | m-alvarez/jhc | src/FrontEnd/Lex/Layout.hs | mit | 10,777 | 0 | 20 | 3,049 | 5,461 | 2,820 | 2,641 | -1 | -1 |
{- |
= Secret-key encryption
== Security Model
The 'stream' function, viewed as a function of the nonce for a
uniform random key, is designed to meet the standard notion of
unpredictability (PRF). For a formal definition see, e.g., Section 2.3
of Bellare, Kilian, and Rogaway, "The security of the cipher block
chaining... | dnaq/crypto-sodium | src/Crypto/Sodium/Stream.hs | mit | 4,014 | 0 | 4 | 842 | 72 | 55 | 17 | 15 | 0 |
{-# LANGUAGE CPP #-}
module SoOSiM.Examples.Example1 where
import qualified System.FilePath as FilePath
import SoOSiM.Examples.Loader
import SoOSiM.Types
#ifdef CABAL
import Paths_SoOSiM_components
#else
getDataFileName :: FilePath -> IO FilePath
getDataFileName = return . ("../" ++)
#endif
simstate :: IO SimSt... | christiaanb/SoOSiM-components | src/SoOSiM/Examples/Example1.hs | mit | 474 | 0 | 11 | 73 | 78 | 44 | 34 | 12 | 1 |
{-
Copyright (C) 2017 WATANABE Yuki <magicant@wonderwand.net>
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; either version 2 of the License, or
(at your option) any later version.
This program is ... | magicant/flesh | src/Flesh/Language/Parser/Error/Print.hs | gpl-2.0 | 5,240 | 0 | 10 | 968 | 1,074 | 600 | 474 | 92 | 1 |
{- |
Module : $Header$
Description : abstract syntax of CASL specification libraries
Copyright : (c) Klaus Luettich, Uni Bremen 2002-2006
License : GPLv2 or higher, see LICENSE.txt
Maintainer : till@informatik.uni-bremen.de
Stability : provisional
Portability : non-portable(Grothendieck)
Abstract ... | nevrenato/Hets_Fork | Syntax/AS_Library.der.hs | gpl-2.0 | 4,054 | 0 | 11 | 1,053 | 619 | 349 | 270 | 53 | 1 |
{- Let's break some real crypto -}
import Crypto.Cipher.AES
import qualified Data.ByteString as B (ByteString,
append,
take,
drop,
last)
import qualified Data.ByteString.Char8 as B8 (pack, unpack, lengt... | CharlesRandles/cryptoChallenge | challenge12.hs | gpl-3.0 | 3,184 | 0 | 14 | 1,129 | 791 | 427 | 364 | 64 | 2 |
import qualified Data.Map as Map
import Data.Char
phoneBook :: Map.Map String String
phoneBook = Map.fromList $
[("betty", "123-3333")
,("bonnie", "123-1111")
,("clyde","777-2222")
]
string2digits :: String -> [Int]
string2digits = map digitToInt . filter isDigit
phoneBookToMap :: (Ord k) => [(k, String)] ->... | medik/lang-hack | Haskell/LearnYouAHaskell/c06/data.map.hs | gpl-3.0 | 442 | 0 | 8 | 78 | 160 | 89 | 71 | 12 | 1 |
module Jumpie.Geometry.Point where
import Linear.V2
import ClassyPrelude
type Point2 a = V2 a
pointToList :: Point2 a -> [a]
pointToList (V2 a b) = [a,b]
cross2 :: Num a => Point2 a -> Point2 a -> a
cross2 (V2 x1 y1) (V2 x2 y2) = x1 * y2 - y1 * x2
{-
import Prelude(Num,(+),(*),(-),negate,abs,signum,fromInteger,Floa... | pmiddend/jumpie | lib/Jumpie/Geometry/Point.hs | gpl-3.0 | 1,683 | 0 | 8 | 359 | 127 | 68 | 59 | 8 | 1 |
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
module EstuaryServer where
import Data.List ((\\))
import Data.Maybe (fromMaybe,isJust,fromJust)
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Map as Map
import qualified Data.IntMap as IntMa... | d0kt0r0/estuary | server/src/EstuaryServer.hs | gpl-3.0 | 19,700 | 0 | 19 | 4,430 | 5,925 | 2,822 | 3,103 | 421 | 11 |
module ParseSigs(Signature(Sig),parseSigs) where
import Tokenizer(Token(Symbol,Zero,One,Equal,Dot,Nil))
import SyntaxTree(Bits,Pattern(Literal,Binding,Wildcard))
data Signature = Sig String [Pattern] [Token]
parseSigs :: [Token] -> [Signature]
parseSigs (Symbol s:tokens) = parseSig s [] tokens []
parseSigs [] = []
... | qpliu/esolang | 01_/hs/interp/ParseSigs.hs | gpl-3.0 | 1,393 | 0 | 12 | 218 | 566 | 300 | 266 | 29 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Language.ArrayForth.NativeProgram where
import Control.Applicative ((<$>), (<*>))
import Control.Monad ((<=<))
import Data.Bits (s... | TikhonJelvis/array-forth | src/Language/ArrayForth/NativeProgram.hs | gpl-3.0 | 4,704 | 0 | 14 | 1,404 | 1,470 | 780 | 690 | 72 | 7 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Environments/Sessions/EntityTypes/List.hs | mpl-2.0 | 7,662 | 0 | 18 | 1,580 | 890 | 518 | 372 | 140 | 1 |
{-# 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 #-}
-- ... | olorin/amazonka | amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/DescribeExportTasks.hs | mpl-2.0 | 6,500 | 0 | 13 | 1,413 | 939 | 560 | 379 | 112 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Placements/List.hs | mpl-2.0 | 15,138 | 0 | 35 | 4,964 | 2,375 | 1,354 | 1,021 | 327 | 1 |
module SICP where
---- 2.17 ----------
lastPair :: [a] -> [a]
lastPair [elem] = [elem]
lastPair (first:rest) = lastPair rest
---- 2.18 ----------
myReverse :: [a] -> [a]
myReverse lst = rec lst []
where rec [] acc = acc
rec (first:rest) acc = rec rest $ first:acc
---- 2.19 ----------
-- You actuall... | CompSciCabal/SMRTYPRTY | sicp/v1/chapter-2.2/inaimathi.hs | unlicense | 2,390 | 0 | 10 | 617 | 768 | 403 | 365 | 47 | 2 |
import Data.List
cal :: Int -> [Int] -> (Int,Float)
cal y (b:r:1:_) =
let r' = fromIntegral r
y' = fromIntegral y
in
( b, (1.0 + y' * r'/ 100.0) )
cal y (b:r:2:_) =
let r' = fromIntegral r
y' = fromIntegral y
in
( b, (1.0 + r'/ 100) ** y' )
ans ([0]:_) = []
ans ([n]:[y]:l) =
let d = take... | a143753/AOJ | 0240.hs | apache-2.0 | 579 | 0 | 14 | 193 | 381 | 198 | 183 | 22 | 1 |
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GADTs #-}
module World.Read (
white,
black,
readWorld,
readAgents,
defaultAgent,
readBitmap,
) where
import Prelude hiding (log)
import Codec.BMP
import Control.Arrow (second, (***))
import Control.Lens
import Contr... | jtapolczai/wumpus | World/Read.hs | apache-2.0 | 8,676 | 0 | 19 | 2,664 | 2,410 | 1,312 | 1,098 | -1 | -1 |
module Problem062 where
import GHC.Exts
import Data.List
main =
print $ head $ concatMap (permGroups 6) $ map cubes [1 ..]
cubes n = takeWhile (< 10 ^ n) $ dropWhile (< 10 ^ (n - 1)) $ map (^ 3) [1 ..]
permGroups n cs = filter (\g -> length g == n) $ groupWith (sort . show) cs
| vasily-kartashov/playground | euler/problem-062.hs | apache-2.0 | 284 | 0 | 11 | 66 | 151 | 81 | 70 | 7 | 1 |
{-# LANGUAGE RankNTypes #-}
module Lycopene.Database.Persist where
import Data.Typeable
import Control.Exception (Exception)
import Control.Monad.Except (ExceptT, runExceptT)
import Control.Monad.Trans (lift)
import Control.Monad.IO.Class (liftIO, MonadIO)
import... | utky/lycopene | src/Lycopene/Database/Persist.hs | apache-2.0 | 2,233 | 0 | 10 | 483 | 659 | 353 | 306 | 49 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Kubernetes.V1.NamespaceSpec where
import GHC.Generics
import qualified Data.Aeson
-- | NamespaceSpec describes the attributes on a Namespace.
... | minhdoboi/deprecated-openshift-haskell-api | kubernetes/lib/Kubernetes/V1/NamespaceSpec.hs | apache-2.0 | 693 | 0 | 10 | 92 | 81 | 49 | 32 | 13 | 0 |
-- http://www.codewars.com/kata/5420fc9bb5b2c7fd57000004
module Term where
import Data.Tuple
import qualified Data.Map.Strict as Map
highestRank :: Ord c => [c] -> c
highestRank xs = (snd . maximum . map swap . Map.toList . Map.fromListWith (+)) [(x, 1) | x <- xs] | Bodigrim/katas | src/haskell/6-Highest-Rank-Number-in-an-Array.hs | bsd-2-clause | 265 | 0 | 10 | 40 | 97 | 55 | 42 | 5 | 1 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Time.NL.BE.Corpus
( allExamples
) where
import Data.Strin... | facebookincubator/duckling | Duckling/Time/NL/BE/Corpus.hs | bsd-3-clause | 655 | 0 | 10 | 121 | 119 | 77 | 42 | 13 | 1 |
module Passman.Engine.KeyDerivation.Internal (checkRequest)
where
import qualified Data.Either.Validation as V
import Data.EitherR (fmapL)
import Data.Semigroup ((<>))
import qualified Passman.Engine.ByteString as B
import Passman.Engine.Errors
checkRequest ... | chwthewke/passman-hs | src/Passman/Engine/KeyDerivation/Internal.hs | bsd-3-clause | 822 | 0 | 9 | 188 | 211 | 117 | 94 | 15 | 4 |
{-# LANGUAGE TemplateHaskell
, DeriveDataTypeable #-}
module Merchandise.Types.Effect
( Effects(..)
, Modifier(..)
-- Lenses
, modifierID
, duration
, modifier
, StatMod(..)
, SkillMod(..)
, SkillModType(..)
, newEffects
, new... | trobertson/merch | src/Merchandise/Types/Effect.hs | bsd-3-clause | 2,866 | 0 | 10 | 688 | 737 | 423 | 314 | 70 | 2 |
module WagesConf where
import qualified Cookbook.Essential.IO as IO
import qualified Cookbook.Project.Quill.Quill2.Meta as Qm
import System.IO
fl_syn = ".wage"
wf_syn = "wagesFile"
cf_syn = "configuration"
em_syn = "Error! Missing "
ed_syn = "Error! Multiple "
allArguments = [("add x", "Add x to the wages file."),
... | natepisarski/Wages | WagesConf.hs | bsd-3-clause | 1,519 | 0 | 16 | 337 | 454 | 243 | 211 | 37 | 3 |
{-# LANGUAGE ExplicitNamespaces, CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Singletons.TH
-- Copyright : (C) 2013 Richard Eisenberg
-- License : BSD-style (see LICENSE)
-- Maintainer : Richard Eisenberg (eir@cis.upenn.edu)
-- Stability ... | int-index/singletons | src/Data/Singletons/TH.hs | bsd-3-clause | 5,516 | 0 | 17 | 1,088 | 974 | 588 | 386 | 93 | 3 |
module Doukaku.CrossCircleTest (tests) where
import Distribution.TestSuite
import Doukaku.TestHelper
import qualified Doukaku.CrossCircle as CrossCircle
tests :: IO [Test]
tests = createTests $ newDoukakuTest {
tsvPath = "test/Doukaku/crosscircle.tsv"
, solve = CrossCircle.solve
}
| hiratara/doukaku-past-questions-advent-2013 | test/Doukaku/CrossCircleTest.hs | bsd-3-clause | 290 | 0 | 8 | 39 | 65 | 40 | 25 | 8 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Text.HTML.TagSoup.Pretty (
prettyXML
) where
-- Prettyprints XML strings. Used for debugging and inspection.
import Data.List
import Data.Monoid
import Data.Text hiding (concat, unwords)
import Text.HTML.TagSoup
import Text.HTML.TagSoup.Tree
import Text.StringLike
-- | ... | anchor/haskell-opensrs | lib/Text/HTML/TagSoup/Pretty.hs | bsd-3-clause | 2,460 | 56 | 15 | 534 | 698 | 388 | 310 | 55 | 4 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
-- Genetic algorithm implementation
{-|
Module : Auto.GeneticSearch
Description : The genetic... | iu-parfunc/AutoObsidian | src/Auto/GeneticSearch.hs | bsd-3-clause | 7,946 | 0 | 28 | 2,558 | 1,975 | 1,033 | 942 | 157 | 5 |
module MRPSpec (main, spec) where
import Language.Haskell.Migrate.MRP
import qualified GHC as GHC
-- import qualified Outputable as GHC
import Data.Algorithm.Diff
import System.Directory
import Control.Logging
import Test.Hspec
-- ------------------------------------------------------------... | hvr/Hs2010To201x | test/MRPSpec.hs | bsd-3-clause | 2,232 | 0 | 14 | 437 | 551 | 279 | 272 | 48 | 2 |
{-# LANGUAGE PatternGuards, FlexibleContexts #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.CFamily.C.Analysis.DeclAnalysis
-- Copyright : (c) 2008 Benedikt Huber
-- License : BSD-style
-- Maintainer : benedikt.huber@gmail.com
-- Stability :... | micknelso/language-c | src/Language/CFamily/C/Analysis/DeclAnalysis.hs | bsd-3-clause | 28,670 | 1 | 18 | 7,217 | 7,502 | 3,849 | 3,653 | 394 | 20 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS -fno-warn-orphans #-}
module Data.ByteString.Base32Spec (spec) where
import Control.Applicative
import Data.ByteString as BS
import Data.ByteString.Char8 as BC
import Data.ByteString.Base32 as Base32
import Data.Char
import Test.Hspec
import Test.QuickCheck
instance Arb... | pxqr/base32-bytestring | tests/Data/ByteString/Base32Spec.hs | bsd-3-clause | 2,684 | 0 | 17 | 715 | 761 | 372 | 389 | 59 | 1 |
import Vec
import Prelude hiding (replicate, sum, max, take, drop, (!!), read)
import GHC.TypeLits
main = do
v1 :: MVec 10 Double <- replicate 1.5
v2 :: MVec 10 Double <- replicate 2.0
print v1
d <- dot v1 v2
s <- sum v1
let v3 :: MVec 5 Double = take v1
let v4 :: MVec 9 Double = drop v1
s2 <- sum v3... | mxswd/ylj-2014 | 4_data/VecExample.hs | bsd-3-clause | 803 | 0 | 11 | 199 | 200 | 96 | 104 | -1 | -1 |
{-# LANGUAGE StandaloneDeriving, UndecidableInstances #-}
-- | Metadata about what a datatype looks like
--
-- In @generics-sop@, the metadata is completely independent of the main
-- universe. Many generic functions will use this metadata, but other don't,
-- and yet others might need completely different metadata.
--... | phadej/generics-sop | src/Generics/SOP/Metadata.hs | bsd-3-clause | 3,096 | 0 | 13 | 551 | 573 | 334 | 239 | -1 | -1 |
module D6Spec where
import Test.Hspec
import Text.Megaparsec (parse, ParseError, Dec)
import D6Lib
-- `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 "parser" $ do
it "parses ... | wfleming/advent-of-code-2016 | 2017/D6/test/D6Spec.hs | bsd-3-clause | 945 | 0 | 17 | 250 | 319 | 163 | 156 | 26 | 1 |
module TokenTest where
import Control.Arrow
import Tokenizer
tokenExpected :: [(String, Program)]
tokenExpected = map (second (Program . (++ [EOF]))) [
"Package" `tup` [Package, W "Package", End, W "Package", Semi]
, "FunctionStatements" `tup` [Package, W "Package", Function, W "f", Algorit... | bergmark/mmdoc | src/TokenTest.hs | bsd-3-clause | 1,049 | 0 | 11 | 434 | 336 | 195 | 141 | 20 | 1 |
{-# LANGUAGE Rank2Types, ViewPatterns, FlexibleContexts #-}
import Call hiding (new')
import Audiovisual.Deck as Deck
import Control.Lens
import Control.Monad.State.Strict
import Data.Foldable (foldMap)
import qualified Data.Set as Set
import Data.Set (Set)
import System.IO.Unsafe
import Data.List
import Data.List.Spli... | fumieval/rhythm-game-tutorial | src/tutorial-extended.hs | bsd-3-clause | 4,042 | 0 | 21 | 904 | 1,809 | 926 | 883 | 97 | 4 |
-----------------------------------------------------------
-- |
-- Module : Optimize
-- Copyright : Daan Leijen (c) 1999, daan@cs.uu.nl
-- HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net
-- License : BSD-style
--
-- Maintainer : haskelldb-users@lists.sourceforge.net
-- Stabili... | m4dc4p/haskelldb | src/Database/HaskellDB/Optimize.hs | bsd-3-clause | 11,678 | 175 | 13 | 3,517 | 3,108 | 1,662 | 1,446 | -1 | -1 |
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__
{-# LANGUAGE MagicHash, UnboxedTuples,
NamedFieldPuns, BangPatterns, RecordWildCards #-}
#endif
{-# OPTIONS_HADDOCK prune #-}
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Trustworthy #-}
#endif
-- |
-- Module : Data.ByteString
-- Copyright : (c) The Univer... | markflorisson/hpack | testrepo/bytestring-0.10.2.0/Data/ByteString.hs | bsd-3-clause | 76,902 | 0 | 20 | 22,351 | 13,330 | 7,196 | 6,134 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
-- |
module Data.Protobuf (
-- * Data types
QName(..)
, PbDatatype(..)
, PbField(..)
, PbType(..)
, PbOption(..)
, OptionVal(..)
-- * Reading of protobuf
, loadProtobuf
) where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Maybe
import Data.F... | Shimuuar/protobuf | Data/Protobuf.hs | bsd-3-clause | 7,232 | 0 | 20 | 1,547 | 1,965 | 1,022 | 943 | 137 | 5 |
import Prose.Segmentation.Graphemes
import Prose.CharSet
main = do mapM putStrLn $ segment "a.̃|"
play
| llelf/prose | try.hs | bsd-3-clause | 118 | 0 | 8 | 27 | 33 | 16 | 17 | 4 | 1 |
module Renzu
( module Renzu.Getter
, module Renzu.Index
, module Renzu.Iso
, module Renzu.Lens
, module Renzu.Optic
, module Renzu.Prism
, module Renzu.Setter
, module Renzu.Tuple
) where
----------------------------------------------------------------
import Renzu.Getter
import Re... | acple/renzu | src/Renzu.hs | bsd-3-clause | 442 | 0 | 5 | 83 | 95 | 61 | 34 | 17 | 0 |
import qualified CFGTest
import qualified CFGParseTest
import qualified CFGRandomTest
import qualified RegexTest
import qualified RegexParseTest
import qualified RegexRandomTest
import qualified MCTest
main :: IO ()
main = do
_ <- CFGParseTest.runTests
_ <- MCTest.runTests
_ <- RegexParseTest.runTests
... | arekfu/grammar-haskell | test/Spec.hs | bsd-3-clause | 450 | 0 | 8 | 84 | 115 | 60 | 55 | 17 | 1 |
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Layout.Vector (
Codec
, compile
, StorableVector (..)
, encodeVectors
, decodeVector
) where
import Control.Monad (when)
import ... | jystic/data-layout | src/Data/Layout/Vector.hs | bsd-3-clause | 10,793 | 0 | 25 | 2,812 | 2,601 | 1,396 | 1,205 | -1 | -1 |
{-# OPTIONS_GHC -fprof-auto #-}
module EDSL.Monad.Instructions
(module EDSL.Monad.Instructions.Cast
,module EDSL.Monad.Instructions.Compare
,module EDSL.Monad.Instructions.Binary
,module EDSL.Monad.Instructions.Atomic
,module EDSL.Monad.Instructions.Constant
,alloca, load, store
,call', call, ccall, tail... | angerman/data-bitcode-edsl | src/EDSL/Monad/Instructions.hs | bsd-3-clause | 5,827 | 0 | 21 | 1,231 | 1,895 | 984 | 911 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module Physics.Falling.Shape.ShapeReflection
(
ShapeReflection(..)
)
where
import Physics.Falling.Math.Transform
import Physics.Falling.Shape.ImplicitShape
newtype (ImplicitShape g v) => ShapeReflection g v = ShapeReflection g
... | sebcrozet/falling | Physics/Falling/Shape/ShapeReflection.hs | bsd-3-clause | 525 | 0 | 8 | 116 | 120 | 70 | 50 | 11 | 0 |
{-- snippet intersperse --}
intersperse :: a -> [[a]] -> [a]
{-- /snippet intersperse --}
intersperse a (x:xs@(_:_)) = x ++ a:intersperse a xs
intersperse a (x:_) = x
intersperse _ _ = []
| binesiyu/ifl | examples/ch03/Intersperse.hs | mit | 188 | 0 | 10 | 34 | 94 | 51 | 43 | 4 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- |
-- Copyright: © 2018 Herbert Valerio Riedel
-- SPDX-License-Identifier: GPL-3.0-or-later
--
module Controller.Badge
... | Rizary/hackage-matrix-builder | src-exe/Controller/Badge.hs | gpl-3.0 | 3,868 | 0 | 16 | 916 | 991 | 567 | 424 | -1 | -1 |
import Langermann
import Control.Exception
import qualified Data.ByteString.Lazy as BS
import Data.Binary
import System.Environment
import System.Exit
main :: IO ()
main = do args <- getArgs
case args of
(resultFile : _) -> do
resultData <- BS.readFile resultFile
... | GDCN/GDCN | GDCN_proj/dGDCN/jobs/LangermannJob/code/quality.hs | gpl-3.0 | 893 | 0 | 19 | 408 | 232 | 118 | 114 | 21 | 3 |
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "Blaze/ByteString/Builder/Word.hs" #-}
------------------------------------------------------------------------------
-- |
-- Module: Blaze.ByteString.Builder.Word
-- Copyright: (c) 2013 Leon P Smith
-- License: BSD3
-- Maintainer: Leon P Smith <leon@melding-monads.com>... | phischu/fragnix | tests/packages/scotty/Blaze.ByteString.Builder.Word.hs | bsd-3-clause | 9,434 | 0 | 6 | 1,947 | 965 | 615 | 350 | 142 | 1 |
-- | Public interface for 'Betsy', the Cartel flag maker. Simply
-- re-exports safe bindings from "Cartel.Betsy.Internal".
module Cartel.Betsy
( FlagName
, flagNameHead
, flagNameTail
, FlagOpts(..)
, Flag(..)
, Betsy
, Error(..)
, runBetsy
, makeFlag
, currentFlags
) where
import Cartel.Betsy.I... | beni55/cartel | lib/Cartel/Betsy.hs | bsd-3-clause | 328 | 0 | 5 | 67 | 58 | 40 | 18 | 12 | 0 |
-- |
-- Module : Data.Array.Accelerate.Test
-- Copyright : [2010..2011] Trevor L. McDonell
-- License : BSD3
--
-- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au>
-- Stability : experimental
-- Portability : non-portable (GHC extensions)
--
module Data.Array.Accelerate.Test (
module Data.Arr... | wilbowma/accelerate | Data/Array/Accelerate/Test.hs | bsd-3-clause | 405 | 0 | 5 | 65 | 36 | 29 | 7 | 3 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Make
-- Copyright : Martin Sjögren 2004
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is an alternative build system that delegates everything to the @make@
-- p... | jwiegley/ghc-release | libraries/Cabal/cabal/Distribution/Make.hs | gpl-3.0 | 8,658 | 0 | 16 | 1,884 | 1,297 | 693 | 604 | 105 | 8 |
{-# LANGUAGE CPP, GADTs, UnboxedTuples #-}
-----------------------------------------------------------------------------
--
-- Monad for Stg to C-- code generation
--
-- (c) The University of Glasgow 2004-2006
--
-----------------------------------------------------------------------------
module StgCmmMonad (
... | holzensp/ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | 28,755 | 0 | 14 | 7,619 | 5,344 | 2,929 | 2,415 | 426 | 1 |
-- |
-- Module : $Header$
-- Copyright : (c) 2013-2015 Galois, Inc.
-- License : BSD3
-- Maintainer : cryptol@galois.com
-- Stability : provisional
-- Portability : portable
--
-- This module defines natural numbers with an additional infinity
-- element, and various arithmetic operators on them.
{... | beni55/cryptol | src/Cryptol/TypeCheck/Solver/InfNat.hs | bsd-3-clause | 8,804 | 0 | 17 | 3,063 | 2,248 | 1,146 | 1,102 | 129 | 4 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor #-}
-- | CoreSyn holds all the main data types for use by for the Glasgow Haskell Compiler midsection
module ETA.Core.CoreSyn (
-- * Main data types
Ex... | pparkkin/eta | compiler/ETA/Core/CoreSyn.hs | bsd-3-clause | 69,989 | 0 | 13 | 18,835 | 9,027 | 5,124 | 3,903 | 590 | 5 |
--
-- (c) The University of Glasgow 2002-2006
--
{-# OPTIONS_GHC -O #-}
-- We always optimise this, otherwise performance of a non-optimised
-- compiler is severely affected
-- | Binary interface file support.
module BinIface (
writeBinIface,
readBinIface,
getSymtabName,
getDictFastSt... | hferreiro/replay | compiler/iface/BinIface.hs | bsd-3-clause | 16,075 | 0 | 18 | 4,582 | 3,539 | 1,776 | 1,763 | 285 | 11 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE RankNTypes #-}
module T16326_Fail12 where
class (forall a -> Show a) => C a
| sdiehl/ghc | testsuite/tests/dependent/should_fail/T16326_Fail12.hs | bsd-3-clause | 156 | 0 | 7 | 25 | 28 | 17 | 11 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
module T14934a where
import Data.Kind (Type)
import GHC.TypeLits
data Foo :: Nat -> Type where
MkFoo0 :: Foo 0
MkFoo1 :: Foo 1
f :: Foo (1 - 0) -> Foo 1
f x = x
| sdiehl/ghc | testsuite/tests/typecheck/should_compile/T14934a.hs | bsd-3-clause | 281 | 0 | 8 | 59 | 80 | 46 | 34 | 12 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
import qualified Data.ByteString.Lazy as BL
import Data.Csv.Streaming
import Data.Foldable (for_)
main :: IO ()
main = do
csvData <- BL.readFile "salaries.csv"
-- N.B. The Foldable instance skips records that failed to
-- convert.
for_ (decode NoHeader csvData) $ \... | jb55/cassava | examples/StreamingIndexBasedDecode.hs | bsd-3-clause | 412 | 0 | 12 | 87 | 108 | 59 | 49 | 9 | 1 |
{-# LANGUAGE StandaloneDeriving #-}
module T11768 where
data Foo = Foo
deriving Eq -- ^ Documenting a single type
data Bar = Bar
deriving ( Eq -- ^ Documenting one of multiple types
, Ord
)
-- | Documenting a standalone deriving instance
deriving instance Read Bar
| ezyang/ghc | testsuite/tests/haddock/should_compile_flag_haddock/T11768.hs | bsd-3-clause | 294 | 0 | 6 | 76 | 44 | 27 | 17 | 8 | 0 |
module T9030 where
bad :: Bool
bad = ()
square :: Integral i => i -> i
square x = x^2
| siddhanathan/ghc | testsuite/tests/typecheck/should_fail/T9033.hs | bsd-3-clause | 88 | 0 | 6 | 23 | 44 | 24 | 20 | 5 | 1 |
{-# LANGUAGE RankNTypes #-}
-- This program tickled a bug in 5.02.2's forall-lifting
module ShouldCompile where
class Class x where
combinator' :: (forall y. Class y => y -> y) -> x -> x
combinator :: (forall y. Class y => y -> y)
-> (forall x. Class x => x -> x)
combinator f = combinator' f
| urbanslug/ghc | testsuite/tests/typecheck/should_compile/tc148.hs | bsd-3-clause | 309 | 0 | 11 | 74 | 105 | 56 | 49 | 7 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
-- | A primitive expression is an expression where the non-leaves are
-- primitive operators. Our representation does not guarantee that
-- the expression is type-correct.
module Futhark.Analysis.... | diku-dk/futhark | src/Futhark/Analysis/PrimExp.hs | isc | 22,611 | 0 | 13 | 5,123 | 8,281 | 4,093 | 4,188 | 494 | 8 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
module Site.Fields (
defaultCtx,
postCtx,
archiveCtx,
tagsCtx,
sluggedTagsField,
customTitleField
) where
import Hakyll hiding (titleField)
import Data.Monoid (mconcat)
import System.Process
import System.FilePath
-- for groupByYear
import... | BlackBears/alanduncan.me | Pandoc/Fields.hs | mit | 7,671 | 0 | 21 | 1,919 | 2,391 | 1,212 | 1,179 | 172 | 3 |
-- test script, which should be run by `runghc` under the `rusc` directory
-- TODO: More general
module Test where
import System.FilePath ((</>))
import System.Process
import System.Exit
data Result = NormalStdOut String
| CompilerErrorOut String
ruscExecutable :: String
ruscExecutable = "rusc/.stack-wo... | izgzhen/RuScript | Test.hs | mit | 3,080 | 0 | 29 | 1,259 | 651 | 351 | 300 | 57 | 6 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Celtchar.Novel where
import Control.Monad.State.Strict
import Control.Monad.Reader
imp... | ogma-project/celtchar | src/Celtchar/Novel.hs | mit | 3,678 | 0 | 15 | 1,202 | 834 | 428 | 406 | 85 | 2 |
{-# LANGUAGE OverloadedLists #-}
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.Test.AdjacencyMap
-- Copyright : (c) Andrey Mokhov 2016-2022
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
... | snowleopard/alga | test/Algebra/Graph/Test/AdjacencyMap.hs | mit | 3,421 | 0 | 14 | 1,037 | 828 | 412 | 416 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import Control.Applicative
import Data.Text (Text)
import Yesod
data App = App
mkY... | cirquit/quizlearner | resources/form/password_form.hs | mit | 1,560 | 0 | 14 | 487 | 287 | 155 | 132 | 33 | 3 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.Gamepad
(js_getId, getId, js_getIndex, getIndex, js_getConnected,
getConnected, js_getTimestamp, getTimestamp, js_getMapping,
getMapping, js_getAxes, getAxes, js_getButtons, getButtons,
... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/Gamepad.hs | mit | 3,544 | 42 | 11 | 491 | 878 | 500 | 378 | 52 | 1 |
{-# LANGUAGE RankNTypes #-}
-- | Dealing with mutable state.
module Test.DejaFu.Internal where
import Control.Monad.ST (ST)
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Data.STRef (STRef, newSTRef, readSTRef, writeSTRef)
-- | Mutable references.
data Ref n r m = Ref
{ newRef :: forall a. a -... | bitemyapp/dejafu | Test/DejaFu/Internal.hs | mit | 851 | 0 | 13 | 220 | 316 | 181 | 135 | 22 | 1 |
{-# LANGUAGE BangPatterns, FlexibleContexts #-}
module FeatureDetection.Feature
( getFeature
, Pixel
, Feature
) where
import Data.Array.Repa as R hiding (map)
import Data.Word
data Pixel = Pixel {
pt :: DIM2, val :: Word8
} deriving (Show, Read, Eq, Ord)
type Feature = [Pixel]
getFeature ::... | eklinkhammer/haskell-vision | src/FeatureDetection/Feature.hs | mit | 1,113 | 0 | 11 | 286 | 502 | 282 | 220 | 26 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Oden.ParserSpec where
import Test.Hspec
import Oden.Core.Operator
import Oden.Identifier
import Oden.Parser
import Oden.SourceInfo
import Oden.Syntax
import Oden.Type.Signature
import Oden.Assert... | AlbinTheander/oden | test/Oden/ParserSpec.hs | mit | 14,694 | 0 | 23 | 4,398 | 5,076 | 2,493 | 2,583 | 393 | 1 |
module Interpreter.Env
( Env
, defaultEnv
, addVal
, lookupVal
, addCont
, lookupCont
, importEvalEnv
) where
import Core.Absyn (ContVar(..), Var(..))
import Interpreter.Value (ContValue(..), Value(..))
import Lib.Registry
import qualified Util.PrettyPrint as PP
data Env
= Empty
| ValueBind Var Va... | tadeuzagallo/verve-lang | src/Interpreter/Env.hs | mit | 2,023 | 0 | 13 | 465 | 822 | 420 | 402 | 64 | 1 |
-- | Defines writers of BACnet data.
-- Writers are instances of 'Monoid' therefore the Monoid equalities hold.
-- Here are some examples using (writeUnsignedAP b) as an example.
--
-- prop> mempty <> (writeUnsignedAP b) == writeUnsignedAP b
-- prop> writeUnsignedAP b <> mempty == writeUnsignedAP b
-- prop> let w =... | michaelgwelch/bacnet | src/BACnet/Writer.hs | mit | 6,556 | 0 | 10 | 1,048 | 1,608 | 870 | 738 | 134 | 2 |
module Control.Concurrent.Acquisition (
Acquisition,
release
) where
import Control.Concurrent.Lock.Internal
| iand675/disruptor | src/Control/Concurrent/Acquisition.hs | mit | 114 | 0 | 4 | 14 | 22 | 15 | 7 | 4 | 0 |
module Mixer where
mixer :: (a, b) -> (c, d) -> ((b, d), (a, c))
mixer (a, b) (c, d) = ((b, d), (a, c))
| Lyapunov/haskell-programming-from-first-principles | chapter_7/mixer.hs | mit | 105 | 0 | 8 | 26 | 87 | 55 | 32 | 3 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Control.Parallel.FT_1d.Execute
( executeCLMain ) where
import Control.Parallel.OpenCL
import Control.Parallel.FT_1d.Device
executeCLMain :: IO ()
executeCLMain = do
-- initialize OpenCL
platforms <- clGetPlatformIDs
putStrLn $ show platforms
mapM_ clDevice [platf... | cosmo0920/Haskell-OpenCL | Control/Parallel/FT_1d/Execute.hs | mit | 326 | 0 | 8 | 47 | 71 | 40 | 31 | 10 | 1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-------------------------------------------------------------------------------
-- Module : Domain.Class
-- Copyright : (c) 2017 Marcelo Sousa
--
-- General thread analysis:
-- Naive abstract interpretation fixpoint
-- based on a worklist al... | marcelosousa/poet | src/Domain/Class.hs | gpl-2.0 | 12,255 | 0 | 26 | 3,339 | 4,022 | 2,139 | 1,883 | 214 | 7 |
module Axioms where
import PrelSequent
import Sequent
import PrSequent
import PSequent
-- non-logical rules formed from axioms. AR 15/4/1999 -- 24/3/2000
type Axiom = ([Atom],[Atom])
data Atom = Atom Ident [ATerm] deriving (Eq,Read,Show)
data ATerm = Par Ident | Appl Ident [ATerm] deriving (Eq,Read,Show)
axioms2ca... | Tomoaki-Hashizaki/pesca | src/Axioms.hs | gpl-2.0 | 5,824 | 0 | 17 | 1,701 | 2,495 | 1,303 | 1,192 | 137 | 7 |
{-|
Standard imports and utilities which are useful everywhere, or needed low
in the module hierarchy. This is the bottom of hledger's module graph.
-}
module Hledger.Utils (---- provide these frequently used modules - or not, for clearer api:
-- module Control.Monad,
... | Lainepress/hledger | hledger-lib/Hledger/Utils.hs | gpl-3.0 | 15,167 | 0 | 13 | 3,734 | 4,092 | 2,099 | 1,993 | 232 | 4 |
import Data.Char
-- The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
-- Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
main :: IO ()
main = putStrLn $ show . maximum $ map product (... | peri4n/projecteuler | haskell/problem8.hs | gpl-3.0 | 1,622 | 0 | 10 | 155 | 191 | 98 | 93 | 12 | 1 |
module Sound.Tidal.MIDI.Kindohm.Rytm where
import Sound.Tidal.Params
import Sound.Tidal.MIDI.Control
--import Sound.Tidal.MIDI.Kindohm.CustomParams
(perf1, perf1_p) = pF "perf1" (Just 0)
(perf2, perf2_p) = pF "perf2" (Just 0)
(perf3, perf3_p) = pF "perf3" (Just 0)
(perf4, perf4_p) = pF "perf4" (Just 0)
(perf5, perf5_... | kindohm/tidal-midi-rack | Sound/Tidal/MIDI/Kindohm/Rytm.hs | gpl-3.0 | 1,273 | 0 | 8 | 477 | 426 | 228 | 198 | 29 | 1 |
module LSystem.Systems
( koch
, kochSnowflake
) where
import Control.Applicative
import LSystem.Base
import LSystem.Turtle
koch :: LSystem TurtleAction
koch = LSystem
{ advance = \x -> case x of
Forward f -> let f' = f / 3 in
[ Forward f'
, TurnLeft 60
, Forward f'
, TurnRight 120
, Forward f'
... | xaphiriron/maps | LSystem/Systems.hs | gpl-3.0 | 527 | 14 | 15 | 137 | 204 | 107 | 97 | 26 | 2 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RecordWildCards #-}
module Main
( main
) where
import Control.Monad
import ... | XDU-PurpleBear/database | pb-isbn/src/Main.hs | gpl-3.0 | 3,499 | 0 | 15 | 1,213 | 815 | 450 | 365 | 103 | 2 |
module Main where
--- Akkerman function
akk :: Int -> Int -> Int
akk m n = if m < 0
then -1
else if n < 0
then -1
else let
go a b = if a == 0
then b + 1
else if a > 0 && b == 0
then let a' = a - 1
b' = 1
in go a' b'
else
let a1 = a ... | nastya13/Akkerman-func | src/Main.hs | gpl-3.0 | 422 | 18 | 17 | 213 | 211 | 109 | 102 | 19 | 5 |
module Kwon3 where
data X
data Y
data Z
xz :: X -> Z
xz = undefined
yz :: Y -> Z
yz = undefined
xform :: (X, Y) -> (Z, Z)
xform (x, y) = (xz x, yz y)
munge :: (x -> y) -> (y -> (w, z)) -> x -> w
munge xToy yTowz x = w
where (w, _) = yTowz (xToy x)
| m3mitsuppe/haskell | exercises/Programming Haskell Book Exercises.hsproj/Kwon3.hs | unlicense | 258 | 0 | 9 | 77 | 160 | 91 | 69 | -1 | -1 |
module Main (main) where
import Criterion.Main (bgroup, defaultMain)
import qualified ParserBench
import qualified WriterBench
main :: IO ()
main = defaultMain
[ bgroup "Parser" ParserBench.benchmarks
, bgroup "Writer" WriterBench.benchmarks
]
| myfreeweb/http-link-header | benchmark/Bench.hs | unlicense | 268 | 0 | 8 | 54 | 68 | 39 | 29 | 8 | 1 |
{-
Copyright 2020 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicab... | google/codeworld | codeworld-prediction/tests/prediction-paper.hs | apache-2.0 | 3,936 | 0 | 13 | 934 | 1,146 | 610 | 536 | 83 | 3 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UnicodeSyntax #-}
{-| This module pro... | gcross/LogicGrowsOnTrees | LogicGrowsOnTrees/sources/LogicGrowsOnTrees/Parallel/Common/Workgroup.hs | bsd-2-clause | 14,931 | 0 | 19 | 2,961 | 2,285 | 1,232 | 1,053 | 212 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wall #-}
-- | An interface to bitcoind's available block-chain-related RPC calls. The
-- implementation of these functions can be found at
-- <https://github.com/bitcoin/bitcoin/blob/master/src/rpcblockchain.cpp>.
--
-- If any APIs are missing, patches are alway... | WraithM/network-bitcoin | src/Network/Bitcoin/BlockChain.hs | bsd-3-clause | 7,282 | 0 | 31 | 3,153 | 962 | 540 | 422 | 103 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.