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 : Utils
Description : Utility functions
-}
module Utils where
import Data.Map (Map)
import qualified Data.Map.Strict as M
-- |Unsafely lookup a value in a map by key
unsafeLookup :: (Show k, Show v, Ord k) => k -> Map k v -> v
unsafeLookup k m =
case M.lookup k m of
Nothing -> error $ "unsafeLo... | adamschoenemann/simple-frp | src/Utils.hs | mit | 528 | 0 | 11 | 128 | 180 | 95 | 85 | 12 | 2 |
module Network.Statsd.UdpClient (
UdpClient
, fromURI
, send
) where
import Control.Monad
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BLazy
import qualified Data.ByteString.Char8 as BC
import Data.ByteString.Lazy.Builder (int64LE, toLazyByteString)
import Data.Byteable
import Syste... | keithduncan/statsd-client | src/Network/Statsd/UdpClient.hs | mit | 3,318 | 0 | 14 | 904 | 1,152 | 603 | 549 | 79 | 7 |
-----------------------------------------------------------------------------
--
-- Module : Main
-- Copyright :
-- License : AllRightsReserved
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------
module Main (
m... | uvNikita/TopologyRouting | src/Main.hs | mit | 654 | 0 | 6 | 120 | 83 | 56 | 27 | 7 | 1 |
-- | Contains master-related actions, like finding a specific master release by id
-- or getting a list of all master versions.
module Discogs.Actions.Master
( getMaster,
getMasterVersions ) where
import Discogs.Types.Master
import Discogs.Types.Discogs
import qualified Discogs.Routes.Master as Route
import ... | accraze/discogs-haskell | src/Discogs/Actions/Master.hs | mit | 1,003 | 0 | 7 | 157 | 140 | 89 | 51 | 14 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-licensespecification.html
module Stratosphere.ResourceProperties.EC2LaunchTemplateLicenseS... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/EC2LaunchTemplateLicenseSpecification.hs | mit | 1,813 | 0 | 12 | 158 | 174 | 101 | 73 | 22 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Oden.Infer.Unification (
UnificationError(..),
Constraint,
runSolve,
unifyMany,
unifies
) where
import Control.Monad.Except
import Control.Monad.Identity
import qualified Data.Map as Map
im... | AlbinTheander/oden | src/Oden/Infer/Unification.hs | mit | 4,690 | 0 | 19 | 1,140 | 1,678 | 867 | 811 | 90 | 2 |
-- |
-- Module : Data.Logic.Propositional
-- Copyright : (c) K. Isom (2015)
-- License : BSD-style
--
-- Maintainer : coder@kyleisom.net
-- Stability : stable
-- Portability : portable
--
-- This is a library for representing and implementing propositional logic
-- proofs.
module Data.Logic.Proposition... | kisom/plc | src/Data/Logic/Propositional.hs | mit | 4,966 | 1 | 14 | 1,166 | 1,476 | 723 | 753 | 101 | 4 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.WebKitCSSMatrix
(newWebKitCSSMatrix, setMatrixValue, multiply, multiply_, inverse,
inverse_, translate, t... | ghcjs/jsaddle-dom | src/JSDOM/Generated/WebKitCSSMatrix.hs | mit | 18,985 | 0 | 12 | 2,956 | 4,461 | 2,343 | 2,118 | 236 | 1 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Y2017.M09.D20.Solution where
import Control.Monad (void)
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Tuple (swap)
import Database.PostgreSQL.Si... | geophf/1HaskellADay | exercises/HAD/Y2017/M09/D20/Solution.hs | mit | 4,390 | 0 | 11 | 774 | 499 | 296 | 203 | 38 | 1 |
-- shorter concat [reverse longer]
-- http://www.codewars.com/kata/54557d61126a00423b000a45
module ReverseLonger where
reverseLonger :: String -> String -> String
reverseLonger a b | length a >= length b = b ++ reverse a ++ b
| otherwise = a ++ reverse b ++ a
| gafiatulin/codewars | src/7 kyu/ReverseLonger.hs | mit | 280 | 0 | 9 | 62 | 76 | 37 | 39 | 4 | 1 |
module Core.Passes(
passes,
printPass,
ppIO
) where
import Core
import Core.Helper
import Flags
import Pretty
import Core.Renamer
import Core.Simplify
import Core.ReduceLinear
import Core.Atomize
import Core.Inliner
passes :: [Function] -> CompilerM [Function]
passes fs =
printPass DumpCore fs >>... | C-Elegans/linear | Core/Passes.hs | mit | 1,224 | 0 | 21 | 336 | 400 | 199 | 201 | 42 | 1 |
import Data.ByteString.Char8 (pack)
import Crypto.Hash
main = do
let input = "vkjiggvb"
result = compute input
print result
type Coord = (Int, Int)
type Dir = Char
type State = (Coord, [Dir], String)
bounds :: Int
bounds = 3
start :: Coord
start = (0,0)
initState :: St... | aBhallo/AoC2016 | Day 17/day17part1.hs | mit | 1,773 | 0 | 10 | 488 | 858 | 471 | 387 | 49 | 5 |
sumOfCorners n =
4*n*n - 6*n + 6
solution =
1 + (sum $ map sumOfCorners [3,5 .. 1001])
main = print solution
| drcabana/euler-fp | source/hs/P28.hs | epl-1.0 | 121 | 0 | 9 | 35 | 67 | 35 | 32 | 5 | 1 |
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, OverloadedStrings #-}
module API
( Task
, getCurrent
, stopTask
, description
) where
import Data.Maybe
import qualified Data.ByteString.Char8 as S
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Lazy.Char8 as BC
import qualified Data.Text.La... | termoshtt/toggl-cli | API.hs | gpl-2.0 | 1,904 | 0 | 15 | 440 | 582 | 320 | 262 | 60 | 1 |
module Main where
import Options.Applicative
import DarkPlaces.DemoMetadata
import DarkPlaces.Text
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Char8 as BLC
import System.Directory (doesFileExist)
import System.Exit
import Control.Monad.Error
import Text.Printf
import Data.Either
im... | bacher09/darkplaces-demo | utils/DemoInfo.hs | gpl-2.0 | 5,616 | 0 | 18 | 1,534 | 1,819 | 917 | 902 | 146 | 7 |
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables,
PatternGuards #-}
{-
Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; eithe... | fibsifan/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | 57,173 | 0 | 42 | 19,530 | 15,749 | 7,957 | 7,792 | 1,129 | 76 |
{-# LANGUAGE TemplateHaskell #-}
module RAM.Property where
import Autolib.Reader
import Autolib.ToDoc
import Data.Typeable
import RAM.Builtin
data Property = Builtins [ Builtin ]
| No_While
| No_Loop
deriving ( Typeable , Eq )
$(derives [makeReader, makeToDoc] [''Property])
exampl... | florianpilz/autotool | src/RAM/Property.hs | gpl-2.0 | 435 | 2 | 9 | 112 | 108 | 64 | 44 | 14 | 1 |
{-# language DeriveDataTypeable #-}
{-# language StandaloneDeriving #-}
{-# language Rank2Types #-}
module Operate.Types where
import Types.TT
import Types.Basic
import Types.Signed as S
import Types.Documented as D
import Types.ServerInfo
import Types.TaskTree
import Types.TaskDescription
import Types.Config
import ... | marcellussiegburg/autotool | db/src/Operate/Types.hs | gpl-2.0 | 6,459 | 2 | 20 | 2,297 | 1,768 | 902 | 866 | 160 | 4 |
-- | Common JSON settings.
module JSON
( jsonOptions,
)
where
import Data.Aeson (Options (..), camelTo2, defaultOptions)
jsonOptions :: Options
jsonOptions =
defaultOptions
{ fieldLabelModifier = camelTo2 '_',
omitNothingFields = True
}
| phaazon/phaazon.net | backend/src/JSON.hs | gpl-3.0 | 259 | 0 | 7 | 54 | 58 | 37 | 21 | 8 | 1 |
-- This lexer is not completely to spec. We accept certain characters that the
-- spec would not allow, simplifying our lexer as suggested by Bermudez during
-- lecture. For example, our strings could contain any arbitrary Unicode
-- code-point, while the spec's can only handle a certain subset of ASCII.
--
-- We use P... | bgw/hs-rpal | src/Lexer.hs | gpl-3.0 | 4,118 | 0 | 13 | 1,280 | 813 | 446 | 367 | 78 | 22 |
{-# LANGUAGE TypeSynonymInstances #-}
module Geometry where
import Data.List
import Data.Maybe
import Control.Monad
data Vector = Vector !Double !Double !Double
deriving (Show, Read)
instance Eq Vector where
Vector x1 y1 z1 == Vector x2 y2 z2 = x1 ~= x2 && y1 ~= y2 && z1 ~= z2
(~=) :: (Floating... | herngyi/hmol | Geometry.hs | gpl-3.0 | 14,575 | 0 | 18 | 5,265 | 6,660 | 3,524 | 3,136 | 294 | 6 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dlp/gen/Network/Google/Resource/DLP/Projects/Locations/InspectTemplates/Patch.hs | mpl-2.0 | 6,156 | 0 | 16 | 1,269 | 781 | 458 | 323 | 120 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-plus/gen/Network/Google/Resource/Plus/Activities/Get.hs | mpl-2.0 | 2,743 | 0 | 12 | 587 | 304 | 188 | 116 | 47 | 1 |
{-
Copyright (C) 2014 Albert Krewinkel <tarleb+metropolis@moltkeplatz.de>
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 of the License, or (at your
option) any later versio... | tarleb/rundoc | src/Text/Rundoc.hs | agpl-3.0 | 7,594 | 0 | 14 | 2,084 | 1,706 | 930 | 776 | 168 | 6 |
{-# LANGUAGE NoImplicitPrelude #-}
module Except (ExceptT(..), throwE, runExceptT) where
import GHC.Base ((.), ($))
import Functor
import Monad
import Applicative
import Either
import Trans
data ExceptT e m a = ExceptT (m (Either e a))
runExceptT :: ExceptT e m a -> m (Either e a)
runExceptT (Exc... | seckcoder/lang-learn | haskell/lambda-calculus/src/Except.hs | unlicense | 1,203 | 0 | 14 | 423 | 436 | 228 | 208 | 29 | 1 |
--{-# LANGUAGE BangPatterns #-}
--
-- Copyright : (c) T.Mishima 2014
-- License : Apache-2.0
--
module Hinecraft.Types where
version :: String
version = "0.3.0"
data ChunkParam = ChunkParam
{ blockSize :: Int
, blockNum :: Int
}
chunkParam :: ChunkParam
chunkParam = ChunkParam
{ blockSize = 16
, blockNum ... | tmishima/Hinecraft | Hinecraft/Types.hs | apache-2.0 | 2,439 | 0 | 10 | 485 | 726 | 455 | 271 | 78 | 1 |
--
-- Copyright 2017 Warlock <internalmike@gmail.com>
--
-- 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 applica... | A1-Triard/solid | test/Spec.hs | apache-2.0 | 793 | 0 | 7 | 134 | 67 | 45 | 22 | 6 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables #-}
module Language.Gamma.Parser.Commented where
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Data.Proxy
import Text.Trifecta
import Text.Parser.Token.Style
-- a way to decide comment style based on a phantom type
class... | agrif/gammac | src/Language/Gamma/Parser/Commented.hs | apache-2.0 | 1,034 | 0 | 10 | 165 | 270 | 147 | 123 | 20 | 0 |
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE BangPatterns #-}
{-|
Module : Marvin.API.Table.Column
Description : Statically and dynamically typed columns that represent machine learning attributes.
-}... | gaborhermann/marvin | src/Marvin/API/Table/Column.hs | apache-2.0 | 12,346 | 14 | 12 | 2,205 | 3,393 | 1,777 | 1,616 | 214 | 2 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
module Main (main) where
import Control.Applicative
import Control.Exception (catch)
import Control.Lens
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Trans.Resou... | supki/wybor | example/wybor-bin/src/Main.hs | bsd-2-clause | 3,223 | 0 | 18 | 767 | 1,057 | 562 | 495 | 73 | 2 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QTextCharFormat.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:35
Warning : this file is machine generated - ... | uduki/hsQt | Qtc/Enums/Gui/QTextCharFormat.hs | bsd-2-clause | 5,149 | 0 | 18 | 1,054 | 1,278 | 645 | 633 | 125 | 1 |
module Hyper.TreesExtra where
import Hyper.Canvas
import Hyper.Trees
data EditTree a = EditTree { etTree :: (ZTree a) } deriving Show
data Ord a => Heap a = Heap { hTree :: (BiTree a) } deriving Show
newHeap :: Ord a => Heap a
newHeap = Heap EmptyTree
insert :: Ord a => Bool -> a -> Heap a -> Heap a
insert b a (He... | RoboNickBot/interactive-tree-demos | src/Hyper/TreesExtra.hs | bsd-2-clause | 6,404 | 0 | 16 | 2,292 | 2,979 | 1,485 | 1,494 | 159 | 5 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE... | tlaitinen/servant-cookie-hmac-auth-example | src/Models.hs | bsd-3-clause | 1,273 | 0 | 8 | 390 | 183 | 106 | 77 | 26 | 1 |
module Kendo.Lexer where
import Control.Monad.State
import Text.Parsec hiding (State)
import Text.Parsec.Indent
import Text.Parsec.Pos (SourcePos)
import qualified Text.Parsec.Token as P
type Parser a = IndentParser String () a
reservedNames =
[ "true"
... | jetho/kendo | src/Kendo/Lexer.hs | bsd-3-clause | 2,329 | 0 | 11 | 651 | 672 | 376 | 296 | 88 | 2 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
import Prelude hiding (gcd, mod)
import Language.Haskell.Liquid.Prelude
[lq| mod :: a:Nat -> b:{v:Nat| ((v < a) && (v > 0))} -> {v:Nat | v < b} |]
mod :: Int -> Int -> Int
mod a b | a - b > b = mod (a - b) b
| a - b < b = a - b
| a - b == b = 0
[... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/GCD.hs | bsd-3-clause | 645 | 5 | 9 | 232 | 311 | 155 | 156 | 20 | 1 |
module Test
( A(..)
, B(C)
, z
, x
, y
) where
| hecrj/haskell-format | test/specs/module-export/output.hs | bsd-3-clause | 71 | 0 | 5 | 38 | 29 | 20 | 9 | 8 | 0 |
{-# LANGUAGE GADTs #-}
-- |
-- Module : Data.Array.Accelerate.Trafo.Normalise
-- Copyright : [2012] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell
-- License : BSD3
--
-- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au>
-- Stability : experimental
-- Portability : non-portable (GHC ... | robeverest/accelerate | Data/Array/Accelerate/Trafo/Normalise.hs | bsd-3-clause | 2,957 | 0 | 18 | 1,151 | 929 | 462 | 467 | 51 | 27 |
module App.Roster.RosterGeneration (generateInitialRoster, generateNextRoster, generatePreviousRoster) where
import App.Helper.Lists(splitInHalf, replaceIndex, rotate)
-- Roster generation algorthm based on:
-- https://en.wikipedia.org/wiki/Round-robin_tournament#Scheduling_algorithm
-- http://stackoverflow.com/questi... | afcastano/cafe-duty | src/App/Roster/RosterGeneration.hs | bsd-3-clause | 2,178 | 0 | 13 | 728 | 450 | 251 | 199 | 23 | 1 |
-- | 'IntPSQ' fixes the key type to 'Int'. It is generally much faster than
-- an 'OrdPSQ'.
--
-- Many operations have a worst-case complexity of O(min(n,W)). This means that
-- the operation can -- become linear in the number of elements with a maximum
-- of W -- the number of bits in an Int (32 or 64).
{-# LANGUAGE C... | bttr/psqueues | src/Data/IntPSQ.hs | bsd-3-clause | 1,314 | 0 | 5 | 405 | 147 | 104 | 43 | 37 | 0 |
{-# LANGUAGE BangPatterns #-}
module Y2017.Day10 (answer1, answer2, knotHash, showHex, toBytes) where
import GHC.Word
import qualified Numeric
import Data.List.Split (chunksOf)
import Data.Bits
import Data.Char
import qualified Data.Vector as V
import Data.Monoid
answer1 :: IO ()
answer1 =
let (_, _, v) = foldl ... | geekingfrog/advent-of-code | src/Y2017/Day10.hs | bsd-3-clause | 1,728 | 0 | 13 | 456 | 815 | 454 | 361 | 48 | 2 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, UndecidableInstances, TypeOperators #-}
module Numeric.Algebra.Class
(
-- * Multiplicative Semigroups
Multiplicative(..)
, pow1pIntegral
, product1
-- * Semirings
, Semiring
-- * Left and Right Modules
, LeftModule(..)
, Rig... | athanclark/algebra | src/Numeric/Algebra/Class.hs | bsd-3-clause | 18,022 | 2 | 22 | 4,087 | 7,842 | 4,237 | 3,605 | -1 | -1 |
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-}
{-# OPTIONS_GHC -fcontext-stack42 #-}
module Games.Chaos2010.Database.Base_relvar_key_attributes where
import Games.Chaos2010.Database.Fields
import Database.HaskellDB.DBLayout
type Base_relvar_key_attributes =
Record
(HCons (LVPair Constraint_name (E... | JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Base_relvar_key_attributes.hs | bsd-3-clause | 543 | 0 | 15 | 67 | 104 | 58 | 46 | 11 | 1 |
module PCREHeavyExampleSpec where
import PCREHeavyExample (mediaRegex)
import Test.Hspec (Spec, hspec, describe, it, shouldSatisfy)
import Text.Regex.PCRE.Heavy ((=~))
-- | Required for auto-discovery.
spec :: Spec
spec =
describePredicate "pcre-heavy"
("match", (=~ mediaRegex))
(matchExamples, nonMatchExa... | FranklinChen/twenty-four-days2015-of-hackage | test/PCREHeavyExampleSpec.hs | bsd-3-clause | 1,753 | 0 | 15 | 419 | 412 | 240 | 172 | 44 | 1 |
-- | Functions for dealing with TPFS blocks.
--
-- This is not a high level interface; it only provides a few utility functions
-- for dealing with the blocks on disk themselves. It does not deal with
-- extents or anything like that. See 'System.TPFS.Extent'.
--
-- If you are looking for a high level interface, check ... | devyn/TPFS | System/TPFS/Block.hs | bsd-3-clause | 5,217 | 0 | 14 | 1,501 | 1,050 | 545 | 505 | 76 | 1 |
-- | LYAH Chapter 2 - Starting Out
-- <http://learnyouahaskell.com/starting-out>
module Week01.Lyah02 where
doubleMe :: Num a => a -> a
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
-- double numbers smaller than 100
doubleSmallNumber x = if x > 100
then x
els... | emaphis/Haskell-Practice | cis194/src/week01/Lyah02.hs | bsd-3-clause | 810 | 0 | 11 | 216 | 454 | 249 | 205 | 14 | 2 |
module Config
( Provider(..)
, ProviderName
, RoutesName
, Route(..)
, Routes
, Config(..)
, readConfig
) where
import Control.Applicative
import Data.Monoid
import Data.List
import Data.Char (isDigit)
import Network.Socket hiding (recv, sendAll)
type ProviderName = String
type RoutesN... | vincenthz/socksmaster | Src/Config.hs | bsd-3-clause | 4,011 | 0 | 21 | 1,644 | 1,167 | 604 | 563 | 79 | 5 |
#define IncludedshiftNewIndicesLeft
#ifdef IncludedmapCastId
#else
#include "../Proofs/mapCastId.hs"
#endif
#ifdef IncludedconcatMakeIndices
#else
#include "../Proofs/concatMakeIndices.hs"
#endif
{-@ shiftNewIndicesLeft
:: xi:RString
-> yi:RString
-> zi:RString
-> tg:{RString | stringLen tg <= stri... | nikivazou/verified_string_matching | src/Proofs/shiftNewIndicesLeft.hs | bsd-3-clause | 1,614 | 6 | 17 | 448 | 512 | 260 | 252 | 26 | 1 |
module Chapter3 where
hello :: IO ()
hello = putStrLn "hello"
helloThere :: IO ()
helloThere = putStrLn s
where s = "hello "++"there"
helloThere' :: IO ()
helloThere' = let s = "hello "++"there"
in putStrLn s
-- helloThere'' :: IO ()
-- helloThere'' = do
-- putStrLn "hello "++"there"
-- where unused = 1+1
... | peterbecich/haskell-programming-first-principles | src/Chapter3.hs | bsd-3-clause | 429 | 0 | 9 | 92 | 134 | 72 | 62 | 13 | 1 |
module Code16 where
import Data.Array (accumArray,(!))
import Data.List (inits,isSuffixOf,isPrefixOf)
import Code15
matches0 :: Eq a => [a] -> [a] -> [Int]
matches0 ws = map length . filter (endswith0 ws) . inits
endswith0 :: Eq a => [a] -> [a] -> Bool
endswith0 = isSuffixOf
{- scan lemma
map (foldl op e)... | sampou-org/pfad | Code/Code16.hs | bsd-3-clause | 1,463 | 0 | 13 | 441 | 834 | 447 | 387 | 39 | 4 |
module Main where
import Test.Bakers12.System.Enumerators
import Test.Bakers12.Tokenizer
import Test.Bakers12.Tokenizer.Minimal
import Test.Bakers12.Tokenizer.PennTreebank
import Test.Framework (Test, defaultMain, testGroup)
main :: IO ()
main = defaultMain tests
tests :: [Test]
tests =
[ testGroup "tokenizer"... | erochest/bakers12 | tests/TestBakers12.hs | bsd-3-clause | 504 | 0 | 6 | 74 | 110 | 65 | 45 | 14 | 1 |
module Turbinado.Database.ORM.Generator (
generateModels
) where
import Control.Monad
import Data.List
import qualified Data.Map as M
import Data.Maybe
import Database.HDBC
import Config.Database
import Turbinado.Database.ORM.Types
import Turbinado.Database.ORM.Output
import Turbinado.Database.ORM.Post... | abuiles/turbinado-blog | Turbinado/Database/ORM/Generator.hs | bsd-3-clause | 2,259 | 0 | 13 | 713 | 666 | 363 | 303 | 41 | 1 |
module Azure.Storage.Protocol.HttpHelpers
( httpRequest
) where
import Control.Monad (unless)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Reader.Class (MonadReader)
import Control.Monad.Trans.Resource (MonadResource)
import Data.ByteStr... | Porges/azure-storage-haskell | src/Azure/Storage/Protocol/HttpHelpers.hs | bsd-3-clause | 887 | 0 | 16 | 241 | 241 | 136 | 105 | 21 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger
( mkRequestLogger, ou... | pirapira/hashprice | Application.hs | bsd-3-clause | 3,705 | 0 | 13 | 734 | 640 | 354 | 286 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : YARN.Client_r2_7_3
-- Copyright : (c) Stanislav Chernichkin 2017
-- License : BSD3
--
-- Maintainer : schernichkin@gmail.com
-- Stability : experimental
-- Portability : ... | schernichkin/yarn-client | src/YARN/Client_r2_7_3.hs | bsd-3-clause | 30,302 | 0 | 53 | 9,601 | 3,873 | 2,168 | 1,705 | 395 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Util.Minimize
-- Description : Common utilities for window minimizing\/maximizing.
-- Copyright : (c) Bogdan Sinitsyn (2016)
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : bogdan.sinitsyn@gma... | xmonad/xmonad-contrib | XMonad/Util/Minimize.hs | bsd-3-clause | 1,082 | 0 | 9 | 225 | 148 | 96 | 52 | 15 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{- |
Module : Control.Arrow.C... | tomberek/rulestesting | src/Control/Arrow/CCA/NoQ.hs | bsd-3-clause | 3,457 | 0 | 13 | 893 | 1,023 | 547 | 476 | 67 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module Bench where
import Control.Applicative ((<$>))
import Control.Concurrent (threadDelay)
import Control.Monad (void,forever)
import Data.Maybe
import Data.Serialize
import qualified Data.Text as T
import Data.Traversable (traverse)
import SimpleS... | plow-technologies/simple-cell | bench/Bench.hs | bsd-3-clause | 1,351 | 0 | 18 | 267 | 407 | 208 | 199 | 36 | 1 |
module CRF.Model.Internal
( Model
, fromList
, toList
--, Student (..)
, makeModel
--, makeStudent
-- , showModel
-- , readModel
, modelSize
, onOFeat
, onTFeat
, featToIx
, consumeWith
, mapModel
, mapModel'
-- , updateWithNumbers
--, gradientInternal
--, applyGradients
) where
import Data.Maybe (fromJust)
import Con... | kawu/tagger | src/CRF/Model/Internal.hs | bsd-3-clause | 8,088 | 0 | 17 | 2,538 | 2,797 | 1,512 | 1,285 | 192 | 3 |
-- Copyright 2013 Thomas Szczarkowski
module Ciphers where
import Data.Bits
import Data.Word
import Data.List
import Text.Printf
import Control.Monad
import Control.Arrow
import Control.Exception
import OpenSSL.Symmetric
import OpenSSL.Random
import Bytes
-- OpenSSL block ciphers (128 bit only)
-- Hacked from Open... | tom-szczarkowski/matasano-crypto-puzzles-solutions | set6/Ciphers.hs | mit | 2,501 | 0 | 11 | 604 | 822 | 412 | 410 | 53 | 2 |
{-# LANGUAGE ExistentialQuantification #-}
module Zeno (
Bool (..), Equals (..), Prop,
prove, proveBool, given, givenBool,
($), otherwise
) where
import Prelude ( Bool (..) )
infix 1 :=:
infixr 0 $
($) :: (a -> b) -> a -> b
f $ x = f x
otherwise :: Bool
otherwise = True
data Equals
= forall a . (:=:) a a
... | Gurmeet-Singh/Zeno | test/Zeno.hs | mit | 584 | 17 | 8 | 138 | 241 | 138 | 103 | 25 | 1 |
{- |
Module : ./Propositional/Conversions.hs
Description : Helper functions for proofs in propositional logic
Copyright : (c) Dominik Luecke, Uni Bremen 2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : experimental
Portability : portable
Hel... | spechub/Hets | Propositional/Conversions.hs | gpl-2.0 | 4,084 | 0 | 17 | 1,186 | 967 | 507 | 460 | 78 | 4 |
{-# LANGUAGE ExistentialQuantification #-}
module TestRunner(main) where
import System.Environment (getArgs)
import Control.Arrow ((>>>))
import Test
import Test.QuickCheck
import RewriteRules
import Bag
data Test = forall a. (Testable a) => Test String String a
tests :: [Test]
tests = [
Test "Simplify" "Idemp... | jff/TeLLer | tests/TestRunner.hs | gpl-3.0 | 1,266 | 0 | 14 | 276 | 358 | 190 | 168 | 37 | 2 |
import GHC.Unicode
import Data.Ix ( index )
main :: IO ()
main = do
putStrLn "\xFFFF"
putStrLn "\x10000"
putStrLn "\x1F600"
putStrLn "\x10FFFF"
putStrLn "7"
putStrLn "S"
putStrLn "△"
putStrLn "☃"
putStrLn "¥"
putStrLn "n̂"
print $ UppercaseLetter == UppercaseLetter
print $ UppercaseLetter == Lo... | rahulmutt/ghcvm | tests/suite/basic/run/Unicode.hs | bsd-3-clause | 1,166 | 0 | 9 | 230 | 393 | 165 | 228 | 42 | 1 |
module PTS.Syntax
( -- * Abstract syntax
-- ** Names
Name
, Names
, freshvarl
, LanguageName
, ModuleName (..)
, parts
-- ** Constants
, C (C)
, int
, star
, box
, triangle
, circle
-- ** Arithmetic operators
, BinOp (Add, Sub, Mul, Div)
, evalOp
-- ** Term structure
, ... | Toxaris/pts | src-lib/PTS/Syntax.hs | bsd-3-clause | 1,662 | 0 | 5 | 446 | 340 | 237 | 103 | 90 | 0 |
-- | Provides the configurable prototype implementation of the supermonad
-- plugin. This can essentially be used with any type classes when configured
-- correctly.
module Control.Super.Plugin.Prototype
( pluginPrototype
) where
import Data.Maybe ( isJust, isNothing, fromJust, catMaybes )
import Data.Foldab... | jbracker/supermonad-plugin | src/Control/Super/Plugin/Prototype.hs | bsd-3-clause | 5,841 | 0 | 27 | 1,541 | 1,017 | 562 | 455 | 89 | 6 |
{-|
Module : IRTS.Portable
Description : Serialise Idris' IR to JSON.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE FlexibleInstances, OverloadedStrings, TypeSynonymInstances #-}
module IRTS.Portable (writePortable) where
import Idris.Core.CaseTree
import Idris.Core.Evaluate
... | Heather/Idris-dev | src/IRTS/Portable.hs | bsd-3-clause | 15,562 | 0 | 12 | 3,862 | 6,857 | 3,561 | 3,296 | 309 | 1 |
module WASHExpression where
import Monad
import WASHFlags
import qualified WASHUtil
import WASHData
import WASHOut
code :: FLAGS -> [CodeFrag] -> ShowS
code flags [] = id
code flags (x:xs) = code' flags x . code flags xs
code' :: FLAGS -> CodeFrag -> ShowS
code' flags (HFrag h) =
showString h
code' flags (EFrag ... | dcreager/cabal | tests/systemTests/wash2hs/hs/WASHExpression.hs | bsd-3-clause | 3,844 | 20 | 17 | 1,009 | 1,611 | 767 | 844 | 141 | 5 |
{-# LANGUAGE MagicHash, NoImplicitPrelude, TypeFamilies, UnboxedTuples,
MultiParamTypeClasses, RoleAnnotations #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Types
-- Copyright : (c) The University of Glasgow 2009
-- License : see librar... | urbanslug/ghc | libraries/ghc-prim/GHC/Types.hs | bsd-3-clause | 9,206 | 3 | 10 | 1,933 | 464 | 344 | 120 | -1 | -1 |
foldM_ f a xs = foldM f a xs >> return () | mpickering/hlint-refactor | tests/examples/Monad17.hs | bsd-3-clause | 41 | 0 | 7 | 11 | 31 | 13 | 18 | 1 | 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="hr-HR">
<title>Front-End Scanner | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<m... | thc202/zap-extensions | addOns/frontendscanner/src/main/javahelp/org/zaproxy/zap/extension/frontendscanner/resources/help_hr_HR/helpset_hr_HR.hs | apache-2.0 | 978 | 88 | 29 | 159 | 402 | 214 | 188 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Magic
... | ezyang/ghc | libraries/ghc-prim/GHC/Magic.hs | bsd-3-clause | 4,637 | 0 | 9 | 855 | 308 | 216 | 92 | -1 | -1 |
module UnitTests.Distribution.Client.Dependency.Modular.PSQ (
tests
) where
import Distribution.Client.Dependency.Modular.PSQ
import Test.Framework as TF (Test)
import Test.Framework.Providers.QuickCheck2
tests :: [TF.Test]
tests = [ testProperty "splitsAltImplementation" splitsTest
]
-- | Original spli... | DavidAlphaFox/ghc | libraries/Cabal/cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs | bsd-3-clause | 594 | 0 | 14 | 113 | 233 | 132 | 101 | 14 | 1 |
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses, DeriveDataTypeable #-}
{-# LANGUAGE PatternGuards, FlexibleContexts, FlexibleInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.BoringWindows
-- Copyright : (c) 2008 David Roundy <... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Layout/BoringWindows.hs | bsd-2-clause | 6,431 | 0 | 17 | 2,008 | 1,351 | 731 | 620 | 87 | 1 |
module T5884Other where
data Pair a = Pair a a
| urbanslug/ghc | testsuite/tests/generics/T5884Other.hs | bsd-3-clause | 48 | 0 | 6 | 11 | 16 | 10 | 6 | 2 | 0 |
{-# LANGUAGE DataKinds #-}
module Main where
import Control.Lens
import Data.Monoid
import System.Environment
import System.IO
import qualified Text.PrettyPrint.ANSI.Leijen as Ppr
import qualified Text.Trifecta as P
import Formura.Interpreter.Eval
import qualified For... | nushio3/formura | exe-src/formura-eval.hs | mit | 1,059 | 0 | 15 | 273 | 374 | 185 | 189 | 32 | 2 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.StringCallback
(newStringCallback, newStringCallbackSync, newStringCallbackAsync,
StringCallback)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, mayb... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/JSFFI/Generated/StringCallback.hs | mit | 2,240 | 0 | 12 | 441 | 548 | 325 | 223 | 42 | 1 |
module Jaml.Parser.Tag
( tag
) where
import Text.ParserCombinators.Parsec
import Control.Monad (liftM)
import Data.List (partition)
import Jaml.Types
import Jaml.Parser.Util (optSpaces, identifier)
import Jaml.Parser.Attribute (cssSelector, attrs)
tag :: Parser Node
tag =
do n <- try name <|> return "div"
... | marklar/jaml | Jaml/Parser/Tag.hs | mit | 2,201 | 0 | 12 | 573 | 709 | 362 | 347 | -1 | -1 |
module Mycont_01 where
import Control.Monad.Cont
fact :: Int -> Cont r Int
-- Your own code:
-- Cont ($ (fact 0)) = return 1
fact 0 = return 1
-- Cont ($ (fact n)) = Cont ($ (fact (n-1))) >>= (\x -> Cont ($ (n*x)))
fact n = fact (n-1) >>= \x -> return (n*x)
-- the "real" factorial function, withou... | Muzietto/transformerz | haskell/cont/mycont.hs | mit | 390 | 0 | 9 | 99 | 104 | 56 | 48 | 7 | 1 |
module Redirect where
import Network.HTTP.Types
import Network.Wai
import Servant.Server.Internal
import Servant.API
import Servant.Server
import Protolude
-- TODO: use responseServantErr
data IndexRedirect
instance HasServer IndexRedirect config where
t... | mreider/kinda-might-work | src/Redirect.hs | mit | 660 | 0 | 11 | 255 | 134 | 73 | 61 | -1 | -1 |
module Budget.Debt where
import Budget (Person,BudgetRecord,Budget,brOwners,brPurchaser,brAmount)
import Data.List (nub)
data DebtRecord = DebtRecord {
drCreditor :: Person
, drDebtor :: Person
, drAmount :: Double
} deriving (Show,Eq)
type Debt = [DebtRecord]
-- | Analyze debt from budget report
debt :: B... | pmlt/budget | src/Budget/Debt.hs | mit | 1,951 | 0 | 12 | 519 | 793 | 417 | 376 | 44 | 1 |
module LuciansLusciousLasagna (elapsedTimeInMinutes, expectedMinutesInOven, preparationTimeInMinutes) where
-- TODO: define the expectedMinutesInOven constant
-- TODO: define the preparationTimeInMinutes function
-- TODO: define the elapsedTimeInMinutes function
| exercism/xhaskell | exercises/concept/lucians-luscious-lasagna/src/LuciansLusciousLasagna.hs | mit | 266 | 0 | 4 | 27 | 18 | 13 | 5 | 1 | 0 |
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
-- | Reexports "Data.List.NonEmpty.Compat"
-- from a globally unique namespace.
module Data.List.NonEmpty.Compat.Repl (
module Data.List.NonEmpty.Compat
) where
import "this" Data.List.NonEmpty.Compat
| haskell-compat/base-compat | base-compat/src/Data/List/NonEmpty/Compat/Repl.hs | mit | 304 | 0 | 5 | 31 | 31 | 24 | 7 | 5 | 0 |
{-# LANGUAGE DataKinds, FlexibleContexts, FlexibleInstances, GADTs, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeOperators, UndecidableInstances #-}
module Data.Nested.List (module Data.Nested.List, module Data.Nested.Functor) where
import qualified Data.Function as F
import qualified Data.List as L
... | filonik/nfunctors | src/Data/Nested/List.hs | mit | 1,546 | 0 | 12 | 287 | 751 | 406 | 345 | 26 | 1 |
import Data.Ord
import Data.List
type Name = String
type Size = Int
type Item = (Name,Size)
type Bin = (Name,Size,[Item])
-- CONTRACT
--pack :: [Item] -> [Bin] -> [Bin]
-- PURPOSE
-- Given a set of empty bins with fixed sizes and a set of items, return (one of the)
-- optimal solution(s) where the least space is w... | frickler01/pack | pack.hs | mit | 5,704 | 26 | 12 | 1,148 | 1,190 | 652 | 538 | 78 | 1 |
module TetrisAttack.Board.Types where
--------------------------------------------------------------------------------
import TetrisAttack.Tile
import TetrisAttack.Grid
--------------------------------------------------------------------------------
type Board a = Grid2D (TileLogic a)
type BoardState = Grid2D Tile
b... | Mokosha/HsTetrisAttack | TetrisAttack/Board/Types.hs | mit | 534 | 0 | 9 | 69 | 112 | 60 | 52 | 10 | 2 |
import System.MIDI
import System.IO
import System.Process
import Control.Monad
import Control.Concurrent
import Safe
comment :: String -> IO ()
comment s = hPutStrLn stderr ( "# " ++ s )
main :: IO ()
main = do
hSetBuffering stdout LineBuffering
sources <- enumerateSources
names <- mapM getName sources
comm... | sordina/ScriptMidi | src/scriptMidi.hs | mit | 3,700 | 0 | 13 | 1,236 | 1,408 | 675 | 733 | 83 | 1 |
module HunitTest (module HunitTest) where
import Test.HUnit
import HspInterpreter
import Phonemizer
import Soundgluer
htest :: IO ()
htest = do
phones1 <- (phonemize "pol" "przewięźlikowski")
phones2 <- (phonemize "pol" "Litwo, ojczyzno moja, ty jesteś jak zdrowie")
phones3 <- (phonemize "pol" "Jeżu kląt... | mprzewie/haspell | test/HunitTest.hs | mit | 3,006 | 0 | 13 | 790 | 909 | 512 | 397 | 41 | 1 |
{-# LANGUAGE CPP, OverloadedStrings, BangPatterns #-}
#define COLON 58
#define SPACE 32
#define TAB 9
#define A_UPPER 65
#define A_LOWER 97
#define Z_UPPER 90
#define Z_LOWER 122
#define ZERO 48
#define NINE 57
#define PERIOD 46
#define UNDERSCORE 95
module Data.Array.Repa.Distributed.Config where
import Data.Atto... | jroesch/dda | src/Data/Array/Repa/Distributed/Config.hs | mit | 1,867 | 1 | 12 | 398 | 628 | 332 | 296 | 54 | 1 |
module SModel (module SModel,
module SModel.Nucleotides,
module SModel.Doublets,
module SModel.Codons,
module SModel.ReversibleMarkov,
module SModel.Likelihood,
frequencies_from_dict) where
import Probability
import Bio.Alphabet
i... | bredelings/BAli-Phy | haskell/SModel.hs | gpl-2.0 | 19,342 | 0 | 13 | 4,092 | 4,659 | 2,378 | 2,281 | -1 | -1 |
module ParserSpec (spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import qualified Test.QuickCheck.Property as QP
import Control.Monad
import Language.Inference.Syntax
import Language.Inference.Parser
import Language.Inference.Pretty
import Text.PrettyPrint (render)
import Arbitrary
... | robertclancy/tapl | inference/tests/ParserSpec.hs | gpl-2.0 | 621 | 0 | 23 | 137 | 180 | 101 | 79 | 17 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Network.HTTP.Types
import Network.Wai
import Network.Wai.Handler.Warp
main :: IO ()
main = do
putStrLn "Server running at http://127.0.0.1:9000"
run 9000 app
app :: Application
app _req respond = respond $ responseLBS status200 headers body
where
headers = [ ("Con... | yamadapc/simple-warp-server | bin/Main.hs | gpl-2.0 | 370 | 0 | 8 | 65 | 96 | 52 | 44 | 12 | 1 |
module X86 where
import Data.Int (Int64(..))
-- this represents the level of indirection of a value
data I a = Concrete a | Pointer a deriving (Eq, Show)
data Register = RAX | RBX | RCX | RDX
| RSI | RDI | RSP | RBP
| R8 | R9 | R10 | R11
| R12 | R13 | R14 | R15
... | orchid-hybrid/WHILE | X86.hs | gpl-2.0 | 1,037 | 0 | 8 | 507 | 260 | 154 | 106 | 28 | 0 |
{-# LANGUAGE Rank2Types, OverloadedStrings, DeriveGeneric, TemplateHaskell, GeneralizedNewtypeDeriving #-}
module Lamdu.Data.Anchors
( Code(..), onCode
, Revision(..), onRevision
, Pane, makePane
, CodeProps, RevisionProps
, assocNameRef
, assocScopeRef
, PresentationMode(..)
, assocPres... | da-x/lamdu | Lamdu/Data/Anchors.hs | gpl-3.0 | 3,251 | 0 | 13 | 710 | 1,117 | 617 | 500 | 79 | 1 |
{---------------------------------------------------------------------}
{- Copyright 2015, 2016 Nathan Bloomfield -}
{- -}
{- This file is part of Feivel. -}
{- ... | nbloomf/feivel | src/Feivel/Parse/ParseM.hs | gpl-3.0 | 4,996 | 0 | 13 | 1,410 | 1,449 | 749 | 700 | 119 | 3 |
module Language.Mulang.Inspector.Query (
inspect,
select,
selectCount,
Query) where
import Control.Monad (guard)
import Language.Mulang.Ast (Expression)
type Query a = [a]
inspect :: Query () -> Bool
inspect = not.null
select :: Bool -> Query ()
select = guard
selectCount :: (Int -> Bool) -> Query Express... | mumuki/mulang | src/Language/Mulang/Inspector/Query.hs | gpl-3.0 | 400 | 0 | 8 | 72 | 145 | 82 | 63 | 14 | 1 |
{-|
Module : Css.Constants
Description : Defines the constants for the other CSS modules.
-}
module Css.Constants
(margin0,
padding0,
width100,
height100,
-- * Node and Rectangle Constants
fill,
stroke,
alignCenter,
wideStroke,
faded,
semiVisible,
... | hermish/courseography | app/Css/Constants.hs | gpl-3.0 | 10,781 | 0 | 9 | 2,310 | 1,578 | 943 | 635 | 254 | 1 |
module Neural (
NNet,
Layer,
feedforward,
backprop,
backpropSome,
randomNNet
) where
import Data.Array.Unboxed
import Data.List
import Control.DeepSeq
import Control.Parallel.Strategies
import System.Random
newtype Layer = Layer (UArray (Int,Int) Double) deriving (Eq)
type NNet = [Layer]
instance Read L... | quickdudley/varroa | Neural.hs | agpl-3.0 | 3,535 | 0 | 20 | 1,019 | 1,521 | 828 | 693 | 76 | 3 |
module PprDFG where
import DFG
import Outputable
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
instance Outputable Graph where
ppr g = hang head 2 (outputs $$ signals $$ nodes)
where head = text "graph" <+> text (graphName g)
outputs = text "outputs:" <+> (vc... | yjwen/hada | src/PprDFG.hs | lgpl-3.0 | 1,517 | 0 | 18 | 459 | 549 | 268 | 281 | 30 | 2 |
module RandomGeneration where
import Types
import System.Random (randomRIO)
randomElement :: [a] -> IO a
randomElement [] = fail "randomElement: empty list"
randomElement [x] = return x
randomElement xs = (xs !!) `fmap` randomRIO (0, length xs - 1)
-- Implementations for GenerationBia... | mgmeier/MazeGenerator | RandomGeneration.hs | unlicense | 1,411 | 0 | 13 | 405 | 439 | 236 | 203 | 26 | 2 |
main = do
let a = [1,2,3,4]
print (a !! 0)
print (head a)
let b = [1,2,4,4]
print (a > b)
let a = [2,1,1,1]
print (a > b)
print (tail a)
print (init a)
| Trickness/pl_learning | Haskell/list/list_simple.hs | unlicense | 232 | 0 | 10 | 116 | 144 | 72 | 72 | 10 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.