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 Ternary.Core.Kernel (
Kernel, FirstTwoSteps (Step0, Step1),
serial, chain, zipKernelsWith, transformFirstTwo,
iterateKernel) where
-- A kernel is a machine with an internal state. This state is such a
-- fundamental type here, that I decided not to hide it.
type Kernel input output state = input -> stat... | jeroennoels/exact-real | src/Ternary/Core/Kernel.hs | mit | 1,843 | 0 | 10 | 449 | 691 | 387 | 304 | 29 | 1 |
{- This module was generated from data in the Kate syntax
highlighting file modelines.xml, version 1.2, by Alex Turbov (i.zaufi@gmail.com) -}
module Text.Highlighting.Kate.Syntax.Modelines
(highlight, parseExpression, syntaxName, syntaxExtensions)
where
import Text.Highlighting.Kate.Types
import Text.High... | ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Modelines.hs | gpl-2.0 | 7,207 | 0 | 16 | 1,103 | 1,848 | 996 | 852 | 124 | 9 |
--
-- riot/Riot/Riot/Version.hs
--
-- Copyright (c) Tuomo Valkonen 2004-2005.
--
-- 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 l... | opqdonut/riot | Riot/Version.hs | gpl-2.0 | 472 | 0 | 7 | 81 | 53 | 35 | 18 | 6 | 1 |
module Macro.MetaMacro where
import Types
defineEnvironment :: String -> Note -> Note
defineEnvironment name = liftL $ TeXEnv name []
comm2 :: LaTeXC l => String -> l -> l -> l
comm2 name = liftL2 $ \l1 l2 -> TeXComm name [FixArg l1, FixArg l2]
comm3 :: LaTeXC l => String -> l -> l -> l -> l
comm3 name = ... | NorfairKing/the-notes | src/Macro/MetaMacro.hs | gpl-2.0 | 1,568 | 0 | 11 | 361 | 629 | 323 | 306 | 30 | 1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE RecursiveDo, RankNTypes #-}
{-# LANGUAGE Arrows #-}
module Game where
import Keyboard (keyDownEvents, Key( .. ))
import Types
import SignalUtils
import Vector
import Random
import Event
import Enemy (enemiesInit, enemiesStep)
import Player (playerInit, playerStep)
--impor... | ZSarver/DungeonDash | src/Game.hs | gpl-3.0 | 4,149 | 1 | 11 | 887 | 431 | 257 | 174 | 38 | 1 |
module Declare.Workspace where
import Declare.Layout
import Types
data Workspace = Workspace
{ spLayout :: Layout Pix TileRef
, spStartTile :: TileRef
} deriving (Eq, Ord, Show)
| ktvoelker/argon | src/Declare/Workspace.hs | gpl-3.0 | 191 | 0 | 9 | 39 | 55 | 32 | 23 | 7 | 0 |
----------------------------------------------------------------------
-- |
-- Module : Text.TeX.Context
-- Copyright : 2015-2017 Mathias Schenner,
-- 2015-2016 Language Science Press.
-- License : GPL-3
--
-- Maintainer : mschenner.dev@gmail.com
-- Stability : experimental
-- Portabil... | synsem/texhs | src/Text/TeX/Context.hs | gpl-3.0 | 1,207 | 0 | 5 | 301 | 161 | 116 | 45 | 40 | 0 |
import qualified NS3473.Rebars as R
import qualified NS3473.Concrete as M
import qualified NS3473.Walls as W
import qualified NS3473.Buckling as X
rebar12 = R.Rebar 12
rebar10 = R.Rebar 10
rebar = R.DoubleWallRebars rebar12 100 rebar10 100 40
conc = M.newConc "35"
wall = W.Wall 200 2400 conc rebar W.External 1.0
... | baalbek/ns3473wall | demo/demo1.hs | gpl-3.0 | 368 | 0 | 6 | 65 | 123 | 69 | 54 | 11 | 1 |
{- Implementation of BST (binary search tree)
Script is absolutly free/libre, but with no guarantee.
Author: Ondrej Profant -}
import qualified Data.List
{- DEF data structure -}
data (Ord a, Eq a) => Tree a = Nil | Node (Tree a) a (Tree a)
deriving Show
{- BASIC Information -}
empty :: (Ord a) => Tree a -> Bool
e... | Kedrigern/example-projects | haskell/bst.hs | gpl-3.0 | 2,762 | 12 | 10 | 709 | 1,463 | 754 | 709 | 71 | 4 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | dysinger/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/RequestEnvironmentInfo.hs | mpl-2.0 | 4,864 | 0 | 9 | 930 | 481 | 298 | 183 | 58 | 1 |
{-# LANGUAGE InstanceSigs #-}
module IdentityT where
import Control.Monad (join)
newtype Identity a =
Identity { runIdentity :: a }
deriving (Eq, Show)
newtype IdentityT f a =
IdentityT { runIdentityT :: f a }
deriving (Eq, Show)
instance Functor Identity where
fmap f (Identity a) = Identity (f a)
insta... | dmvianna/haskellbook | src/Ch25-IdentityT.hs | unlicense | 962 | 7 | 12 | 223 | 402 | 207 | 195 | 30 | 0 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QInputContext.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:36
Warning : this file is machine generated - do... | keera-studios/hsQt | Qtc/Enums/Gui/QInputContext.hs | bsd-2-clause | 2,471 | 0 | 18 | 521 | 596 | 303 | 293 | 52 | 1 |
--
-- Copyright © 2014-2015 Anchor Systems, Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
-- the 3-clause BSD licence.
--
-- | Description: Run /Synchron... | anchor/synchronise | lib/Synchronise/Program/Daemon.hs | bsd-3-clause | 690 | 0 | 10 | 128 | 100 | 57 | 43 | 11 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Api.Admin.UserAdmin
( UserAdminApi
, userAdminHandlers
) where
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Char8 as B
import ... | pellagic-puffbomb/simpleservantblog | src/Api/Admin/UserAdmin.hs | bsd-3-clause | 3,471 | 0 | 31 | 997 | 931 | 473 | 458 | 67 | 3 |
-- | A type lattice for Python 3.
module Language.Python.TypeInference.Analysis.TypeLattice (
UnionType (..),
ValueType (..),
BuiltinType (..),
FunctionType (..),
ClassType (..),
InstanceType (..),
HasClassId (..),
Env,
nabla,
check,
AType (..),
oneType,
filterType,
... | lfritz/python-type-inference | python-type-inference/src/Language/Python/TypeInference/Analysis/TypeLattice.hs | bsd-3-clause | 27,942 | 0 | 32 | 10,931 | 8,322 | 4,327 | 3,995 | 558 | 9 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ViewPatterns #-}
-- due to TypeDiff being a synonym:
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE Flex... | cdxr/haskell-interface | module-diff/Render.hs | bsd-3-clause | 8,749 | 0 | 14 | 2,524 | 2,862 | 1,460 | 1,402 | 206 | 3 |
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for... | nomeata/ghc | compiler/cmm/CmmCallConv.hs | bsd-3-clause | 6,497 | 2 | 17 | 1,905 | 1,471 | 831 | 640 | 103 | 21 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
-- {-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE AllowAmbiguousT... | iu-parfunc/AutoObsidian | interface_brainstorming/06_ExtensibleEffects/newVer/Eff1.hs | bsd-3-clause | 32,804 | 0 | 17 | 8,177 | 6,684 | 3,511 | 3,173 | -1 | -1 |
module Common.NonBlockingQueueSpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import qualified PolyGraph.Common.NonBlockingQueue.Properties as QProp
spec :: Spec
spec = do
describe "NonBlockingQueue" $ do
it "isFifo" $ property $
(QProp.isFifo :: [QProp.QueueInstruction Int] -> Bool)... | rpeszek/GraphPlay | test/Common/NonBlockingQueueSpec.hs | bsd-3-clause | 500 | 0 | 15 | 94 | 140 | 76 | 64 | 13 | 1 |
module D_Types where
import Data.Word
import Data.Int
import Data.ByteString.Lazy
import Data.Binary.Get
data TypeDesc = TD (Int, String, [FieldDescTest], [TypeDesc]) -- id, name, fieldDescs, subtypes
type FieldDesc = (String, [Something]) --name, data
type FieldDescTest = (String, [Something], ByteString) ... | skill-lang/skill | src/main/resources/haskell/D_Types.hs | bsd-3-clause | 1,599 | 0 | 8 | 832 | 273 | 180 | 93 | 33 | 0 |
module Data.GeoJSON
( module Data.GeoJSON.Classes
, module Data.GeoJSON.Position
, module Data.GeoJSON.Geometries
, module Data.GeoJSON.Features
) where
import Data.GeoJSON.Classes
import Data.GeoJSON.Features
import Data.GeoJSON.Geometries
import Data.GeoJSON.Position
| alios/geojson-types | src/Data/GeoJSON.hs | bsd-3-clause | 316 | 0 | 5 | 70 | 60 | 41 | 19 | 9 | 0 |
{-# OPTIONS -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances #-}
module Fay.Exts.NoAnnotation where
import Fay.Compiler.Prelude
import Data.List.Split (splitOn)
import Data.String
import qualified Language.Haskell.Exts.Annotated as A
type Alt = A.Alt ()
type BangTyp... | beni55/fay | src/Fay/Exts/NoAnnotation.hs | bsd-3-clause | 1,946 | 0 | 14 | 408 | 750 | 398 | 352 | 56 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Bead.View.Content.Notifications.Page (
notifications
) where
import Control.Monad (forM_)
import Data.String (fromString)
import Text.Printf (printf)
import qualified Bead.Controller.Pages as Pages
import Bead.View.Content
import ... | andorp/bead | src/Bead/View/Content/Notifications/Page.hs | bsd-3-clause | 5,478 | 0 | 26 | 1,143 | 1,152 | 586 | 566 | 105 | 18 |
{-# LANGUAGE FlexibleContexts, OverloadedStrings, RecordWildCards, ScopedTypeVariables, ConstraintKinds, PatternGuards #-}
-- |The HTTP/JSON plumbing used to implement the 'WD' monad.
--
-- These functions can be used to create your own 'WebDriver' instances, providing extra functionality for your application if desire... | wuzzeb/hs-webdriver | src/Test/WebDriver/Internal.hs | bsd-3-clause | 8,292 | 0 | 21 | 2,207 | 2,067 | 1,086 | 981 | 161 | 26 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE BangPatterns #-}
module Constraints.Set.Implementation (
ConstraintError(..),
Variance(..),
Inclusion,
SetExpression(..),
SolvedSystem,
emptySet,
universalSet,
setVariable,
atom,
term,
(<=!),
solveSystem,
leastS... | travitch/ifscs | src/Constraints/Set/Implementation.hs | bsd-3-clause | 17,569 | 0 | 17 | 4,725 | 3,288 | 1,733 | 1,555 | 207 | 10 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
-- | Parses strings into a set of tokens using the given rules.
module Youtan.Lexical.Tokenizer
( tokenize
, tokenizeDrops
, tokenizeT
, tokenizeTDrops
, Rules
, Wrapper
) where
import Control.Monad.State
import Control... | triplepointfive/Youtan | src/Youtan/Lexical/Tokenizer.hs | bsd-3-clause | 2,884 | 0 | 19 | 725 | 826 | 433 | 393 | 68 | 4 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Distributed.Process.FSM.Internal.Pr... | haskell-distributed/distributed-process-fsm | src/Control/Distributed/Process/FSM/Internal/Process.hs | bsd-3-clause | 6,071 | 0 | 15 | 1,446 | 1,941 | 1,033 | 908 | 124 | 2 |
module H99.Arithmetic where
import Data.List
{-
Problem 31
(**) Determine whether a given integer number is prime.
Example:
* (is-prime 7)
T
Example in Haskell:
P31> isPrime 7
True
-}
isPrime :: Int -> Bool
isPrime n = n `elem` (take n primes)
where
primes = filterPrime [2..]
filterPrime (x:xs)... | 1yefuwang1/haskell99problems | src/H99/Arithmetic.hs | bsd-3-clause | 5,883 | 0 | 12 | 1,319 | 969 | 509 | 460 | 53 | 2 |
{-# OPTIONS_GHC -fdefer-typed-holes #-}
----------------------------------------------------------------------------------------------------
-- |
-- Module : Numeric.Algebra.Elementary.Pretty
-- Copyright : William Knop 2015
-- License : BSD3
--
-- Maintainer : william.knop.nospam@gmail.com
-- Portab... | altaic/algebra-elementary | src/Numeric/Algebra/Elementary/Pretty.hs | bsd-3-clause | 677 | 0 | 7 | 122 | 66 | 46 | 20 | 6 | 1 |
{-# LANGUAGE TypeFamilies #-}
module QueryArrow.ElasticSearch.ESQL where
-- http://swizec.com/blog/writing-a-rest-client-in-haskell/swizec/6152
import Prelude hiding (lookup)
import Data.Map.Strict (lookup, fromList, Map, keys)
import Data.Text (Text)
import Data.Set (toAscList)
import QueryArrow.Syntax.Term
import... | xu-hao/QueryArrow | QueryArrow-db-elastic/src/QueryArrow/ElasticSearch/ESQL.hs | bsd-3-clause | 5,342 | 50 | 12 | 1,282 | 1,563 | 838 | 725 | 94 | 5 |
module Main (main) where
import Test.Tasty
import qualified TChunkedQueue
import qualified TMChunkedQueue
main :: IO ()
main = defaultMain $
testGroup "STM ChunkedQueues"
[ testGroup "TChunkedQueue" TChunkedQueue.tests
, testGroup "TMChunkedQueue" TMChunkedQueue.tests
]
| KholdStare/stm-chunked-queues | tests/UnitTests.hs | bsd-3-clause | 301 | 0 | 9 | 62 | 66 | 37 | 29 | 9 | 1 |
module Capsir.Runtime where
import Capsir
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromJust)
-- | An instance of a continuation. Binds an environment to the
-- continuation itself.
data ContInst v = ContInst (Env v) Cont
-- | A runtime value. Each variable is bound to one during cont... | naerbnic/capsir | src/Capsir/Runtime.hs | bsd-3-clause | 6,892 | 13 | 12 | 1,712 | 1,567 | 819 | 748 | 108 | 4 |
{-# LANGUAGE UnicodeSyntax #-}
module System.Linux.Netlink.Internal (
align4
) where
import Data.Bits
align4 ∷ (Num n, Bits n) ⇒ n → n
align4 n = (n + 3) .&. complement 3
{-# INLINE align4 #-}
| mvv/system-linux | src/System/Linux/Netlink/Internal.hs | bsd-3-clause | 209 | 0 | 7 | 45 | 66 | 38 | 28 | 7 | 1 |
{- |
Module : ./Static/DGNavigation.hs
Description : Navigation through the Development Graph
Copyright : (c) Ewaryst Schulz, DFKI Bremen 2011
License : GPLv2 or higher, see LICENSE.txt
Maintainer : ewaryst.schulz@dfki.de
Stability : experimental
Portability : non-portable (via imports)
Navigatio... | spechub/Hets | Static/DGNavigation.hs | gpl-2.0 | 8,374 | 5 | 26 | 2,163 | 2,288 | 1,179 | 1,109 | 128 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Db.Mapper where
import Control.Applicative
import Database.MongoDB
import Text.Read (readMaybe)
import Types
budgetToDocument :: Budget -> Document
budgetToDocument (Budget bid uid i d f ds ob cb) = (idFieldIfExists bid) ++
[ "userId" =: uid
, "income" ... | Geeroar/ut-haskell | src/Db/Mapper.hs | apache-2.0 | 4,130 | 0 | 13 | 1,415 | 1,143 | 583 | 560 | 83 | 6 |
module Main where
import VSimR.Timeline
import VSimR.Memory
import VSimR.Signal
import VSimR.Variable
-- main = do
-- elab
| ierton/vsim | Main.hs | bsd-3-clause | 142 | 0 | 4 | 36 | 26 | 17 | 9 | 5 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Mimir.Bitfinex.Instances() where
import Mimir.Types
import Mimir.Bitfinex.Types
import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.Aeson
import Data.Aeson.Types (Parser)
import Data.Char (toUpper)
import qualified Data.HashMap.Strict as HM
import Data... | ralphmorton/Mimir | src/Mimir/Bitfinex/Instances.hs | bsd-3-clause | 1,915 | 0 | 14 | 566 | 638 | 339 | 299 | 53 | 5 |
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --nested #-}
-- import qualified FindSpec
-- main :: IO ()
-- main = FindSpec.main
| mkrauskopf/doh | test/main.hs | bsd-3-clause | 129 | 0 | 2 | 21 | 6 | 5 | 1 | 1 | 0 |
-- From:http://rosettacode.org/wiki/Temperature_conversion#Haskell
--
main = do
putStrLn "Please enter temperature in kelvin: "
input <- getLine
let kelvin = read input :: Double
if
kelvin < 0.0
then
putStrLn "error"
else
let
celsius = kelvin - 273.15
fahrenheit = kelvin * 1.8 - 459... | junnf/Functional-Programming | codes/temperatures.hs | unlicense | 547 | 0 | 15 | 146 | 155 | 73 | 82 | 16 | 2 |
-- The @FamInst@ type: family instance heads
{-# LANGUAGE CPP, GADTs #-}
module FamInst (
FamInstEnvs, tcGetFamInstEnvs,
checkFamInstConsistency, tcExtendLocalFamInstEnv,
tcLookupFamInst,
tcLookupDataFamInst, tcLookupDataFamInst_maybe,
tcInstNewTyCon_maybe, tcTopNormaliseNewTyp... | forked-upstream-packages-for-ghcjs/ghc | compiler/typecheck/FamInst.hs | bsd-3-clause | 15,844 | 0 | 14 | 4,693 | 2,525 | 1,339 | 1,186 | 209 | 3 |
module A2 where
data T a = C1 a | C2 Int
addedC2 = error "added C2 Int to T"
over :: (T b) -> b
over (C1 x) = x
over (C2 a) = addedC2
| SAdams601/HaRe | old/testing/addCon/A2AST.hs | bsd-3-clause | 141 | 0 | 7 | 43 | 70 | 38 | 32 | 6 | 1 |
{-# Language RankNTypes #-}
{-# Language DataKinds #-}
{-# Language PolyKinds #-}
{-# Language GADTs #-}
{-# Language TypeFamilies #-}
module T15874 where
import Data.Kind
data Var where
Op :: Var
Id :: Var
type Varianced = (forall (var :: Var). Type)
data family Parser :: Varianced
data insta... | sdiehl/ghc | testsuite/tests/polykinds/T15874.hs | bsd-3-clause | 335 | 0 | 8 | 78 | 64 | 43 | 21 | 13 | 0 |
module Complex_Vectors
(ComplexF, rootsOfUnity,thetas, norm,distance)
where
import Complex --
--import Strategies
-- import Parallel
type ComplexF = Complex Double
rootsOfUnity:: Int -> [ComplexF]
rootsOfUnity n =( zipWith (:+) cvar svar) -- (map cos (thetas n))- (map sin (thetas n))
where
... | RefactoringTools/HaRe | old/testing/evalMonad/Complex_Vectors.hs | bsd-3-clause | 800 | 0 | 13 | 177 | 304 | 171 | 133 | 17 | 1 |
{-# LANGUAGE GADTs #-}
module Main where
data T t a where
T :: (Foldable t, Eq a) => t a -> T t a
{-# NOINLINE go #-}
go :: T [] a -> Int -> Int
go (T _) i = foldr (+) 0 [1..i]
main = print (go (T [1::Int]) 20000)
| ezyang/ghc | testsuite/tests/perf/should_run/T5835.hs | bsd-3-clause | 219 | 0 | 10 | 59 | 122 | 67 | 55 | 8 | 1 |
{-# LANGUAGE TypeInType #-}
module T9632 where
import Data.Kind
data B = T | F
data P :: B -> *
type B' = B
data P' :: B' -> *
| olsner/ghc | testsuite/tests/dependent/should_compile/T9632.hs | bsd-3-clause | 131 | 0 | 5 | 35 | 46 | 29 | 17 | -1 | -1 |
-- !!! Class and instance decl
module Test where
class K a where
op1 :: a -> a -> a
op2 :: Int -> a
instance K Int where
op1 a b = a+b
op2 x = x
instance K Bool where
op1 a b = a
-- Pick up the default decl for op2
instance K [a] where
op3 a = a -- Oo... | ezyang/ghc | testsuite/tests/rename/should_fail/rnfail008.hs | bsd-3-clause | 348 | 0 | 8 | 142 | 105 | 56 | 49 | 11 | 0 |
{-# LANGUAGE CPP #-}
#ifdef TESTS
module Data.Base58Address (BitcoinAddress, RippleAddress, RippleAddress0(..)) where
#else
module Data.Base58Address (BitcoinAddress, bitcoinAddressPayload, RippleAddress, rippleAddressPayload) where
#endif
import Control.Monad (guard)
import Control.Arrow ((***))
import Data.Word
impo... | singpolyma/base58address | Data/Base58Address.hs | isc | 3,715 | 10 | 17 | 570 | 1,204 | 627 | 577 | 71 | 2 |
module ShadowVarianceChebyshev1 where
data T = T {
minimum_variance :: Float
} deriving (Eq, Show)
chebyshev :: (Float, Float) -> Float -> Float -> Float
chebyshev (d, ds) min_variance t =
let p = if t <= d then 1.0 else 0.0
variance = max (ds - (d * d)) min_variance
du = t - d
p_ma... | io7m/r2 | com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/ShadowVarianceChebyshev1.hs | isc | 501 | 0 | 13 | 136 | 215 | 119 | 96 | 14 | 2 |
-------------------
-- This module defines the following common monads:
--
-- SR - state reader monad
-- State - (strict) state transformer monad
-- IOS - IO monad with state
-- Output - output monad
-- CPS - continuation passing monad
--
-- Most of these monads can be found in Wadler's papers abo... | jtestard/cse230Winter2015 | SOE/haskore/src/Monads.hs | mit | 5,122 | 14 | 16 | 1,278 | 2,000 | 1,079 | 921 | 76 | 1 |
module Statistics.SGT.Util where
sq :: (Num a) => a -> a
sq n = n * n
-- for use with non-Double args
(//) :: Integral a => a -> a -> Double
(//) a b = fromIntegral a / fromIntegral b
dbl :: Integral a => a -> Double
dbl = fromIntegral
dblLog :: Integral a => a -> Double
dblLog = log . dbl
| marklar/Statistics.SGT | Statistics/SGT/Util.hs | mit | 295 | 0 | 7 | 70 | 128 | 69 | 59 | -1 | -1 |
{- Using textures instead of surfaces -}
{-# LANGUAGE OverloadedStrings #-}
module Lesson07 where
--
import qualified SDL
import Linear.V4 (V4(..))
--
import Control.Concurrent (threadDelay)
import Control.Monad (unless,when)
--
import qualified Config
--
lesson07 :: IO ()
lesson07 = do
SDL.initialize [SDL.InitVideo... | jaiyalas/sdl2-examples | src/Lesson07.hs | mit | 1,730 | 0 | 18 | 394 | 337 | 168 | 169 | 33 | 1 |
module Main where
import Test.QuickCheck
import Tictactoe.Base
import Tictactoe.Move.Base
import Tictactoe.Def.Move as DefMove
import Tictactoe.Att.Move as AttMove
import Tictactoe.Bencode.Encoder as Bencode
import Tictactoe.Bencode.Decoder as Bencode
import Tictactoe.BencodeDict.Encoder as BencodeDict
import Tictacto... | viktorasl/tictactoe-bot | tests/Tictactoe/Tests.hs | mit | 2,972 | 0 | 13 | 345 | 1,607 | 962 | 645 | 35 | 1 |
-----------------------------------------------------------
-- |
-- module: C2HS.C.Extra.Marshal
-- copyright: (c) 2016 Tao He
-- license: MIT
-- maintainer: sighingnow@gmail.com
--
-- Convenient marshallers for complicate C types.
--
{-# LANGU... | sighingnow/mxnet-haskell | c2hs-extra/src/C2HS/C/Extra/Marshal.hs | mit | 3,227 | 0 | 11 | 932 | 638 | 344 | 294 | 51 | 3 |
import qualified Data.ByteString.Lazy as LB
import HaxParse.Parser
import HaxParse.Options
import HaxParse.Output
import Options.Applicative
import System.Exit
import System.IO
main :: IO ()
main = do opts <- execParser fullOpts
res <- parseFile $... | pikajude/haxparse | src/Main.hs | mit | 607 | 0 | 14 | 223 | 163 | 82 | 81 | 14 | 3 |
module Main (main) where
import Data.List (genericLength)
import Data.Maybe (catMaybes)
import System.Directory (doesFileExist)
import System.Exit (exitFailure, exitSuccess)
import System.Process (readProcess)
import Text.Regex (matchRegex, mkRegex)
average :: (Fractional a, Real b) => [b] -> a
average xs = realToFra... | tfausak/haskeleton | package-name/test-suite/HPC.hs | mit | 1,152 | 0 | 11 | 229 | 348 | 184 | 164 | 29 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
module Advent.Day1Spec (main, spec) where
import Advent.Day1
import BasePrelude
import Test.Hspec
import Test.QuickCheck
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "day1Part1" $ do
it "equal delimiters cancel out" $... | jhenahan/adventofcode | test/Advent/Day1Spec.hs | mit | 1,419 | 0 | 17 | 369 | 420 | 202 | 218 | 35 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2021.M02.D18.Exercise where
{--
We uploaded the reviews yesterday, but the unicoded wine-reviews also have an
(optional) score and an (optional) price-point. We need to upload those data
now, as well.
--}
import qualified Data.Text as T
import Y2021.M02.D03.Solution (Revie... | geophf/1HaskellADay | exercises/HAD/Y2021/M02/D18/Exercise.hs | mit | 1,478 | 0 | 11 | 245 | 202 | 126 | 76 | 16 | 1 |
module Main where
import Puzzle
import Solver
import System.TimeIt
main :: IO ()
main = analyzeAndSolve oscarsPuzzle
--main = analyzeAndSolve mediumPuzzle
analyzeAndSolve :: Puzzle -> IO ()
analyzeAndSolve p = do
analyzePuzzle p
timeIt $ putStrLn $ show $ solve p
timeIt $ putStrLn $ show $ take 100 $ sol... | johwerm/cube-solver | src/Main.hs | mit | 381 | 0 | 10 | 81 | 106 | 53 | 53 | 11 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, InstanceSigs #-}
module LinterUtility (linterSettings) where
import Control.Applicative
import Data.List.Utils
import System.IO
import Data.ConfigFile
import CompilationUtility
import qualified ConfigFile
import Printer
impo... | Prinhotels/goog-closure | src/LinterUtility.hs | mit | 1,748 | 0 | 15 | 309 | 511 | 262 | 249 | 42 | 1 |
import System.Random
import Control.Monad(when)
main = do
gen <- getStdGen
askForNumber gen
askForNumber :: StdGen -> IO ()
askForNumber gen = do
let (randNumber, newGen) = randomR (1,10) gen :: (Int, StdGen)
putStr "Which number in the range from 1 to 10 am I thinking of? "
... | KHs000/haskellToys | src/scripts/guess_the_number.hs | mit | 604 | 0 | 13 | 191 | 172 | 83 | 89 | 16 | 2 |
{- |
Module : $Header$
Description : Static analysis of CspCASL
Copyright : (c) Andy Gimblett, Liam O'Reilly, Markus Roggenbach,
Swansea University 2008, C. Maeder, DFKI 2011
License : GPLv2 or higher, see LICENSE.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
... | nevrenato/Hets_Fork | CspCASL/StatAnaCSP.hs | gpl-2.0 | 37,319 | 0 | 29 | 10,760 | 9,234 | 4,551 | 4,683 | 619 | 18 |
module Yi.Char.Unicode (greek, symbols, subscripts, superscripts, checkAmbs, disamb) where
import Data.List (isPrefixOf)
import Control.Applicative
{-# ANN module "HLint: ignore Use string literal" #-}
greek :: [(String, String)]
greek = [(name, unicode) | (_,name,unicode) <- greekData] ++
[ ([leading,shortha... | atsukotakahashi/wi | src/library/Yi/Char/Unicode.hs | gpl-2.0 | 6,311 | 61 | 10 | 1,582 | 2,179 | 1,499 | 680 | 221 | 2 |
module Couple where
import Data.Char
import Test.QuickCheck
import Test.QuickCheck.All
-- unique couple (a,b) such that a*b = n
-- As the multiplication is commutative, we consider (a,b) == (b,a)
isqrt :: Int -> Int
isqrt = floor . sqrt . fromIntegral
couple :: Int -> [(Int, Int)]
couple n = [(a,b) | a <- [1..isqrt ... | ardumont/haskell-lab | src/couple.hs | gpl-2.0 | 2,225 | 0 | 11 | 390 | 582 | 334 | 248 | 23 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
-- Copyright (C) 2008 JP Bernardy
-- | This module defines buffer operation on regions
module Yi.Buffer.Region
(
module Yi.Region
, swapRegionsB
, deleteRegionB
, replaceRegionB
, replaceRegionClever
, readRegionB
, mapRegionB
, modifyRegionB
, modifyRegionCle... | codemac/yi-editor | src/Yi/Buffer/Region.hs | gpl-2.0 | 3,857 | 0 | 16 | 931 | 977 | 491 | 486 | 78 | 3 |
{-# LANGUAGE CPP #-}
module BPackReader
(parseImageFile,
parseMapFile,
ParsedImage,
gliphs,
palette,
gliphSize,
PaletteEntry,
Gliph,
gliphData,
gliphWidth,
... | codders/gp3 | src/BPackReader.hs | gpl-3.0 | 16,244 | 0 | 20 | 5,918 | 4,150 | 2,141 | 2,009 | 253 | 4 |
module Te.Util where
import Import
import Data.Text (concat, pack, Text)
import Shelly
findRootDir :: Text -> Sh (Maybe FilePath)
findRootDir fileToFind = do
startingDir <- pwd
dir <- go
cd startingDir
return dir
where
go = do
filePresent <- hasFile fileToFind
currentDir <- pwd
if f... | jetaggart/te | src/Te/Util.hs | gpl-3.0 | 821 | 0 | 12 | 213 | 286 | 135 | 151 | 32 | 3 |
{-# LANGUAGE FlexibleContexts #-}
module Mudblood.Contrib.MG.Guilds
( module Mudblood.Contrib.MG.Guilds.Common
, module Mudblood.Contrib.MG.Guilds.Tanjian
, module Mudblood.Contrib.MG.Guilds.Zauberer
, defaultStatus
, guardGuild
) where
import Data.Maybe
import Data.String.Utils
import Text.... | talanis85/mudblood | src/Mudblood/Contrib/MG/Guilds.hs | gpl-3.0 | 1,003 | 0 | 10 | 200 | 273 | 161 | 112 | 28 | 1 |
{-|
Module: DependentTypes.Parser
Description: Parsing functions.
-}
module DependentTypes.Parser
( DependentTypes.Parser.parse
) where
import Control.Monad
import DependentTypes.Data
import Text.Parsec
import Text.Parsec.String
-- | Parses the input and returns either a ParseError or a grammatica... | ramaciotti/dependent-types | src/lib/DependentTypes/Parser.hs | gpl-3.0 | 5,397 | 0 | 11 | 1,016 | 1,201 | 590 | 611 | 137 | 1 |
module Game where
import Actions (modifiedField, resolve)
import qualified Cards
import Control.Lens (view, (^.))
import Data.Maybe (fromMaybe)
import DataTypes
import qualified Decks
import GameActionParser (parseGameAction)
import qualified GameIO as Gio
import Polysemy (Member, Members, Sem)
import Polysemy.Input (... | MoritzR/CurseOfDestiny | src/Game.hs | gpl-3.0 | 2,882 | 0 | 12 | 516 | 879 | 457 | 422 | -1 | -1 |
removeMultiple :: Int -> [Int] -> [Int]
removeMultiple n = filter (\x -> x `mod` n /= 0)
getPrimes :: [Int]
getPrimes = getPrimes' [2..]
where
getPrimes' (x:xs) = x : getPrimes' (removeMultiple x xs)
getPrimesOpt = getPrimesOpt' [2..]
where getPrimesOpt' (x:xs) = x : getPrimesOpt' [y | y <- xs, y `mo... | muralikrishna8/Haskell-problems | infinitePrimeNumbers.hs | gpl-3.0 | 331 | 0 | 10 | 75 | 160 | 86 | 74 | 7 | 1 |
{-# LANGUAGE TupleSections, Rank2Types, ScopedTypeVariables #-}
module Service.Periodic
( forkPeriodic
) where
import Control.Concurrent (ThreadId, forkFinally, threadDelay)
import Control.Exception (handle, mask)
import Control.Monad (void, when)
import Control.Monad.Trans.Reader (withReaderT)
import Data.Fixed (... | databrary/databrary | src/Service/Periodic.hs | agpl-3.0 | 2,314 | 0 | 21 | 427 | 819 | 429 | 390 | 64 | 3 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
module DBusInterface
(rootObject) where
imp... | pontarius/pontarius-service | source/DBusInterface.hs | agpl-3.0 | 11,054 | 0 | 11 | 3,364 | 2,192 | 1,157 | 1,035 | 260 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.DynamicWorkspacesPure
-- Copyright : (c) David Roundy <droundy@darcs.net>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : none
-- Stability : unstable
-- Portability : unportable
--... | duckwork/dots | xmonad/lib/XMonad/Actions/DynamicWorkspacesPure.hs | unlicense | 8,869 | 0 | 18 | 2,827 | 1,935 | 1,008 | 927 | 108 | 4 |
module AlecSequences.A279966 (a279966) where
import Tables.A274080 (a274080_row)
import Data.List (genericIndex, genericLength)
a279966 :: Integer -> Integer
a279966 1 = 1
a279966 n = genericIndex a279966_list (n - 1)
a279966_list :: [Integer]
a279966_list = 1 : map count [2..] where
count n = genericLength $ filte... | peterokagey/haskellOEIS | src/AlecSequences/A279966.hs | apache-2.0 | 452 | 0 | 12 | 78 | 159 | 86 | 73 | 11 | 1 |
import Test.Tasty
import Test.Tasty.HUnit
import Text.ChordPro.Parser
import Text.ChordPro.Types
import Text.Trifecta
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [unitTests]
simpleLyric :: String
simpleLyric = concat [ "[C]Cecilia, you're [F]breaking my [C]heart, you're "
... | relrod/chordpro | test/test.hs | bsd-2-clause | 950 | 0 | 11 | 193 | 239 | 124 | 115 | 25 | 1 |
{-# LANGUAGE TypeFamilies, RankNTypes, ScopedTypeVariables,
ViewPatterns, BangPatterns #-}
module OffLattice.HPChain where
import OffLattice.Util
import LA
import qualified LA.Transform as T
import qualified LA.Matrix as M
import qualified OffLattice.Chain as C
import qualified OffLattice.Shape as S
import qua... | chalmers-kandidat14/off-lattice | OffLattice/HPChain.hs | bsd-3-clause | 8,233 | 0 | 16 | 3,277 | 3,160 | 1,601 | 1,559 | 207 | 7 |
module Main where
import System.Environment
import System.Exit
import System.FilePath
import System.FilePath.GlobPattern (GlobPattern, (~~))
import System.IO
import System.FSNotify
import Control.Monad (forever)
import Control.Concurrent (threadDelay)
import Data.Text (pack)
import Data.Bits ((.&.))
main :: IO ()... | rob-b/hobbes | Hobbes.hs | bsd-3-clause | 1,327 | 0 | 13 | 246 | 467 | 244 | 223 | 39 | 1 |
module Evol.Algo.SGA (
) where
-- evil
import Evil.EvoAlgorithm
import Evil.Individual
import Evil.Spaces
import Evil.PPrintable
import Evil.RandUtils
-- vector
import qualified Data.Vector as V
newtype SGA = SGA
instance EvoAlgorithm SGA () where
initialize () gen = undefined
nextGen = undefined
| kgadek/evil-pareto-tests | src_old/Evol/Algo/SGA.hs | bsd-3-clause | 314 | 2 | 6 | 57 | 65 | 42 | 23 | -1 | -1 |
module YouTube.Services
( browseChannel
, browseMyChannel
, createPlaylist
, createPlaylists
, deletePlaylist
, findChannel
, insertVideo
, listPlaylist
, listVideos
) where
import GoogleAPIsClient
import Helpers (hashURL)
import Model (Tournament(..))
import... | ptitfred/ftv-vods | src/YouTube/Services.hs | bsd-3-clause | 4,534 | 0 | 13 | 1,067 | 1,283 | 667 | 616 | 105 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# OPTIONS_HADDOCK -ignore-exports #-}
-- | A simple OAuth2 Haskell binding. (This is supposed to be
-- independent of the http client used.)
module Network.OAuth.OAu... | reactormonk/hoauth2 | src/Network/OAuth/OAuth2/Internal.hs | bsd-3-clause | 6,949 | 0 | 16 | 1,713 | 1,552 | 876 | 676 | 112 | 4 |
---------------------------------------------------------
--
-- Module : ErrorHandling
-- Copyright : Bartosz Wójcik (2010)
-- License : BSD3
--
-- Maintainer : bartek@sudety.it
-- Stability : Unstable
-- Portability : portable
--
-- Error handling data structures, functions, etc.
-... | bartoszw/haslo | Haslo/ErrorHandling.hs | bsd-3-clause | 5,551 | 41 | 27 | 2,080 | 731 | 395 | 336 | 92 | 1 |
{-# LANGUAGE FlexibleInstances, OverloadedStrings #-}
module Data.Document (
FromDocument (..)
, ToDocument (..)
) where
import qualified Database.MongoDB as D
import qualified Data.Time.Clock as T
class FromDocument a where
fromDocument :: D.Document -> a
instance FromDocument a => Fro... | RobinKrom/BtcExchanges | src/Data/Document.hs | bsd-3-clause | 492 | 0 | 9 | 105 | 139 | 79 | 60 | 12 | 0 |
-- | Creating and rendering dot graphs that correspond to expression graphs.
-- Each node has a single output and zero or more inputs.
module Dot where
import Language.Dot -- cabal install language-dot
-- To generate an SVG file:
--
-- dot -Tsvg file.dot -o file.svg
--
-- Requires `graphviz` to be installed.
... | emilaxelsson/ag-graph | src/Dot.hs | bsd-3-clause | 2,914 | 0 | 18 | 804 | 722 | 389 | 333 | 71 | 1 |
module SimulationDSL
( module SimulationDSL.Language.EquationsDescription
, module SimulationDSL.Language.Exp
, module SimulationDSL.Data.ExpType
, module SimulationDSL.Data.Scalar
, module SimulationDSL.Data.Vector3
, module SimulationDSL.Data.Array
, module SimulationDSL.Interpreter.SimMachine
, modul... | takagi/SimulationDSL | SimulationDSL/SimulationDSL.hs | bsd-3-clause | 894 | 0 | 5 | 123 | 146 | 100 | 46 | 20 | 0 |
module Main where
import Test.Hspec
import Test.Hspec.HUnit
import Test.HUnit
import Data.Char
import Data.Either
import Data.Maybe
import Chess
import Chess.FEN
import Control.Monad.Instances
import Control.Monad
assertNothing msg x = assertEqual msg Nothing x
assertJust msg (Just x) = return ()
assertJust msg (Noth... | ArnoVanLumig/chesshs | ChessTest.hs | bsd-3-clause | 11,303 | 0 | 23 | 2,502 | 3,711 | 1,804 | 1,907 | 245 | 2 |
{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.ByteString.Fusion
-- License : BSD-style
-- Maintainer : dons@cse.unsw.edu.au
-- Stability : experimental
-- Portability : portable
--
-- Stream fusion for ByteStrings.
--
-- See the paper /Stream Fusion: From Lists to Streams to Nothing at All/,
-- Coutts,... | markflorisson/hpack | testrepo/bytestring-0.9.1.9/Data/ByteString/Fusion.hs | bsd-3-clause | 445 | 0 | 3 | 91 | 24 | 21 | 3 | 2 | 0 |
module SudokuParser(parseMatrix) where
import Text.ParserCombinators.Parsec
import Data.Char
parseMatrix :: Parser [[Int]]
parseMatrix = do
result <- count 9 parseLine
_ <- eof
return result
parseLine :: Parser [Int]
parseLine = do
result <- count 9 parseDigit
_ <- eol
... | jaapterwoerds/algorithmx | src/SudokuParser.hs | bsd-3-clause | 576 | 0 | 11 | 164 | 190 | 93 | 97 | 23 | 1 |
module Game.Data(
Game(..)
) where
import GHC.Generics
import Control.DeepSeq
data Game = Game {
gameExit :: Bool
}
deriving (Generic)
instance NFData Game
| Teaspot-Studio/gore-and-ash-game | src/client/Game/Data.hs | bsd-3-clause | 176 | 0 | 8 | 43 | 54 | 32 | 22 | 8 | 0 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Criterion.Collection.Internal.Types
( Workload(..)
, WorkloadGenerator
, WorkloadMonad(..)
, runWorkloadMonad
, getRNG
, DataStructure(..)
, setupData
, setupDataIO... | cornell-pl/HsAdapton | weak-hashtables/benchmark/src/Criterion/Collection/Internal/Types.hs | bsd-3-clause | 3,932 | 0 | 14 | 718 | 442 | 265 | 177 | 41 | 1 |
module EventLoop
( eventLoop
) where
import Control.Monad (unless)
import Graphics.UI.GLFW (Key (..), KeyState (..), Window, getKey,
pollEvents, swapBuffers, windowShouldClose)
-- | A simple rendering event loop which repeats the provided action until ... | psandahl/outdoor-terrain | src/EventLoop.hs | bsd-3-clause | 754 | 0 | 12 | 264 | 161 | 86 | 75 | 16 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TupleSections #-}
module Language.Haskell.Liquid.Bare.DataType (
makeConTypes
, makeTyConEmbeds
, dataConSpec
, meetDataConSpec
) where
import DataCon
import TyCon
import Var
import Control.Applicative ((<$>))
import Data.Maybe
import Data.Monoid
i... | abakst/liquidhaskell | src/Language/Haskell/Liquid/Bare/DataType.hs | bsd-3-clause | 5,429 | 0 | 15 | 1,368 | 2,143 | 1,132 | 1,011 | 103 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
module Plowtech.Service.... | plow-technologies/template-service | src/Plowtech/Service/Types.hs | bsd-3-clause | 7,042 | 0 | 24 | 1,194 | 1,877 | 1,021 | 856 | 123 | 1 |
module Data.LLVM.Types.Identifiers (
-- * Types
Identifier,
-- * Accessor
identifierAsString,
identifierContent,
isAnonymousIdentifier,
-- * Builders
makeAnonymousLocal,
makeLocalIdentifier,
makeGlobalIdentifier,
makeMetaIdentifier
) where
import Control.DeepSeq
import Data.Hashable
import Data... | travitch/llvm-base-types | src/Data/LLVM/Types/Identifiers.hs | bsd-3-clause | 2,587 | 0 | 9 | 717 | 581 | 316 | 265 | 68 | 1 |
module Main
( (|>)
, (>>>)
) where
import Operators ((|>), (>>>))
test :: [Int] -> Int
test =
foldr 1.0 (*)
test2 :: a -> a -> ( a, a )
test2 =
(,)
(|>) :: a -> (a -> b) -> b
(|>) v f =
f v
| hecrj/haskell-format | test/specs/operators/output.hs | bsd-3-clause | 221 | 0 | 8 | 81 | 119 | 74 | 45 | 13 | 1 |
{-# LANGUAGE ScopedTypeVariables, TypeFamilies, TupleSections #-}
module Fuml.Core where
import qualified Data.Vector.Storable as VS
import Numeric.LinearAlgebra
import Data.List (nub)
import Lens.Micro
import Control.Monad.Identity
data Weighted o = Weighted Double o
-- |The result of running a predictive model
da... | diffusionkinetics/open | fuml/lib/Fuml/Core.hs | mit | 1,869 | 0 | 15 | 474 | 665 | 358 | 307 | 33 | 1 |
-- HACKERRANK: Super Digit
-- https://www.hackerrank.com/challenges/super-digit
module Main where
digits :: Integer -> [Integer]
digits 0 = []
digits n = m : rest
where m = mod n 10
rest = digits (div n 10)
solve :: Integer -> Integer
solve n = if n < 10 then n else solve $ sum $ digits ... | everyevery/programming_study | hackerrank/functional/super-digit/super-digit.hs | mit | 516 | 0 | 13 | 156 | 209 | 106 | 103 | 13 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-devicefarm/gen/Network/AWS/DeviceFarm/ListProjects.hs | mpl-2.0 | 4,938 | 0 | 13 | 1,149 | 765 | 456 | 309 | 94 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- |
-- Module : Test.AWS.S3
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : experimental
-- Portability : non-portable (GHC ext... | olorin/amazonka | amazonka-s3/test/Test/AWS/S3.hs | mpl-2.0 | 3,827 | 0 | 31 | 1,604 | 491 | 266 | 225 | 66 | 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-glacier/gen/Network/AWS/Glacier/CompleteVaultLock.hs | mpl-2.0 | 5,125 | 0 | 9 | 963 | 537 | 331 | 206 | 70 | 1 |
{-# LANGUAGE DeriveDataTypeable, CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Signal
-- Copyright : (c) Andrea Rosatto
-- : (c) Jose A. Ortega Ruiz
-- : (c) Jochen Keil
-- License : BSD-style (see LICENSE)
--
-- Maintaine... | tsiliakis/xmobar | src/Signal.hs | bsd-3-clause | 1,955 | 0 | 10 | 436 | 392 | 217 | 175 | 35 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.