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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-|
Directory tree database.
Directory database of B+ tree: huge DBM with order.
* Persistence: /persistent/
* Algorithm: /B+ tree/
* Complexity: /O(log n)/
* Sequence: /custom order/
* Lock unit: /page (rwlock)/
-}
module Database.KyotoCabinet.DB.Forest
( Forest
, ForestOptions (..)
, defaul... | bitonic/kyotocabinet | Database/KyotoCabinet/DB/Forest.hs | bsd-3-clause | 3,570 | 0 | 15 | 1,679 | 639 | 362 | 277 | 64 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module CANOpen.Tower.NMT where
import Ivory.Language
import Ivory.Stdlib
import Ivory.Tower
import Ivory.Tower.HAL.Bus.CAN
import Ivory.Tower.HAL.Bus.Interface
import Ivory.Tower.HAL.Bus.CAN.Fragment
import Ivory.Ser... | distrap/ivory-tower-canopen | src/CANOpen/Tower/NMT.hs | bsd-3-clause | 5,043 | 0 | 30 | 1,472 | 1,382 | 660 | 722 | 119 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module Advent.Day6 where
import qualified Data.Text as T
import Text.Parsec as Parsec (many1
, char
, newline
, sepEndBy
, try
, string
... | screamish/adventofhaskellcode | src/Advent/Day6.hs | bsd-3-clause | 3,203 | 0 | 13 | 964 | 1,060 | 576 | 484 | 78 | 1 |
module LetLang.ParserSuite
( tests
) where
import LetLang.Data
import LetLang.Parser
import Test.HUnit.Base
import Text.Megaparsec
import Text.Megaparsec.String
tests :: Test
tests = TestList
[ TestLabel "Test const expression" testConstExpr
, TestLabel "Test bina... | li-zhirui/EoplLangs | test/LetLang/ParserSuite.hs | bsd-3-clause | 5,455 | 0 | 16 | 1,656 | 1,392 | 723 | 669 | 129 | 2 |
module Wikirick.JSONConnection where
import Control.Exception hiding (Handler)
import Data.Aeson
import Data.Typeable
import Snap
data JSONParseError = JSONParseError String deriving (Eq, Show, Typeable)
instance Exception JSONParseError
data JSONConnection = JSONConnection
{ _parseJSON :: (MonadSnap m, FromJSON a... | keitax/wikirick | src/Wikirick/JSONConnection.hs | bsd-3-clause | 638 | 0 | 12 | 106 | 223 | 120 | 103 | -1 | -1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
module Juno.Consensus.Handle.AppendEntriesResponse
(handle
,handleAlotOfAers
,updateCommitProofMap)
where
import Control.Lens hiding (Index)
import C... | haroldcarr/juno | src/Juno/Consensus/Handle/AppendEntriesResponse.hs | bsd-3-clause | 6,373 | 0 | 16 | 1,381 | 1,584 | 836 | 748 | 127 | 11 |
-- | The Finite Module which exports Finite
----------------------------------------------------------------
module Finite (Finite(..), (*^), (*^-), sigfigs, orderOfMagnitude, showNatural, showFull, showScientific, roundToPrecision, fromIntegerWithPrecision, fromIntegerMatchingPrecision) where
-----------------------... | Conflagrationator/HMath | src/Finite.hs | bsd-3-clause | 6,948 | 0 | 14 | 1,363 | 1,798 | 973 | 825 | 76 | 2 |
-- for TokParsing, MonadicParsing
{-# LANGUAGE ConstraintKinds #-}
-- for impOrExpVar
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
-- ghc opts / calm down ghc-mod
-- {-# OPTIONS_GHC -Wall #-}
-- {-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- {-# OPT... | reuleaux/pire | src/Pire/Parser/Nat.hs | bsd-3-clause | 2,865 | 0 | 11 | 726 | 232 | 141 | 91 | 26 | 1 |
module Main where
--gcd :: Int -> Int -> Int
--gcd x 0 = x
--gcd x y
-- | x < y = gcd y x
-- | otherwise = gcd y (mod x y)
--lcm :: Int -> Int -> Int
--lcm x y = let g = gcd (x y)
-- in (div x g) * (div y g) * g
splitBy delimiter = foldr f [[]]
where f c l@(x:xs) | c == delimiter = []:l
... | everyevery/programming_study | hackerrank/functional/jumping-bunnies/jumping-bunnies.hs | mit | 548 | 0 | 13 | 195 | 176 | 92 | 84 | 12 | 1 |
{-# LANGUAGE OverloadedStrings, ExistentialQuantification, ExtendedDefaultRules, FlexibleContexts, TemplateHaskell #-}
module Dashdo.Examples.GapminderScatterplot where
import Numeric.Datasets
import Numeric.Datasets.Gapminder
import Dashdo
import Dashdo.Types
import Dashdo.Serve
import Dashdo.Elements
import Lucid
i... | diffusionkinetics/open | dashdo-examples/lib/Dashdo/Examples/GapminderScatterplot.hs | mit | 5,579 | 0 | 24 | 1,514 | 1,789 | 937 | 852 | 148 | 3 |
module Main where
import Carnap.GHCJS.Action.Translate
main :: IO ()
main = translateAction
| gleachkr/Carnap | Carnap-GHCJS/Translate/Main.hs | gpl-3.0 | 94 | 0 | 6 | 14 | 26 | 16 | 10 | 4 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Data.Shebang (
-- * Decoding
decode
, decodeEither
-- * Smoke tests
, hasShebang
-- * Reading
, readFirstLine
-- * Core types
, Shebang(..)
, Interpretter(..)
, Argument(..)
) where
import Data.Attoparsec.ByteString.Lazy
import qualified Data... | filib/codeclimate-shellcheck | src/Data/Shebang.hs | gpl-3.0 | 3,027 | 0 | 15 | 475 | 555 | 309 | 246 | 47 | 2 |
{-# LANGUAGE PatternSynonyms #-}
module Foo(A(.., B)) where
data A = A | B
| mpickering/ghc-exactprint | tests/examples/ghc8/export-syntax.hs | bsd-3-clause | 76 | 2 | 6 | 15 | 26 | 17 | 9 | 3 | 0 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Plots.CmdLine where
-- ( module Plots
-- , r2AxisMain
-- ) where
-- import Data.Typeable
-- import Options.Appl... | bergey/plots | src/Plots/CmdLine.hs | bsd-3-clause | 1,379 | 0 | 3 | 330 | 43 | 41 | 2 | 6 | 0 |
f [] a = return a ; f (x:xs) a = a + x >>= \fax -> f xs fax | mpickering/hlint-refactor | tests/examples/ListRec4.hs | bsd-3-clause | 59 | 0 | 7 | 19 | 52 | 26 | 26 | 1 | 1 |
{-# LANGUAGE TypeFamilies, NoMonomorphismRestriction #-}
module T2767a where
import Data.Kind (Type)
main = return ()
-- eval' :: Solver solver => Tree solver a -> [(Label solver,Tree solver a)] -> solver [a]
eval' (NewVar f) wl = do v <- newvarSM
eval' (f v) wl
eval' Fail wl = contin... | sdiehl/ghc | testsuite/tests/indexed-types/should_compile/T2767.hs | bsd-3-clause | 791 | 0 | 9 | 275 | 202 | 105 | 97 | -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="fil-PH">
<title>Getting started Guide</title>
<maps>
<homeID>top</homeID>
<mapref loca... | ccgreen13/zap-extensions | src/org/zaproxy/zap/extension/gettingStarted/resources/help_fil_PH/helpset_fil_PH.hs | apache-2.0 | 968 | 91 | 29 | 158 | 393 | 211 | 182 | -1 | -1 |
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
module YesodCoreTest.ErrorHandling
( errorHandlingTest
, Widget
) where
import Yesod.Core
import Test.Hspec
import Network.Wai
import Netwo... | pikajude/yesod | yesod-core/test/YesodCoreTest/ErrorHandling.hs | mit | 7,179 | 0 | 18 | 1,445 | 1,713 | 862 | 851 | 157 | 2 |
{-# LANGUAGE MagicHash, UnliftedFFITypes #-}
-- !!! cc004 -- foreign declarations
module ShouldCompile where
import Foreign
import GHC.Exts
import Data.Int
import Data.Word
-- importing functions
-- We can't import the same function using both stdcall and ccall
-- calling conventions in the same file when compiling ... | hferreiro/replay | testsuite/tests/ffi/should_compile/cc004.hs | bsd-3-clause | 1,861 | 42 | 10 | 484 | 477 | 257 | 220 | 49 | 0 |
{-# LANGUAGE RoleAnnotations #-}
{-# OPTIONS_GHC -fwarn-unused-imports #-}
import Data.Coerce
import Data.Proxy
import Data.Monoid (First(First)) -- check whether the implicit use of First is noted
-- see https://ghc.haskell.org/trac/ghc/wiki/Design/NewCoercibleSolver/V2
foo1 :: f a -> f a
foo1 = coerce
newtype X ... | urbanslug/ghc | testsuite/tests/typecheck/should_compile/TcCoercibleCompile.hs | bsd-3-clause | 896 | 0 | 9 | 198 | 327 | 183 | 144 | 31 | 1 |
-- !!! Importing Tycon with bogus constructor
module M where
import Prelude(Either(Left,Right,Foo))
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/module/mod81.hs | bsd-3-clause | 101 | 0 | 6 | 13 | 21 | 16 | 5 | 2 | 0 |
main :: IO ()
main = do
putStrLn "Escriba un nombre: "
nombre <- getLine
case nombre of "Napoleon" -> putStrLn "Su apellido es Bonaparte!"
_ -> putStrLn "No se ha podido determinar su apellido"
| clinoge/primer-semestre-udone | src/04-condicionales/nombre.hs | mit | 231 | 1 | 10 | 72 | 53 | 24 | 29 | -1 | -1 |
module Bio.Utils.Misc
( readInt
, readDouble
, bins
, binBySize
, binBySizeLeft
, binBySizeOverlap
) where
import Data.ByteString.Char8 (ByteString)
import Data.ByteString.Lex.Fractional (readExponential, readSigned)
import Data.ByteString.Lex.Integral... | kaizhang/bioinformatics-toolkit | bioinformatics-toolkit/src/Bio/Utils/Misc.hs | mit | 2,028 | 0 | 12 | 526 | 598 | 328 | 270 | 39 | 1 |
module Bot
( Event (..)
, Response (..)
, handleEvent
) where
import Data.List
import Data.List.Split
import Data.Char (toLower)
import Network.HTTP.Base (urlEncode)
data Event = Msg { msg :: String
, sender :: String }
data Response = SendMsg { msgToSend :: String }
-- ... | TheCrafter/Scarybot | src/Bot.hs | mit | 2,215 | 0 | 15 | 618 | 627 | 340 | 287 | 48 | 4 |
{-# LANGUAGE TupleSections #-}
module System where
import System.Directory
import System.FilePath
import Aws
import Control.Monad
import Data.Text (Text)
-- | Loads the aws creds by keyname from the currenty directory or parent
-- directories.
loadAwsCreds :: Text -> IO (Maybe (FilePath, Credentials))
loadAwsCreds ke... | schell/dropdox | src/System.hs | mit | 1,193 | 0 | 13 | 280 | 306 | 160 | 146 | 28 | 3 |
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative ((<$>))
import Data.List (intercalate,sortBy)
import Text.Blaze.Html (toHtml,toValue, (!))
import Text.Blaze.Html.Renderer.String (renderHtml)
import qualified Text.Blaze.Html5 as BlazeHtml
import qualified Text.Blaze.Html5.Attributes as BlazeAttr
import Dat... | WarwickMasson/wmasson-hakyll | site.hs | mit | 6,246 | 0 | 20 | 1,735 | 1,376 | 673 | 703 | 129 | 1 |
{-# LANGUAGE GADTs #-}
module Kafkaesque.Request.Offsets
( offsetsRequestV0
, respondToRequestV0
) where
import Data.Attoparsec.ByteString (Parser)
import Data.Int (Int32, Int64)
import Data.Maybe (catMaybes, fromMaybe)
import qualified Data.Pool as Pool
import qualified Database.PostgreSQL.Simple as PG
import... | cjlarose/kafkaesque | src/Kafkaesque/Request/Offsets.hs | mit | 3,819 | 0 | 17 | 637 | 925 | 493 | 432 | 91 | 3 |
import System.Environment
import System.IO
import Data.List
import Data.Ord
import qualified Data.Map as M
import System.Process
splitOn :: (a -> Bool) -> [a] -> [[a]]
splitOn f [] = [[]]
splitOn f (h:t) = let (rh:rt) = splitOn f t
ret = (h:rh):rt in
if f h then []:ret else ret
... | mjrosenb/bend | bend.hs | mit | 1,680 | 0 | 17 | 493 | 625 | 313 | 312 | 33 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Text.Marquee.Parser.Block (parseBlocks) where
import Control.Applicative
import Control.Monad
import Control.Monad.State (StateT(..), get, modify, lift)
import Data.Char (isLetter, isUpper)
import Data.Text (Text())
import qualified Data.Text as T
import Data.Attoparsec.Tex... | DanielRS/marquee | src/Text/Marquee/Parser/Block.hs | mit | 5,830 | 1 | 19 | 1,314 | 1,955 | 979 | 976 | 145 | 2 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.RTCDTMFSender
(js_insertDTMF, insertDTMF, js_getCanInsertDTMF, getCanInsertDTMF,
js_getTrack, getTrack, js_getToneBuffer, getToneBuffer,
js_getDuration, getDuration, js_getInterToneGap, getI... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/RTCDTMFSender.hs | mit | 3,788 | 42 | 10 | 504 | 814 | 469 | 345 | 53 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Main where
import Control.Applicative
import Control.Monad
import Control.Concurrent.STM
import Data.Hashable
import Data.Function (on)
import qualified Data.Map as M
import qualified Data.List as L
import qualified Control.Concurrent.STM.Map as TTrie
import Test.Qui... | mcschroeder/ttrie | tests/MapProperties.hs | mit | 3,168 | 0 | 14 | 797 | 1,035 | 559 | 476 | 63 | 1 |
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
import System.Environment
import Data.Text
import Control.Monad
import qualified Data.ByteString as BS (writeFile, readFile)
import qualified Codec.Compression.Zlib as ZL
import qualified Data.Text.Encoding as TE
import Data.Serialize as DS
-- newtype NewText = ... | BitFunctor/bitfunctor-theory | aux/testsertext.hs | mit | 1,080 | 0 | 13 | 331 | 242 | 124 | 118 | 27 | 2 |
module Graphics.Urho3D.Graphics.Internal.Texture(
Texture
, SharedTexture
, WeakTexture
, textureCntx
, sharedTexturePtrCntx
, weakTexturePtrCntx
) where
import Graphics.Urho3D.Container.Ptr
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Context as C
import qualified Languag... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/Internal/Texture.hs | mit | 577 | 0 | 11 | 98 | 132 | 86 | 46 | -1 | -1 |
module Mood where
data Mood = Blah | Woot deriving Show
changeMood :: Mood -> Mood
changeMood Blah = Woot
changeMood _ = Blah
| mikegehard/haskellBookExercises | chapter4/mood.hs | mit | 136 | 0 | 5 | 34 | 42 | 24 | 18 | 5 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (msum)
import Happstack.Server
import Web.Routes.Happstack (implSite)
import BBQ.Route
import Data.Accounts
import Data.RecordPool
import Data.Sheets
import Data.AppConfig
withAcid path action =
openAccountsState path $ \st1 -... | yan-ac/bbq.yan.ac | bbq.hs | mit | 908 | 0 | 12 | 172 | 260 | 134 | 126 | 26 | 1 |
{-# htermination zipWithM :: (a -> b -> Maybe c) -> [a] -> [b] -> Maybe [c] #-}
import Monad
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Monad_zipWithM_3.hs | mit | 93 | 0 | 3 | 20 | 5 | 3 | 2 | 1 | 0 |
module Language.Lips.Evaluator where
--------------------
-- Global Imports --
import Control.Monad.State (liftIO)
import Control.Monad
-------------------
-- Local Imports --
import Language.Lips.LanguageDef
import Language.Lips.State
----------
-- Code --
-- Lifting an error
liftError :: Error LipsVal -> LipsVal
... | crockeo/lips | src/lib/Language/Lips/Evaluator.hs | mit | 3,307 | 0 | 17 | 857 | 1,087 | 534 | 553 | 70 | 4 |
-- {{{
{-# LANGUAGE OverloadedStrings, MultiWayIf, LambdaCase #-}
module Main where
---------------------Import-------------------------
import Prelude
import Data.List
import Data.Char
import qualified Data.ByteString.Char8 as BS -- BS.getContents
import qualified Data.Vector as V
import qualified Data.Map as Map
impo... | abhiranjankumar00/dot-vim | skel/skel.hs | mit | 1,115 | 0 | 8 | 280 | 184 | 122 | 62 | 30 | 1 |
-- :l C:\Local\Dev\haskell\h4c.hs
-- Exemplos do tutorial http://www.haskell.org/haskellwiki/Haskell_Tutorial_for_C_Programmers
-- 2.5
-- Uma implementação recursiva de fib que usa uma função auxiliar geradora
fib :: Integer -> Integer
fib n = fibGen 0 1 n
fibGen :: Integer -> Integer -> Integer -> Integer
fibGen ... | feliposz/learning-stuff | haskell/h4c.hs | mit | 4,833 | 0 | 16 | 1,181 | 1,567 | 806 | 761 | 93 | 2 |
{-# LANGUAGE MultiParamTypeClasses #-}
module LambdaLine.Segment
(Segment(..)
) where
import Data.Monoid
class (Functor f, Monoid (f a)) => Segment f a where
buildPrompt :: [f a] -> a -> a -> IO ()
mkSegment :: IO (Maybe a) -> f a
stringToSegment :: a -> f a
| josiah14/lambdaline | LambdaLine/Segment.hs | gpl-3.0 | 268 | 0 | 11 | 56 | 114 | 60 | 54 | -1 | -1 |
{---------------------------------------------------------------------}
{- Copyright 2015, 2016 Nathan Bloomfield -}
{- -}
{- This file is part of Feivel. -}
{- ... | nbloomf/feivel | src/Feivel/GUI/Strings.hs | gpl-3.0 | 1,677 | 0 | 5 | 591 | 84 | 58 | 26 | 17 | 1 |
{-# OPTIONS -Wall -Werror -Wwarn #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# LANGUAGE FlexibleInstances #-}
{- |
Module : Data.Tree.UCT
Copyright : Copyright (C) 2010 Fabian Linzberger
License : GNU GPL, version 3 or above
Maintainer : Fabian Linzberger <e@lefant.net>
Stability : experim... | lefant/kurt | src/Data/Tree/UCT/GameTree.hs | gpl-3.0 | 3,964 | 0 | 12 | 1,633 | 571 | 343 | 228 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- | Convert cmsearch output to Browser Extensible Data (BED) format
-- Testcommand: cmsearchToBED -i /path/to/test.clustal
module Main where
import Prelude
import System.Console.CmdArgs
import Biobase.RNAlien.Library
import Data.Either.Unwrap
impo... | eggzilla/RNAlien | Biobase/cmsearchToBED.hs | gpl-3.0 | 8,855 | 0 | 21 | 1,950 | 1,997 | 1,037 | 960 | 141 | 4 |
-- brainfuck.hs -- A simple brainfuck interpreter.
-- Written by Andreas Hammar <ahammar@gmail.com>
--
-- This is free and unencumbered software released into the public domain.
-- See the UNLICENSE file for details.
module Main where
import Control.Monad.Error
import Data.ByteString.Internal
import Data.Char
import... | ahammar/Brainfuck.hs | brainfuck.hs | unlicense | 3,662 | 0 | 15 | 1,056 | 1,134 | 604 | 530 | 92 | 4 |
module StringCalculator (
toInt, add, add2, add3, add4
) where
import Data.String.Utils
import Data.Maybe
import Text.Regex
-- Problem 1: Be able to add integers given in a string, separated by commas.
-- Just the following cases:
-- "a" -> n
-- "a,b" -> n+m
-- "a,b,c" -> a+b+c
toInt :: [Char] -> Int
toInt ... | LambdaMx/haskelldojo | session_1/StringCalculator.hs | unlicense | 2,010 | 0 | 10 | 449 | 491 | 261 | 230 | 27 | 1 |
import System.Random (StdGen, getStdGen, randoms)
import Data.Array.Repa
import Data.Array.Repa.Operators.Reduction
import Data.Array.Repa.Eval
import Control.Monad.Identity
import Criterion.Main
import Control.DeepSeq
main = do
input <- randomInts count `fmap` getStdGen
let inputArray = fromList (Z:.count) i... | weeeeeew/petulant-cyril | lab_B/Main.hs | unlicense | 1,590 | 0 | 13 | 357 | 624 | 337 | 287 | 32 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Data.Foldable (traverse_)
import Data.Text (Text)
import Data.Default
import Data.Memory.Types... | shockkolate/brainfart | examples/basic/Main.hs | apache-2.0 | 2,914 | 0 | 15 | 655 | 979 | 514 | 465 | 71 | 3 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeOperators #-}
module Camfort.Specification.StencilsSpec (spec) where
import Control.Monad.Writer.Strict hiding (Sum... | mrd/camfort | tests/Camfort/Specification/StencilsSpec.hs | apache-2.0 | 18,775 | 0 | 26 | 6,307 | 6,576 | 3,449 | 3,127 | 327 | 1 |
module CustomList where
data List a = Nil | Cons a (List a)
deriving Show
emptyList :: List a
emptyList = Nil
isEmpty :: List a -> Bool
isEmpty Nil = True
isEmpty (Cons _ _) = False
cons :: a -> List a -> List a
cons = Cons
head :: List a -> a
head Nil = error "Empty list"
head (Cons x _) = x
... | wildsebastian/PurelyFunctionalDataStructures | chapter02/CustomList.hs | apache-2.0 | 1,052 | 0 | 9 | 270 | 426 | 217 | 209 | 26 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module NLP.MorfNCP
( temp
) where
import Control.Monad (forM_)
-- import qualified Data.Text.Lazy as L
import qualified Data.Text.Lazy.IO as L
import qualified Data.Tagset.Positional as P
import qualified NLP.MorfNCP.Base as Base
import... | kawu/morf-nkjp | src/NLP/MorfNCP.hs | bsd-2-clause | 2,509 | 0 | 20 | 615 | 465 | 255 | 210 | 41 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Application.HXournal.Type.Event
-- Copyright : (c) 2011, 2012 Ian-Woo Kim
--
-- License : BSD3
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com>
-- Stability : experimental
-- Portability : GHC
--
-------------... | wavewave/hxournal | lib/Application/HXournal/Type/Event.hs | bsd-2-clause | 4,348 | 0 | 10 | 1,947 | 494 | 309 | 185 | 115 | 3 |
{-| Implementation of cluster-wide logic.
This module holds all pure cluster-logic; I\/O related functionality
goes into the /Main/ module for the individual binaries.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or withou... | ganeti-github-testing/ganeti-test-1 | src/Ganeti/HTools/Cluster.hs | bsd-2-clause | 80,090 | 0 | 23 | 25,082 | 17,349 | 9,404 | 7,945 | 1,287 | 8 |
import CircUtils.QacgBool
import Test.QuickCheck
import Text.Printf
main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests
exp1 = Xor $ map V ["a","b","c"]
exp2 = Xor [And (map V ["e","f","g"]), V "a"]
exp3 = And [exp1,exp2]
exp4 = Xor [exp3,exp1]
exp5 = And [exp3,exp4]
prop_simp exp a = if length a < 7 then True... | aparent/qacg | src/QACG/CircUtils/QacgBoolTest.hs | bsd-3-clause | 1,005 | 6 | 10 | 208 | 444 | 231 | 213 | 21 | 2 |
{-# LANGUAGE TupleSections, TypeFamilies, FlexibleContexts, PackageImports #-}
module TestPusher (XmlPusher(..), Zero(..), One(..), Two(..), testPusher) where
import Control.Monad
import Control.Concurrent
import Data.Maybe
import Data.Pipe
import Data.Pipe.ByteString
import System.IO
import Text.XML.Pipe
import Xml... | YoshikuniJujo/forest | subprojects/xml-push/TestPusher.hs | bsd-3-clause | 693 | 2 | 13 | 116 | 240 | 129 | 111 | 22 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main ( main ) where
import Control.Applicative
import Data.Monoid
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Options.Applicative hiding ( (&) )
import System.FilePath
import Text.LaTeX.Base as Tex
import Foreign.Inference.Interface
data Opts = ... | travitch/iiglue | tools/IITableOutput.hs | bsd-3-clause | 9,446 | 0 | 17 | 2,544 | 2,383 | 1,241 | 1,142 | 206 | 1 |
module Day11 where
import Data.List
import Control.Applicative
{- Day 11: Corporate Policy -}
input :: String
input = "cqjxjnds"
inc :: Char -> (Bool, String) -> (Bool, String)
inc x (carry, xs)
| not carry = (False, x:xs)
| x == 'z' = (True, 'a':xs)
| x `elem` "iol" = (False,... | Rydgel/advent-of-code | src/Day11.hs | bsd-3-clause | 1,013 | 0 | 10 | 250 | 412 | 226 | 186 | 28 | 1 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Sequent.Check
( CheckT
, Check
, evalCheck
, evalCheckT
, liftEnv) where
import Control.Applicative ... | matthieubulte/sequent | src/Sequent/Check.hs | bsd-3-clause | 2,638 | 0 | 14 | 717 | 582 | 324 | 258 | 47 | 1 |
module Options.TypesSpec (main, spec) where
import Options.Types
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Instances
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "someFunction" $ do
it "should work fine" $ do
property someFunction
someFunction :: Bool -> Bool ->... | athanclark/optionz | test/Options/TypesSpec.hs | bsd-3-clause | 357 | 0 | 13 | 70 | 116 | 61 | 55 | 14 | 1 |
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Rank2Types #-... | esengie/algebraic-checker | src/NHorn/LaCarte.hs | bsd-3-clause | 2,453 | 8 | 11 | 682 | 1,213 | 649 | 564 | 59 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
-- | Functions for traversing the comment AST and analyzing the nodes it contains.
--
-- To start traversing the comment AST, use 'Clang.Cursor.getParsedComment' to
-- retrieve the comment from an AST node that may be associated with one (for
-- exampl... | ony/LibClang | src/Clang/Comment.hs | bsd-3-clause | 4,775 | 0 | 14 | 760 | 641 | 355 | 286 | 42 | 1 |
{-# OPTIONS_GHC -cpp #-}
module Code28_Tupling where
(□) :: [a] -> [a] -> [a]
xs □ ys = mix xs (ys, reverse ys)
mix :: [a] -> ([a],[a]) -> [a]
mix [] (ys,_) = ys
mix (x:xs) (ys,sy) = ys ++ [x] ++ mix xs (sy,ys)
boxall :: [[a]] -> [a]
boxall = foldr (□) []
op ... | sampou-org/pfad | Code/Code28_Tupling.hs | bsd-3-clause | 1,039 | 0 | 9 | 384 | 585 | 340 | 245 | 22 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Module ( Module(..)
, listModules
) where
import Data.Text (Text)
import Xml
data Codepool = Core | Community | Local deriving (Show)
data Module = Module { moduleCodePool :: Codepool
, moduleNameSpace :: String
... | dxtr/hagento | src/Magento/Module.hs | bsd-3-clause | 589 | 1 | 8 | 212 | 140 | 84 | 56 | -1 | -1 |
{-# LANGUAGE TypeOperators #-}
module World (
World(..),FinalColor,Color, Object(..), Shape (..),calcNormal,
Light(..),cmul,colRound,cadd,convertColtoFCol
-- Creation functions
-- Standard Array functions
,vUp
,vDown
,vForward
,vBackward
,vRight
,vLeft
-- Color conviniece functions
,t2c
--
-- | World Construction... | axhav/AFPLAB3 | World.hs | bsd-3-clause | 7,124 | 0 | 13 | 1,887 | 2,011 | 1,180 | 831 | 143 | 1 |
module Main where
incdInts :: [Integer]
incdInts = map (+1) [1..]
main :: IO ()
main = do
print (incdInts !! 1000)
print (incdInts !! 9001)
print (incdInts !! 90010)
print (incdInts !! 9001000)
print (incdInts !! 9501000)
print (incdInts !! 9901000)
| chengzh2008/hpffp | src/ch28-BasicLibraries/largeCAF1.hs | bsd-3-clause | 264 | 0 | 9 | 56 | 122 | 62 | 60 | 11 | 1 |
----------------------------------------------------------------------------
-- |
-- Module : Source2
-- Copyright : (c) Sergey Vinokurov 2018
-- License : BSD3-style (see LICENSE)
-- Maintainer : serg.foo@gmail.com
----------------------------------------------------------------------------
module Sou... | sergv/tags-server | test-data/0016reexport_of_missing_module/Source2.hs | bsd-3-clause | 379 | 0 | 5 | 58 | 37 | 24 | 13 | 3 | 1 |
module Twelve where
import Data.Char
sumJSON :: String -> Int
sumJSON [] = 0
sumJSON (x:xs)
| isDigit x = plus (read [x]) xs
| x == '-' = minus 0 xs
| otherwise = sumJSON xs
plus :: Int -> String -> Int
plus = applyOp (+)
minus :: Int -> String -> Int
minus = applyOp (-)
applyOp :: (Int -> Int ->... | purcell/adventofcodeteam | app/Twelve.hs | bsd-3-clause | 558 | 0 | 10 | 150 | 285 | 143 | 142 | 21 | 1 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Types where
import Data.Aeson
import GHC.Generics
data SSHHost = SSHHost{host :: String, remoteport :: Integer} deriving (Show, Generic, FromJSON, T... | pwestling/hmonit | src/Types.hs | bsd-3-clause | 638 | 0 | 9 | 124 | 177 | 102 | 75 | 14 | 1 |
-- Copyright (c) 2014 Contributors as noted in the AUTHORS file
--
-- 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 3 of the License, or
-- (at your option) any later version.
-... | cjdibbs/ardunio | examples/UART.hs | bsd-3-clause | 1,070 | 0 | 10 | 240 | 108 | 60 | 48 | 8 | 1 |
module Option
( buildOption
) where
import CommandLineOption (CommandLineOption)
import qualified CommandLineOption
import qualified Git
import Types
import Control.Applicative
import Data.Char (toUpper)
import Data.Maybe (catMaybes, fromJust,... | fujimura/chi | src/Option.hs | bsd-3-clause | 2,146 | 0 | 15 | 655 | 498 | 273 | 225 | 42 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Test.Helper
(
module Test.Hspec.Monadic,
module Test.Hspec.Expectations
) where
import Test.Hspec.Monadic
import Test.Hspec.HUnit()
import Test.Hspec.Expectations
| fujimura/persistent-hspec-example | Test/Helper.hs | bsd-3-clause | 214 | 0 | 5 | 28 | 44 | 30 | 14 | 8 | 0 |
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, StaticPointers, RankNTypes, GADTs, ConstraintKinds, FlexibleContexts, TypeApplications, ScopedTypeVariables, FlexibleInstances #-}
module QueryArrow.Remote.NoTranslation.Server where
import QueryArrow.DB.DB
import QueryArrow.DB.NoTranslation
import QueryArrow.DB.Resul... | xu-hao/QueryArrow | QueryArrow-db-remote/src/QueryArrow/Remote/NoTranslation/Server.hs | bsd-3-clause | 3,533 | 0 | 27 | 945 | 1,118 | 565 | 553 | 70 | 12 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2006
--
-- The purpose of this module is to transform an HsExpr into a CoreExpr which
-- when evaluated, returns a (Meta.Q Meta.Exp) computation analogous to the
-- input HsExpr. We do... | jstolarek/ghc | compiler/deSugar/DsMeta.hs | bsd-3-clause | 119,075 | 2,359 | 23 | 31,885 | 27,006 | 15,186 | 11,820 | 1,996 | 16 |
#!/usr/bin/env runhaskell
import Prelude hiding (print)
import System.Directory
import System.FilePath
import Data.List
import Data.Either
import Control.Monad
import System.Environment.UTF8
import System.IO.UTF8
import System.IO (stderr, stdin, stdout)
import Language.Haskell.Exts.Annotated.ExactPrint
import HPath.... | solidsnack/hpath | Main.hs | bsd-3-clause | 2,594 | 0 | 23 | 935 | 652 | 332 | 320 | 55 | 7 |
module Parser (
parseFile
) where
import Data.Char
import Text.ParserCombinators.ReadP
import Control.Applicative
import System.IO
import Syntax
brackets p = between (char '(' <* skipSpaces) (char ')') p
parseOpA = choice [ do string "+" ; return Plus
, do string "-" ; return Minus
... | orchid-hybrid/WHILE | Parser.hs | gpl-2.0 | 3,012 | 0 | 15 | 1,424 | 928 | 435 | 493 | 65 | 3 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-------------------... | getyourguide/fbthrift | thrift/compiler/test/fixtures/includes/gen-hs/MyService.hs | apache-2.0 | 14,518 | 0 | 18 | 1,973 | 4,017 | 2,177 | 1,840 | 226 | 3 |
{-# LANGUAGE TypeFamilies #-}
-- | Perlin noise implemented in Zeldspar.
-- TODO: PNG/BMP sink, to write pretty pictures to disk.
import qualified Prelude
import Zeldspar
import Zeldspar.Parallel
-- * Image settings; too large imgWidth, imgHeight or imgOctaves may cause you
-- to run out of stack space. Even when ... | kmate/zeldspar | examples/noise.hs | bsd-3-clause | 6,270 | 0 | 22 | 1,756 | 2,122 | 1,085 | 1,037 | 126 | 2 |
{-# LANGUAGE CPP, ScopedTypeVariables #-}
module Main where
import Control.Applicative ((<$>))
import Control.Exception
import Data.List (isPrefixOf)
import qualified Data.Int as Int
import GHC.Int
import Ros.Internal.Msg.SrvInfo
import Ros.Internal.RosBinary
import Ros.Service (callService)
import Ros.Service.ServiceT... | acowley/roshask | Tests/ServiceClientTests/ServiceClientTest.hs | bsd-3-clause | 5,169 | 0 | 15 | 1,102 | 1,151 | 606 | 545 | 93 | 3 |
{-# LANGUAGE TemplateHaskell #-}
module Types.Signed (
Signed (..)
) where
import Types.Basic
import Data.Autolib.Transport
-- something signed: a value together with its signature
data Signed a = Signed { contents :: a, signature :: Signature }
deriving (Eq, Read, Show)
$(derives [makeToTransport] [''Sign... | Erdwolf/autotool-bonn | server/src/Types/Signed.hs | gpl-2.0 | 325 | 0 | 9 | 57 | 85 | 51 | 34 | 8 | 0 |
{-# LANGUAGE RecordWildCards #-}
import Control.Applicative
import Control.Exception
import Control.Monad
import Control.Monad.Trans.Resource (runResourceT)
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy.Char8 as L8
import Data.List
import Data.Maybe
import Distribution.PackageDescr... | mathhun/stack | etc/scripts/release.hs | bsd-3-clause | 28,060 | 0 | 25 | 7,781 | 6,342 | 3,214 | 3,128 | 595 | 7 |
module B (idd) where
idd :: Int
idd = 100000242418429
| sdiehl/ghc | testsuite/tests/ghci/caf_crash/B.hs | bsd-3-clause | 56 | 0 | 4 | 12 | 19 | 12 | 7 | 3 | 1 |
{-@ LIQUID "--notermination" @-}
{-# OPTIONS_GHC -cpp -fglasgow-exts #-}
-- #prune
-- |
-- Module : Data.ByteString.Char8
-- Copyright : (c) Don Stewart 2006
-- License : BSD-style
--
-- Maintainer : dons@cse.unsw.edu.au
-- Stability : experimental
-- Portability : portable
--
-- Manipulate 'ByteString... | mightymoose/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Char8.hs | bsd-3-clause | 43,150 | 0 | 18 | 12,126 | 6,453 | 3,703 | 2,750 | -1 | -1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, BangPatterns, NoImplicitPrelude,
NondecreasingIndentation, MagicHash #-}
module GHC.IO.Encoding.CodePage(
#if defined(mingw32_HOST_OS)
codePageEncoding, mkCodePageEncoding,
localeEncoding, mkLocaleEncoding
#endi... | ezyang/ghc | libraries/base/GHC/IO/Encoding/CodePage.hs | bsd-3-clause | 6,233 | 32 | 19 | 1,713 | 1,551 | 803 | 748 | 5 | 0 |
module F6 where
f6f = \h -> \x -> h x 0
f6t = \y -> \z -> y + z
f6 = f6f f6t 3 | siddhanathan/ghc | testsuite/tests/arityanal/f6.hs | bsd-3-clause | 84 | 0 | 7 | 31 | 53 | 30 | 23 | 4 | 1 |
module UnitTests.Distribution.Client.Sandbox (
tests
) where
import Distribution.Client.Sandbox (withSandboxBinDirOnSearchPath)
import Test.Tasty
import Test.Tasty.HUnit
import System.FilePath (getSearchPath, (</>))
tests :: [TestTree]
tests = [ testCase "sandboxBinDirOnSearchPath" sandboxBinDirOnSe... | enolan/cabal | cabal-install/tests/UnitTests/Distribution/Client/Sandbox.hs | bsd-3-clause | 843 | 0 | 11 | 136 | 175 | 95 | 80 | 20 | 1 |
import Data.Ix
import Data.Int
main = print (index (minBound::Int16,maxBound) maxBound)
| beni55/ghcjs | test/pkg/base/ix001.hs | mit | 89 | 0 | 8 | 11 | 36 | 20 | 16 | 3 | 1 |
module RankN where
| vladfi1/hs-misc | RankN.hs | mit | 23 | 0 | 2 | 7 | 4 | 3 | 1 | 1 | 0 |
solve :: Double -> Double
solve x = 1 + x + (x^2/2) + (x^3/6) + (x^4/24) + (x^5/120) + (x^6/720) + (x^7/5040) + (x^8/40320) + (x^9/362880) -- + (x^10/3628800)-- Insert your code here --
main :: IO ()
main = getContents >>= mapM_ print. map solve. map (read::String->Double). tail. words
| JsWatt/Free-Parking | hacker_rank/functional_programming/introduction/evaluating_e^x.hs | mit | 288 | 0 | 15 | 52 | 197 | 103 | 94 | 4 | 1 |
module Typing.Subtyping
( (<:)
, (\/)
, (/\)
, (//)
, (\\)
) where
import Typing.Types
import Typing.Substitution
import Data.List (intersect, union)
import Data.Maybe (fromJust)
import qualified Data.List ((\\))
(<:) :: Type -> Type -> Bool
-- S-Refl
t <: u | t == u = True
-- S-Top
_ <: Top = True
-... | tadeuzagallo/verve-lang | src/Typing/Subtyping.hs | mit | 3,789 | 0 | 15 | 1,075 | 2,265 | 1,133 | 1,132 | -1 | -1 |
-- | The DSL for creating a grammar/tokenizer definition for 'Text.Tokenify.tokenizer'
module Text.Tokenify.DSL where
import Prelude hiding (concat, any)
import qualified Text.Tokenify.Response as Response
import qualified Text.Tokenify.Regex as Regex
import Text.Tokenify.Regex (Regex)
import Text.Tokenify.Types
-... | AKST/tokenify | src/Text/Tokenify/DSL.hs | mit | 2,233 | 0 | 9 | 459 | 576 | 312 | 264 | 38 | 1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverlappingInstances #-}
module Main where
import Prelude hiding (writeFile)
import Data.Map (empty)
import Text.XML
import Text.XML.Generic
import GHC.Gen... | jhedev/xml-conduit-generics | examples/Users.hs | mit | 1,022 | 0 | 11 | 373 | 259 | 143 | 116 | 26 | 1 |
module Input where
import Data.Vector (Vector)
import qualified Data.Vector as V
import DailyChart
type Input = Vector Double
type SixDailyCharts = (DailyChart, DailyChart, DailyChart, DailyChart, DailyChart, DailyChart)
fromDailyCharts :: SixDailyCharts -> (Bool, Input)
fromDailyCharts (d1,d2,d3,d4,d5,d6) = (answ... | cohei/stock-value-prediction | Input.hs | mit | 650 | 0 | 12 | 112 | 291 | 163 | 128 | 12 | 1 |
--The MIT License (MIT)
--
--Copyright (c) 2016-2017 Steffen Michels (mail@steffen-michels.de)
--
--Permission is hereby granted, free of charge, to any person obtaining a copy of
--this software and associated documentation files (the "Software"), to deal in
--the Software without restriction, including without limita... | SteffenMichels/IHPMC | src/HPT.hs | mit | 7,452 | 0 | 16 | 1,753 | 2,010 | 1,048 | 962 | 120 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Y2018.M06.D05.Exercise where
{--
Another day, another data structure.
We have a smart-tagging algorithm that saves its results to JSON. We want to
take those results in store them in a database. But before we do that, we need
to parse the JSON into Haskell structures because... | geophf/1HaskellADay | exercises/HAD/Y2018/M06/D05/Exercise.hs | mit | 2,113 | 0 | 9 | 394 | 276 | 156 | 120 | 21 | 1 |
import Test.Hspec
-- Problem 16
-- Drop every N'th element from a list.
dropEvery :: Eq a => [a] -> Int -> [a]
dropEvery ls n = get' ls n n
where
get' [] _ _ = []
get' (_:xs) t 1 = get' xs t t
get' (x:xs) t i = x : get' xs t (i-1)
main :: IO()
main = hspec $
describe "99-exercises.16 = Drop every ... | baldore/haskell-99-exercises | 16.hs | mit | 451 | 0 | 10 | 123 | 176 | 90 | 86 | 11 | 3 |
{-# LANGUAGE RecordWildCards #-}
import Data.Char (isSpace)
import Data.Foldable (for_)
import Data.Function (on)
import Test.Hspec (Spec, describe, it, shouldBe, shouldMatchList)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import CryptoSquare (encode)
main :: IO ()
mai... | exercism/xhaskell | exercises/practice/crypto-square/test/Tests.hs | mit | 2,412 | 0 | 16 | 903 | 457 | 269 | 188 | 42 | 1 |
module Y2016.M07.D19.Solution where
{--
A Trigon, also known in some circles as a 'triangle,' is a three-SIDED shape.
Trigons are have several interesting characteristics. A trigon also defines a
plane (in which it lies), and a set of trigons can be rendered efficiently these
days to represent, e.g. characters in 3 di... | geophf/1HaskellADay | exercises/HAD/Y2016/M07/D19/Solution.hs | mit | 1,792 | 0 | 10 | 319 | 240 | 154 | 86 | 15 | 1 |
import Prelude hiding ((++),concat)
-- just for kicks & gigs
(++) :: [a] -> [a] -> [a]
[] ++ ys = ys
(x:xs) ++ ys = x : (xs ++ ys)
concat :: [[a]] -> [a]
concat [] = []
concat (xs:xss) = xs ++ concat xss
test = concat [["a","b"],["c","d"],["e","f"]]
| calebgregory/fp101x | wk3/concat.hs | mit | 271 | 0 | 7 | 72 | 169 | 97 | 72 | 8 | 1 |
module MyLen where
myLen :: [a] -> Int
myLen (_:xs) = 1 + myLen xs
myLen [] = 0
| lpenz/realworldhaskell-exercises | ch03/MyLen.hs | mit | 86 | 0 | 7 | 25 | 48 | 26 | 22 | 4 | 1 |
-- WeIrD StRiNg CaSe
-- http://www.codewars.com/kata/52b757663a95b11b3d00062d/train/haskell
module WeIrDStRiNgCaSe where
import Data.Char(toLower, toUpper)
toWeirdCase :: String -> String
toWeirdCase = unwords . map (zipWith ($) (cycle [toUpper, toLower])) . words
| gafiatulin/codewars | src/6 kyu/WeIrDStRiNgCaSe.hs | mit | 268 | 0 | 12 | 32 | 66 | 39 | 27 | 4 | 1 |
module Vacivity.FOV.ShadowCast(
calcFOV
) where
import Prelude hiding (any, all, foldl, concat)
import Control.Applicative ((<$>))
import Data.Foldable hiding (toList)
import qualified Data.Set as Set
import qualified Antiqua.Data.Array2d as A2D
import Antiqua.Common
import Vacivity.FOV.Common
import Vacivity.Uti... | olive/vacivity | src/Vacivity/FOV/ShadowCast.hs | mit | 3,298 | 0 | 37 | 1,542 | 1,270 | 680 | 590 | 75 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.