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 CPP #-}
{-# LANGUAGE OverloadedStrings #-}
--------------------------------------------------------------------------------
-- See end of this file for licence information.
--------------------------------------------------------------------------------
-- |
-- Module : Namespace
-- Copyright :... | DougBurke/swish | src/Swish/Namespace.hs | lgpl-2.1 | 8,529 | 0 | 12 | 1,685 | 1,250 | 716 | 534 | 107 | 1 |
-- Utilities for surface manipulation
module Cane.Image where
import Data.List
import Foreign
import Control.Monad
import Graphics.UI.SDL as SDL hiding (Color)
import Glove.Types
colorToRGB :: Color -> (Word8, Word8, Word8)
colorToRGB (Color r g b _) = (fromIntegral r, fromIntegral g, fromIntegral b)
toPixel :: Co... | Raveline/Cane | lib/Cane/Image.hs | lgpl-3.0 | 1,774 | 0 | 13 | 435 | 664 | 343 | 321 | 36 | 1 |
--{-# LANGUAGE QuasiQuotes #-}
module HC.Use where
--import Language.LBNF.Runtime (printTree)
--import Prelude hiding (exp)
--import HC.Def
| haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/parsing/bnfc-meta-examples/src/HC/Use.hs | unlicense | 187 | 0 | 3 | 63 | 10 | 8 | 2 | 1 | 0 |
{-
Copyright 2015 Tristan Aubrey-Jones
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | flocc-net/flocc | v0.1/Compiler/Tests/GraphBuild/Run.hs | apache-2.0 | 2,518 | 0 | 11 | 432 | 492 | 246 | 246 | 47 | 1 |
-- | A custom build script for CUDA support.
--
-- Copyright (C) 2014 Braam Research, LLC.
module Main(main) where
import Control.Applicative
import Control.Monad
import Distribution.Simple
import Distribution.Simple.BuildPaths (exeExtension)
import Distribution.Simple.Configure (configure)
import Distribution.Simpl... | SKA-ScienceDataProcessor/RC | MS5/Setup.hs | apache-2.0 | 10,176 | 0 | 24 | 2,729 | 2,451 | 1,234 | 1,217 | 159 | 5 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANG... | pa-ba/projection | src/Data/Projection.hs | bsd-3-clause | 2,695 | 0 | 11 | 629 | 758 | 422 | 336 | 45 | 1 |
{-|
Module : Numeric.CatchingExceptions.MixedTypes.Comparisons
Description : CatchingExceptions comparisons
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental
Portability : portable
Comparison instances. See pa... | michalkonecny/num-exceptions | src/Numeric/CatchingExceptions/MixedTypes/Comparisons.hs | bsd-3-clause | 7,772 | 0 | 8 | 1,322 | 2,025 | 1,032 | 993 | -1 | -1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
-- Create a source distribution tarball
module Stack.SDist
( getSDistTarball
)... | rrnewton/stack | src/Stack/SDist.hs | bsd-3-clause | 10,819 | 0 | 21 | 2,924 | 2,616 | 1,388 | 1,228 | 197 | 10 |
module Y21.D06 where
import qualified Data.IntMap.Strict as M
import Imports
solve :: Int -> String -> Int
solve n =
sum
. map snd
. (!! n)
. iterate tick
. map ((, 1::Int) . read @Int)
. splitOn ","
where
tick :: (k ~ M.Key, Num v) => [(k, v)] -> [(k, v)]
tick xs = M.fromListWith... | oshyshko/adventofcode | src/Y21/D06.hs | bsd-3-clause | 500 | 0 | 13 | 151 | 260 | 147 | 113 | -1 | -1 |
-- Parser/Lexer for a small subset of the C language
-- Written by Alex Teiche February 2015
-- Based on Stephen Diehl's "Write You a Haskell" parser in Chapter 3
module Parser where
import Numeric
import Control.Monad
import Control.Applicative ((<$>))
import Data.Char
import Syntax
import Text.Parsec
import ... | teiche/femtocc | Parser.hs | bsd-3-clause | 5,701 | 0 | 11 | 1,615 | 1,517 | 782 | 735 | 144 | 1 |
module SpecHelper (module X) where
import Test.Hspec as X
import Test.Hspec.QuickCheck as X
| zalora/Angel | test/SpecHelper.hs | bsd-3-clause | 93 | 0 | 4 | 14 | 25 | 18 | 7 | 3 | 0 |
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse
import Distribution.Verbosity
import Distribution.System
import Distribution.Simple
import Distribution.Simple.Utils
import Distribution.Simple.Setup
import Distribution.Simple.Command
import Distribution.Simple.Program
import Distribut... | phaazon/cuda | Setup.hs | bsd-3-clause | 5,949 | 0 | 16 | 1,559 | 1,444 | 754 | 690 | 119 | 5 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
-- #hide
module Data.Thyme.LocalTime.Internal where
import Prelude hiding ((.))
import Control.Applicative
import Control.Category hiding (id)
import Control.Lens
i... | ekmett/thyme | src/Data/Thyme/LocalTime/Internal.hs | bsd-3-clause | 4,716 | 0 | 15 | 962 | 1,120 | 619 | 501 | 98 | 1 |
{-# LANGUAGE CPP #-}
import Control.Monad
import Data.IORef
import Control.Exception (SomeException, catch)
import Distribution.Simple
import Distribution.Simple.BuildPaths (autogenModulesDir)
import Distribution.Simple.InstallDirs as I
import Distribution.Simple.LocalBuildInfo as L
import qualified Distribution.Simpl... | andyarvanitis/Idris-dev | Setup.hs | bsd-3-clause | 9,391 | 0 | 17 | 2,629 | 1,831 | 955 | 876 | 154 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UnicodeSyntax #-}
module CoinExchange.Models
(
Entities.migrateAll
, MonadDB
, Doge
, ValidationError(..)
, Name
, name
, registerDoge
, richDoges
, dogeAssets
... | chrisbarrett/haskell-databases-talk | src/CoinExchange/Models.hs | bsd-3-clause | 2,725 | 0 | 17 | 735 | 699 | 384 | 315 | 63 | 3 |
module Main where
import MemoryFS
import System.Fuse.Box
import Control.Concurrent.STM.TVar
import qualified Data.HashMap.Lazy as Map
import Data.HashMap.Lazy ( HashMap )
type MemoryMapTVar = TVar (HashMap Node ByteString)
newtype MemoryFS = MemoryFS MemoryMapTVar
main :: IO ()
main = do
putStrLn "hello world"
| RobertFischer/fusebox | MemoryFS/Main.hs | bsd-3-clause | 317 | 0 | 7 | 46 | 86 | 52 | 34 | 11 | 1 |
{-# LANGUAGE LambdaCase #-}
-- This file is part of Hoppy.
--
-- Copyright 2015-2016 Bryan Gardiner <bog@khumba.net>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, either version 3... | lynnard/cocos2d-hs | generator/Main.hs | bsd-3-clause | 2,305 | 0 | 12 | 342 | 342 | 225 | 117 | 46 | 2 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
-- |Monadic Iteratees:
-- incremental input parsers, processors and transformers
--
-- Support for IO enumerators
module Data.Yteratee.IO.ReadableChunk (
ReadableChunk (..)
)
where
import Prelude hiding (head, tail, dropWhile, length... | ierton/yteratee | src/Data/Yteratee/IO/ReadableChunk.hs | bsd-3-clause | 1,682 | 0 | 10 | 297 | 409 | 227 | 182 | 33 | 0 |
module Data.List.CommonSubstring where
import Data.SuffixTree
import Data.List
import Data.Ord
-- | This is the suffixtree based implementation.
-- | If there are multiple longest substrings, which one is returned
-- | is undefined.
longestSubstring ::(Eq a, Ord a) => [a] -> [a] -> [a]
longestSubstring first second =... | mwotton/string-similarity | Data/List/CommonSubstring.hs | bsd-3-clause | 1,096 | 0 | 13 | 334 | 358 | 183 | 175 | 21 | 3 |
{-- snippet all --}
divBy :: Integral a => a -> [a] -> [a]
divBy numerator = map (numerator `div`)
{-- /snippet all --}
| binesiyu/ifl | examples/ch19/divby1.hs | mit | 120 | 0 | 8 | 24 | 46 | 26 | 20 | 2 | 1 |
-------------------------------------------------------------------------------
-- Linear implementation of Sets. Nodes are sorted and non-repeated
--
-- Data Structures. Grado en Informática. UMA.
-- Pepe Gallardo, 2012
-------------------------------------------------------------------------------
module Data... | Saeron/haskell | data.structures/haskell/DataStructures/Set/SortedLinearSet.hs | apache-2.0 | 2,368 | 0 | 10 | 756 | 968 | 485 | 483 | 62 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.CabalInstall.Types
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
-- Maintainer : lemmih@gmail.com
-- Stability : provisional
-- Portability : portable
--
-- All data ty... | alekar/hugs | packages/Cabal/Network/Hackage/CabalInstall/Types.hs | bsd-3-clause | 4,541 | 0 | 15 | 1,441 | 800 | 484 | 316 | 90 | 0 |
-- |
-- Analysis functions over the Cil AST.
--
module Language.Cil.Analysis (
opcodes
) where
import Language.Cil.Syntax
class Ast a where
-- A concatenated list of all opcodes.
opcodes :: a -> [OpCode]
instance Ast Assembly where
opcodes (Assembly _ _ td) = concatMap opcodes td
instance Ast TypeDef w... | tomlokhorst/language-cil | src/Language/Cil/Analysis.hs | bsd-3-clause | 722 | 0 | 9 | 174 | 270 | 138 | 132 | 17 | 0 |
import Prelude
import FFI
main :: Fay ()
main =
case [1,2] of
[] -> alert "got []"
[a] -> alert "got one value."
[a,b] -> alert "got two values."
alert :: String -> Fay ()
alert = ffi "console.log(%1)"
| fpco/fay | examples/pat.hs | bsd-3-clause | 240 | 0 | 8 | 78 | 92 | 48 | 44 | 10 | 3 |
{-# OPTIONS -Wall #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- | Date/time showing functions.
module Data.Time.Show
(showDateTime)
where
import Data.Time (FormatTime,formatTime)
import System.Locale (defaultTimeLocale)
showDateTime :: FormatTime t => t -> String
showDateTime ... | plow-technologies/ircbrowse | src/Data/Time/Show.hs | bsd-3-clause | 372 | 0 | 6 | 58 | 70 | 41 | 29 | 9 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(x,y,z) 1
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Control.Applicative.Free.Final
-- Copyright : (C) 2012-2013 Edward Kmett
-- License : BSD-style... | dalaing/free | src/Control/Applicative/Free/Final.hs | bsd-3-clause | 2,631 | 0 | 13 | 560 | 602 | 326 | 276 | 30 | 1 |
{- |
At the ZuriHac 2016 I worked on the new parsec-based parser for the *.cabal files.
The obvious test case is to compare new and old parser results for all of Hackage.
Traversing the Hackage is quite trivial. The difficult part is inspecting
the result 'GenericPackageDescription's to spot the difference.
In the sa... | mydaum/cabal | Cabal/tests/StructDiff.hs | bsd-3-clause | 6,371 | 0 | 12 | 1,511 | 2,006 | 1,044 | 962 | 103 | 3 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.Column
-- Copyright : (c) 2009 Ilya Portnov
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Ilya Portnov <... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Layout/Column.hs | bsd-2-clause | 2,640 | 0 | 13 | 679 | 545 | 304 | 241 | 26 | 2 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, StandaloneDeriving #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Unicode
-- Copyright : (c) The University of Glasgow, 2003
-- License : see libraries/ba... | tolysz/prepare-ghcjs | spec-lts8/base/GHC/Unicode.hs | bsd-3-clause | 12,944 | 0 | 13 | 3,160 | 1,516 | 935 | 581 | 132 | 8 |
{-# LANGUAGE ScopedTypeVariables, PartialTypeSignatures #-}
module T10463 where
f (x :: _) = x ++ ""
| ghc-android/ghc | testsuite/tests/partial-sigs/should_compile/T10463.hs | bsd-3-clause | 103 | 0 | 7 | 18 | 24 | 14 | 10 | 3 | 1 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleInstances #-}
module PolyKinds13 where
data Proxy a = Proxy
instance Show (Proxy a) where
show _ = "Proxy"
instance Functor Proxy where
fmap _ Proxy = Proxy
data TypeRep = TypeRep
class MyTypeable t where
-- MyTypeable :: forall k. k -> Constraint
... | forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/polykinds/PolyKinds13.hs | bsd-3-clause | 585 | 0 | 8 | 134 | 131 | 70 | 61 | 16 | 0 |
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TypeFamilies #-}
-----------------------------------------------------------------------------
-- |
-- Description : Subset, dense, total map implemented as a vector.
-- ... | pawel-n/total-maps | src/Data/Total/Array/Subset.hs | mit | 5,121 | 0 | 12 | 1,102 | 1,456 | 771 | 685 | -1 | -1 |
{-# LANGUAGE ExistentialQuantification, NamedFieldPuns #-}
module Main where
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
import Control.Applicative ((<$>))
import Control.Monad.Error
import Data.Maybe
import System.IO
import Data.IORef
type Env = IORef [(String, IORef LispVal)]
nu... | wolverian/scheme48 | Main.hs | mit | 16,660 | 0 | 15 | 4,856 | 5,926 | 2,994 | 2,932 | 387 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import System.Environment (getArgs)
import Data.List (transpose)
import Options.Applicative
-- IN PROGRESS: TODO implement startAtColumn
data Options = Options {
matchM... | danchoi/align-text | Main.hs | mit | 3,748 | 0 | 16 | 971 | 1,005 | 530 | 475 | 78 | 2 |
data List a = Nil | Cons a (List a) deriving (Eq, Show)
instance Functor List where
fmap _ Nil = Nil
fmap f (Cons x xs) = Cons (f x) (fmap f xs)
append Nil ys = ys
append (Cons x xs) ys = Cons x (append xs ys)
instance Applicative List where
pure x = Cons x Nil
(<*>) _ Nil = Nil
(<*>) Nil _ = Nil... | JustinUnger/haskell-book | ch17/ziplist-app.hs | mit | 862 | 0 | 8 | 226 | 462 | 236 | 226 | 22 | 1 |
module Rebase.GHC.Num
(
module GHC.Num
)
where
import GHC.Num
| nikita-volkov/rebase | library/Rebase/GHC/Num.hs | mit | 65 | 0 | 5 | 12 | 20 | 13 | 7 | 4 | 0 |
module Hasql.Private.Session
where
import Hasql.Private.Prelude
import Hasql.Private.Errors
import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Hasql.Private.Decoders.Results as Decoders.Results
import qualified Hasql.Private.Decoders.Result as Decoders.Result
import qualified Hasql.Private.Encoders.P... | nikita-volkov/hasql | library/Hasql/Private/Session.hs | mit | 2,579 | 0 | 15 | 423 | 623 | 341 | 282 | 41 | 1 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
module Calc where
import Control.Monad
import ExprT
import Parser
import StackVM
newtype MinMax = MinMax Integer deriving (Eq, Show)
newtype Mod7 = Mod7 Integer deriving (Eq, Show)
class Expr a where
lit :: Integer -> a
add :: a -> a -... | limdauto/learning-haskell | cis194/week5/Calc.hs | mit | 1,752 | 0 | 10 | 435 | 699 | 368 | 331 | 54 | 2 |
module Reforest.Grammar where
import Data.List
import qualified Data.Set as Set
nub' :: Ord a => [a] -> [a]
nub' = Set.toList . Set.fromList
data NonTerm = NT Int Int
deriving (Eq, Ord)
instance Show NonTerm where
show (NT i _) = "A" ++ show i
data Sym = Con String Int | Var NonTerm | Bnd Int
... | gebner/reforest | src/Reforest/Grammar.hs | mit | 2,237 | 0 | 15 | 599 | 1,163 | 596 | 567 | 64 | 2 |
module Lesson03 where
import Helper
import System.Random.Shuffle
-- Let's make things a little more complicated. Instead of hard-coding
-- two players in our game, let's allow the user to specify how many
-- players to allow. In order to make this work, we're going to need
-- to define a helper function.
--
-- This f... | snoyberg/haskell-impatient-poker-players | src/Lesson03.hs | mit | 3,288 | 0 | 11 | 779 | 205 | 110 | 95 | 20 | 2 |
{-|
Module: Flaw.UI.Slider
Description: Slider is an element with value.
License: MIT
-}
module Flaw.UI.Slider
( Slider(..)
, newSlider
) where
import Control.Concurrent.STM
import Control.Monad
import Data.Maybe
import Flaw.Graphics.Canvas
import Flaw.Input.Keyboard
import Flaw.Input.Mouse
import Flaw.Math
im... | quyse/flaw | flaw-ui/Flaw/UI/Slider.hs | mit | 6,705 | 8 | 30 | 1,698 | 1,640 | 841 | 799 | 183 | 1 |
#!/usr/bin/env runhaskell
import Test.Tasty
import Test.Tasty.SmallCheck as SC
import Test.Tasty.QuickCheck as QC
import Test.Tasty.HUnit
import Data.List
import qualified Text.GraphQL.Schema as GQ
import qualified Text.GraphQL.Schema.Graphene as Graphene
properties :: TestTree
properties = testGroup "Properties" [s... | wtanaka/graphql-schema | tests/Spec.hs | gpl-2.0 | 4,129 | 0 | 14 | 1,197 | 912 | 516 | 396 | 78 | 1 |
module Tema_21d_PolPropiedades_Spec (main, spec) where
import Tema_21.PolPropiedades
import Test.Hspec
import Test.QuickCheck
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Propiedades de los polinomios" $ do
it "p1" $
property prop_polCero_es_cero
it "p2" $
property prop_cons... | jaalonso/I1M-Cod-Temas | test/Tema_21d_PolPropiedades_Spec.hs | gpl-2.0 | 501 | 0 | 11 | 127 | 143 | 66 | 77 | 21 | 1 |
data Stack a = Nil
| Stack a (Stack a)
push :: Stack a -> a -> Stack a
push s x = Stack x s
pop :: Stack a -> (a, Stack a)
pop (Stack x s) = (x, s)
data Token = Number Integer
| Operation Char
parseToken :: String -> Token
parseToken "+" = Operation '+'
parseToken "-" = Operat... | zakharvoit/discrete-math-labs | Season2/LinearDataStructures/Postfix/Postfix.hs | gpl-3.0 | 1,068 | 0 | 12 | 309 | 519 | 263 | 256 | 31 | 3 |
{-# LANGUAGE TemplateHaskell, FunctionalDependencies, FlexibleInstances, RankNTypes #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
module Model where
import qualified Data.DList as DL
import qualified Data.Vector.Storable as S
import Graphics.Rendering.OpenGL.Raw
import Control.Monad.State.Strict
import Cont... | mikeplus64/plissken | src/Model.hs | gpl-3.0 | 3,140 | 0 | 11 | 817 | 1,078 | 577 | 501 | 103 | 8 |
{-# LANGUAGE TemplateHaskell #-}
-- | The themes/ config format
module Lamdu.Config.Theme.Name where
import qualified Control.Lens as Lens
import qualified Data.Aeson.TH.Extended as JsonTH
import Data.Vector.Vector2 (Vector2)
import qualified GUI.Momentu.Draw as Draw
import Lamdu.Prelude
data Nam... | Peaker/lamdu | src/Lamdu/Config/Theme/Name.hs | gpl-3.0 | 568 | 0 | 9 | 100 | 124 | 76 | 48 | 14 | 0 |
module Moonbase.Theme
( Color
, color_
, FontAttr(..)
, Font(..)
, bold, italic
, size, sans, monospace, droid, droidMono
, Theme(..)
, Style(..)
, fg, font, bg
, defaultTheme
, defaultColor
) where
import Control.Applicative
import Data.Char
-- * Color & helpers
-- | A si... | felixsch/moonbase | src/Moonbase/Theme.hs | gpl-3.0 | 4,571 | 0 | 9 | 1,284 | 863 | 521 | 342 | 77 | 2 |
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
--------------------------------------------------------------------------------
-- | Defines colours used in the XMonad and XMobar configurations.
module Utils.Color where
... | d12frosted/environment | xmonad/lib/Utils/Color.hs | gpl-3.0 | 1,909 | 0 | 7 | 193 | 241 | 149 | 92 | 45 | 1 |
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses, FlexibleInstances #-}
{- | We implement real numbers as the completion of dyadic intervals. The whole construction is
parametrized by an approximate field, an example of which is "Dyadic".
-}
module Reals where
import Data.Ratio
import Staged
import Space
... | aljosaVodopija/eksaktnaRealna | Reals.hs | gpl-3.0 | 19,988 | 11 | 44 | 9,552 | 6,545 | 3,417 | 3,128 | 264 | 4 |
{-# LANGUAGE ViewPatterns #-}
-- | Different kernels
module MLLabs.Kernel
( Kernel
, gaussKernel
, triangularKernel
, rectangularKernel
, quarticKernel
) where
import Data.Bool (bool)
type Kernel = Double -> Double
-- | Accepts σ as input parameter, suppose b = 0... | zhenyavinogradov/ml-labs | src/MLLabs/Kernel.hs | gpl-3.0 | 732 | 0 | 13 | 189 | 249 | 138 | 111 | 19 | 2 |
module MatchRegexp (matchHere, match) where
import Regexp(Regexp(Literal,
AnyChar,
Or,
OneOrMore,
ZeroOrMore,
Sequence,
Optional,
AtEnd,
A... | srank/regexp | MatchRegexp.hs | gpl-3.0 | 2,412 | 0 | 12 | 715 | 911 | 471 | 440 | 61 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/Reads/Search.hs | mpl-2.0 | 7,612 | 0 | 19 | 1,691 | 899 | 535 | 364 | 124 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.SecurityCenter.Types.Sum
-- Copyright : (c) 2015-2016 ... | brendanhay/gogol | gogol-securitycenter/gen/Network/Google/SecurityCenter/Types/Sum.hs | mpl-2.0 | 19,946 | 0 | 11 | 4,243 | 2,755 | 1,473 | 1,282 | 326 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-binaryauthorization/gen/Network/Google/Resource/BinaryAuthorization/Projects/Attestors/TestIAMPermissions.hs | mpl-2.0 | 6,585 | 0 | 16 | 1,356 | 789 | 465 | 324 | 120 | 1 |
-- 8)
isPalindrome :: (Eq a) => [a] -> Bool
isPalindrome a = a == b
where b = reverse a
-- 9)
myAbs :: Integer -> Integer
myAbs num =
if num < 0
then -num
else num
-- 10)
f :: (a, b) -> (c, d) -> ((b, d), (a, c))
f a b = (,) ((,) (snd a) (snd b)) ((,) (fst a) (fst b))
| ocozalp/Haskellbook | chapter4/exercises.hs | unlicense | 291 | 0 | 9 | 90 | 185 | 103 | 82 | 10 | 2 |
{-# LANGUAGE ViewPatterns #-}
import qualified Data.ByteString.Char8 as C
import qualified Data.IntMap.Strict as IntMap
import Data.IntMap.Strict(IntMap)
import Data.Maybe
mergeHelper d x m@(IntMap.lookupLT x -> Nothing) = m
mergeHelper d x m@(IntMap.lookupLT x -> Just (k, v))
| x >= v = m
| x - k <= d && v - x <=... | wangbj/haskell | claw.hs | bsd-2-clause | 1,312 | 0 | 13 | 309 | 664 | 345 | 319 | 27 | 3 |
module Day11 (run, moves) where
import Prelude hiding (zip)
import Control.Lens
import Data.Bits
import Data.Char
import Data.List
import qualified Data.Sequence as DSQ
import Data.Maybe
import Data.Ord
import qualified Data.Set as DSE
import Data.Time.Clock
import Numeric
topFloor = 4
data State... | ulyssesp/AoC | src/day11.hs | bsd-3-clause | 3,220 | 0 | 17 | 854 | 1,362 | 732 | 630 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Exception
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-- Port... | OS2World/DEV-UTIL-HUGS | libraries/Control/Exception.hs | bsd-3-clause | 16,620 | 199 | 15 | 3,249 | 1,863 | 1,084 | 779 | 131 | 3 |
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-matches -fno-warn-name-shadowing -fno-warn-missing-signatures #-}
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, FlexibleContexts, TypeSynonymInstances #-}
---------------------------------------------------------------------------... | lingxiao/CIS700 | src/FeqMoments.hs | bsd-3-clause | 1,456 | 0 | 5 | 112 | 104 | 75 | 29 | 14 | 0 |
{-# LANGUAGE MagicHash #-}
module Main where
import GHC.Prim
import GHC.Int
-- Test that large unchecked shifts, which constitute undefined behavior, do
-- not crash the compiler and instead evaluate to 0.
-- See Note [Guarding against silly shifts] in PrelRules.
-- Shift should be larger than the word size (e.g. 6... | sdiehl/ghc | testsuite/tests/codeGen/should_run/T16449_2.hs | bsd-3-clause | 395 | 0 | 9 | 68 | 41 | 25 | 16 | 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.Volume.KM.Corpus
( corpus ) where
import Data.String
impor... | facebookincubator/duckling | Duckling/Volume/KM/Corpus.hs | bsd-3-clause | 2,362 | 0 | 10 | 599 | 294 | 174 | 120 | 45 | 1 |
module Main where
import Avail
import Control.Monad.IO.Class
import DynFlags
(getDynFlags, parseDynamicFlagsCmdLine, defaultFatalMessager, defaultFlushOut)
import GHC
import GHC.Fingerprint.Type
import GHC.Hs.Decls
import GHC.Hs.Doc
import GHC.Hs.Expr
import GHC.Hs.Extension
import GHC.Hs.ImpExp
import HscTypes
impo... | sdiehl/ghc | testsuite/tests/plugins/static-plugins.hs | bsd-3-clause | 2,713 | 0 | 17 | 607 | 498 | 261 | 237 | 49 | 1 |
module Lexer where
-- Copyright 1994 by Peter Thiemann
-- Last Modified By: M. Walter
--
import Data.Char
------------------------------------------------------------------------------
--NOW the lexer
------------------------------------------------------------------------------
data Token
= Ident String | Symbol S... | FranklinChen/Ebnf2ps | src/Lexer.hs | bsd-3-clause | 2,807 | 4 | 10 | 559 | 1,254 | 638 | 616 | 62 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "Hello, world!"
| tetigi/raider | src/Lib.hs | bsd-3-clause | 129 | 0 | 6 | 29 | 28 | 16 | 12 | 5 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
module BitTorrent.Types where
import Control.Concurrent.MVar
import Control.Lens
import Data.Word
import Network (Socket)
import qua... | kylc/torrent | src/BitTorrent/Types.hs | bsd-3-clause | 1,784 | 0 | 10 | 399 | 439 | 256 | 183 | 60 | 0 |
{-# LANGUAGE OverloadedStrings #-}
import Text.Blaze.Html (toHtml)
import Text.Blaze.Html5 (figure)
import Test.Hspec
import Text.Markdown
import Data.Text.Lazy (Text, unpack, snoc, fromStrict)
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import qualified Data.Text.Lazy as TL
import Text.Blaze.H... | thefalconfeat/markdown | test/main.hs | bsd-3-clause | 11,129 | 0 | 23 | 3,397 | 2,175 | 1,012 | 1,163 | 250 | 1 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE InstanceSigs #-}
module PFDS.Commons.BinaryRandomAccessList where
import PFDS.Commons.RandomAccessList
import Prelude hiding (head, tail, lookup)
data Tree a = Leaf a | Node Int (Tree a) (Tre... | matonix/pfds | src/PFDS/Commons/BinaryRandomAccessList.hs | bsd-3-clause | 2,374 | 0 | 11 | 662 | 1,181 | 600 | 581 | 63 | 2 |
module Lib where
import System.Random
import Data.List
randList :: Int -> [ a ] -> IO [ a ]
randList n xs = do
gen <- newStdGen
let is = take n . nub $ randomRs (0, length xs - 1) gen :: [ Int ]
return (map (\ i -> xs !! i) is)
| ricardomiranda/haskellGeneticMagicSquare | src/Lib.hs | mit | 236 | 0 | 14 | 63 | 123 | 64 | 59 | 8 | 1 |
module Fields where
import Data.Aeson (FromJSON, ToJSON)
import GHC.Generics (Generic)
import Database.Persist.TH (derivePersistField)
data OS = IOS | Android deriving (Eq, Show, Read, Generic)
derivePersistField "OS"
instance FromJSON OS
instance ToJSON OS
| vyorkin-archive/assignment | api/src/Fields.hs | mit | 261 | 0 | 6 | 35 | 87 | 48 | 39 | -1 | -1 |
module FbVarBind where
f x = if x then 1 else x
| roberth/uu-helium | test/typeerrors/Examples/FbVarBind.hs | gpl-3.0 | 49 | 0 | 5 | 13 | 20 | 12 | 8 | 2 | 2 |
-- | The all-important theming engine!
--
-- Cf
-- https://hackage.haskell.org/package/vty/docs/Graphics-Vty-Attributes.html
-- http://hackage.haskell.org/package/brick/docs/Brick-AttrMap.html
-- http://hackage.haskell.org/package/brick-0.1/docs/Brick-Util.html
-- http://hackage.haskell.org/package/brick-0.1/docs/Brick... | mstksg/hledger | hledger-ui/Hledger/UI/Theme.hs | gpl-3.0 | 5,139 | 0 | 12 | 1,349 | 763 | 479 | 284 | 51 | 1 |
import CpiLib
import CpiTest
import CpiODE
import CpiSemantics
import CpiLogic
import System.Environment (getArgs)
-- Time points
--tps = (100,(0,25))
-- Basic
f1 = Pos (0,infty) (ValGT (Conc (Def "P" [])) (R 0.05))
f2 = Pos (0,infty) (ValLE (Conc (Def "S" ["s"])) (R 0.01))
f3 = Nec (0,infty) (ValGT (Conc (Def "E" [... | chrisbanks/cpiwb | profileMC2.hs | gpl-3.0 | 8,285 | 0 | 14 | 3,461 | 2,425 | 1,198 | 1,227 | 203 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | romanb/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeCache.hs | mpl-2.0 | 5,884 | 0 | 22 | 1,236 | 896 | 527 | 369 | 98 | 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 #-}
-- ... | fmapfmapfmap/amazonka | amazonka-swf/gen/Network/AWS/SWF/DeprecateWorkflowType.hs | mpl-2.0 | 5,287 | 0 | 12 | 1,094 | 508 | 315 | 193 | 71 | 1 |
<?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="sr-SP">
<title>Customizable HTML Report</title>
<maps>
<homeID>top</homeID>
<mapref lo... | veggiespam/zap-extensions | addOns/customreport/src/main/javahelp/org/zaproxy/zap/extension/customreport/resources/help_sr_SP/helpset_sr_SP.hs | apache-2.0 | 970 | 79 | 66 | 158 | 411 | 208 | 203 | -1 | -1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DataKinds #-}
module Haskus.System.Linux.Internals.IfLink where
import Haskus.Utils.Types.Generics (Generic)
import Haskus.Format.Binary.Storable
import Haskus.Format.Binary.Vector (Vector)
import Haskus.Format.Binary.Word
import Haskus.Forma... | hsyl20/ViperVM | haskus-system/src/lib/Haskus/System/Linux/Internals/IfLink.hs | bsd-3-clause | 23,467 | 0 | 9 | 5,076 | 3,463 | 2,149 | 1,314 | 783 | 0 |
module Language.Pads.Parser where
{-
** *********************************************************************
* *
* (c) Kathleen Fisher <kathleen.fisher@gmail.com> *
* John Launchbury <john.launchbury@gmail.com> ... | GaloisInc/pads-haskell | Language/Pads/Parser.hs | bsd-3-clause | 12,460 | 4 | 15 | 3,754 | 3,951 | 2,016 | 1,935 | 299 | 3 |
-- | Provides the main entry point and supports the following commands:
--
-- * @clone@ - Clone a remote repository using the native git protocol.
-- Similar to the @git clone@ command.
--
-- * @ls-remote@ - List references in a remote repository.
--
-- * @unpack@ - Unpack a pack file into a bare rep... | fcharlie/hgit | src/Main.hs | bsd-3-clause | 1,970 | 0 | 15 | 686 | 379 | 204 | 175 | 28 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-}
module Data.IntTrie (
IntTrie(..),
construct,
lookup,
TrieLookup(..),
#ifdef TESTS
tests,
prop,
#endif
) where
import Prelude hiding (lookup)
import Data.Typeable (Typeable)
import qualified Data.Array.Unboxed as A
import Dat... | mpickering/hackage-server | Data/IntTrie.hs | bsd-3-clause | 10,011 | 0 | 15 | 2,731 | 3,074 | 1,661 | 1,413 | 113 | 6 |
module Main where
import Database.HaskellDB
import Database.HaskellDB.FieldType
import Database.HaskellDB.DBSpec
import System.Environment (getArgs)
test = DBInfo {dbname = "ctest", opts = testopts, tbls = [testtbl1,testtbl2]}
testopts = DBOptions {useBString = False}
testtbl1 = TInfo {tname = "ctesttbl1", cols = ... | m4dc4p/haskelldb | test/old/dbspec.hs | bsd-3-clause | 802 | 0 | 12 | 136 | 288 | 173 | 115 | 17 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.Pubnub
import Network.Pubnub.Types
import Data.Aeson
import Control.Concurrent
import qualified Data.Text as T
main :: IO ()
main = do
let pn = defaultPN{channels=["hello_world"], sub_key="demo", pub_key="demo"}
_ <- subscribe pn defaultSubscrib... | pubnub/haskell | examples/HelloWorld/Main.hs | mit | 715 | 0 | 12 | 177 | 228 | 119 | 109 | 21 | 1 |
-- (c) The University of Glasgow 2006
-- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
--
-- The @Class@ datatype
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module ETA.Types.Class (
Class,
ClassOpItem, DefMeth (..),
ClassATItem(..),
ClassMinimalDef,
defMethSpecOfDefMe... | alexander-at-github/eta | compiler/ETA/Types/Class.hs | bsd-3-clause | 10,352 | 0 | 12 | 2,898 | 1,623 | 935 | 688 | 133 | 3 |
module Network.Wai.Frontend.MonadCGI
( cgiToApp
, cgiToAppGeneric
) where
import Network.Wai
import Network.CGI.Monad
import Network.CGI.Protocol
import Network.HTTP.Types (Status (..))
import Control.Monad.IO.Class (liftIO)
import Data.CaseInsensitive (original)
import qualified Data.Map as Map
import qu... | creichert/wai | wai-frontend-monadcgi/Network/Wai/Frontend/MonadCGI.hs | mit | 2,266 | 0 | 15 | 666 | 735 | 396 | 339 | 58 | 3 |
module CoverageTable where
import Control.Monad (liftM,forM_)
import Data.List
import Database.MongoDB
import Queries.Coverage
import Queries.Features
main = do
pipe <- runIOE $ connect (host "127.0.0.1")
--features <- liftM reverse $ queryFeatures pipe
let features = ["Company","Cut","Total",... | 101companies/101dev | tools/mongo2Tex/CoverageTable.hs | gpl-3.0 | 3,425 | 4 | 21 | 918 | 806 | 410 | 396 | 61 | 2 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998
\section[Specialise]{Stamping out overloading, and (optionally) polymorphism}
-}
{-# LANGUAGE CPP #-}
module Specialise ( specProgram, specUnfolding ) where
#include "HsVersions.h"
import GhcPrelude
import Id
import TcType hiding( substTy )
import Type ... | ezyang/ghc | compiler/specialise/Specialise.hs | bsd-3-clause | 100,486 | 1 | 22 | 29,447 | 11,298 | 6,135 | 5,163 | -1 | -1 |
import Control.Monad hiding (filterM)
yes = flip mapM | mpickering/hlint-refactor | tests/examples/Default125.hs | bsd-3-clause | 54 | 0 | 5 | 8 | 20 | 11 | 9 | 2 | 1 |
module D1 where
sumSquares ((x : xs))
= ((sq pow) x) + (sumSquares xs) where pow = 2
sumSquares [] = 0
sq x = x ^ pow
main = sumSquares [1 .. 4]
| SAdams601/HaRe | old/testing/liftToToplevel/D1AST.hs | bsd-3-clause | 154 | 0 | 9 | 43 | 87 | 47 | 40 | 6 | 1 |
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens
import Control.Monad
import qualified Data.Map as Map
import Reflex
import Reflex.Dom
data Task = Task { _taskDescription :: String
, _taskCompleted :: Bool
}
... | Ninju/reflex-dom-demos | step-by-step-todo-list/stage-5-toggle-all/source.hs | mit | 3,655 | 0 | 23 | 1,063 | 1,117 | 544 | 573 | 73 | 1 |
{-# LANGUAGE
StandaloneDeriving, GeneralizedNewtypeDeriving,
ForeignFunctionInterface, MultiWayIf #-}
module Basic.Doub
( Doub (..)
, (%)
, module Data.Bits
)
where
import Data.Bits
import GHC.Read
import System.Random
import Text.Printf
-- TODO: Need to think about how to handle the fact that 0/0 is -inf ... | dmringo/pure-basic | src/Basic/Doub.hs | mit | 2,424 | 0 | 12 | 597 | 528 | 297 | 231 | -1 | -1 |
{-# LANGUAGE ViewPatterns, MultiWayIf #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
module Core.BPS
( preProcess
, pathfind
, astar
, fillPath
, Path (..)
) where
import Prelude hiding ((.), id)
import Core.Types
import Control.Monad
import Control.Monad.ST
import Data.Array.Unboxed
... | jameshsmith/HRL | Server/Core/BPS.hs | mit | 12,366 | 0 | 20 | 3,340 | 3,864 | 2,065 | 1,799 | 165 | 7 |
module Server where
import qualified Data.ByteString.UTF8 as UTF8
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Network.Socket hiding (send, sendTo, recv, recvFrom)
import Network.Socket.ByteString
import Network.DNS as DNS
type HandlerFunc = B.ByteString -> IO ()
serveLog ... | markdrago/tweed | src/server.hs | mit | 1,302 | 0 | 15 | 368 | 377 | 193 | 184 | 35 | 2 |
-- Copyright © 2013 Julian Blake Kongslie <jblake@omgwallhack.org>
-- Licensed under the MIT license.
{-# LANGUAGE RecordWildCards #-}
module Spec
where
import Control.Applicative
import qualified Data.Map as M
import System.FilePath
import Text.JSON
readMap :: (JSON v) => JSValue -> Result (M.Map String v)
readMap... | jblake/solderapi | src/Spec.hs | mit | 2,782 | 0 | 17 | 751 | 936 | 497 | 439 | 81 | 1 |
-- author : Lukasz Wolochowski (l.wolochowski@students.mimuw.edu.pl)
module RelationalStructureTest (tests) where
import Test.Tasty
import Test.QuickCheck.Instances
import Test.QuickCheck.Modifiers
import Test.Tasty.QuickCheck as QC
import Test.Tasty.HUnit
import Data.Set(Set)
import qualified Data.Set as Set... | luke725/alphabets | tests/RelationalStructureTest.hs | mit | 3,139 | 83 | 18 | 627 | 1,249 | 663 | 586 | -1 | -1 |
module Main where
import Control.Monad
import Data.Maybe
import System.Directory
import System.Environment
import System.Exit
import System.FilePath.Posix
import qualified Config
import System.Tmux
parseInt x = read x :: Int
-- Workspace management actions.
workspaceWindows :: IO (Maybe [Int])
workspaceWindows =
... | mattneary/tux | src/Main.hs | mit | 2,812 | 0 | 15 | 587 | 769 | 368 | 401 | 55 | 1 |
module TestImport
( module TestImport
, module X
) where
import Application (makeFoundation)
import ClassyPrelude as X
import Database.Persist as X hiding (get)
import Database.Persist.Sql (SqlPersistM, SqlBackend, runSqlPersistMPool, rawExecute, rawSql, unSingle, connEscapeName)
im... | isankadn/yesod-testweb-full | test/TestImport.hs | mit | 1,869 | 0 | 17 | 440 | 438 | 231 | 207 | 39 | 1 |
-- This module controls the parameters that the analysis accepts from a user.
-- In the near future, this will be replaced by a higher level DSL.
{-# LANGUAGE OverloadedStrings #-}
module Skel.MVP.UserParameters
( module Skel.MVP.UserParameters
, module Skel.MVP.UserModel
, module DataAnalysis.Application.I... | teuffy/min-var-ci | src/Skel/MVP/UserParameters.hs | mit | 1,053 | 0 | 15 | 339 | 174 | 103 | 71 | 21 | 0 |
sum' :: (Num a) => [a] -> a
sum' = foldl (+) 0
maximum' :: (Ord a) => [a] -> a
maximum' = foldl1 max
reverse' :: [a] -> [a]
reverse' = foldl (flip (:)) []
-- reverse' = foldl (\acc x -> x : acc) []
elem' :: (Eq a) => a -> [a] -> Bool
elem' x = foldl (\acc y -> if y == x then True else acc) False
map' :: (a -> b) ->... | pradyuman/haskell | fold.hs | mit | 687 | 0 | 9 | 180 | 376 | 210 | 166 | 18 | 2 |
module Types.Wall(
Wall(..),
innards,
randWall
) where
import Control.Applicative
import Control.Monad(liftM)
import Data.Universe
import Data.Default
import Types.Size
import Types.Jewel
import Types.Item
import Types.Consumable
import Random.Probability
data Wall = NormalWall
| GoldWall Size
... | 5outh/textlunky | src/Types/Wall.hs | mit | 1,797 | 0 | 9 | 635 | 462 | 257 | 205 | 48 | 1 |
module Main where
import System.Random
import System.IO (hFlush, stdout)
import Control.Monad (unless)
main :: IO ()
main = do
gen <- getStdGen
askForNum gen
where
askForNum :: StdGen -> IO ()
askForNum generator = do
let (number, newGen) = randomR (1, 10) generator :: (Int, StdGen)
... | Forec/learn | 2017.1/joking-haskell/joking4.hs | mit | 649 | 0 | 16 | 191 | 201 | 101 | 100 | 19 | 2 |
module Language.Dash.VM.VM (
execute
, getVMHeapArray
, getVMHeapValue
) where
import Data.Word
import Foreign.C
import Foreign.Storable
import Foreign.Marshal.Array
import Foreign.Ptr
import Language.Dash.IR.Data (SymbolNameList)
import Language... | arne-schroppe/dash | src/Language/Dash/VM/VM.hs | mit | 1,353 | 0 | 15 | 329 | 355 | 190 | 165 | 32 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.