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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-- | How big of a sofa can we get around a corner?
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
module Main where
import GHC.Generics ( Generic1 )
import Data.Proxy ( Proxy(..) )
import Data.IORef ( newIORef, ... | ghorn/dynobud | dynobud/examples/SofaExpando.hs | lgpl-3.0 | 8,581 | 0 | 26 | 2,546 | 3,270 | 1,757 | 1,513 | 191 | 1 |
-- Simple theorem prover for PROP
module Tableau where
import Data.List (nub)
import Control.Monad (msum)
data Formula = Atomic Char
| Negation Formula
| Conjunction Formula Formula
| Disjunction Formula Formula
| Implication Formula Formula
... | jbetzend/Haskell-playground | Tableau/Tableau.hs | unlicense | 5,375 | 0 | 20 | 1,462 | 2,334 | 1,196 | 1,138 | 78 | 6 |
module HostConfiguration
( WorkspaceNames
, HostConfiguration
, KeyMapping(..)
, workspaces
, workspaceMap
, terminal
, locale
, readHostConfiguration
, keyMappings
, isSlim
, sysInfoBar
, autostartPrograms
) where
... | nakal/xmonad-conf | lib/HostConfiguration.hs | bsd-2-clause | 9,141 | 0 | 20 | 3,700 | 1,870 | 993 | 877 | 182 | 6 |
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-}
module Network.MyTardis.RestTypes where
import Prelude hiding (id)
import Control.Applicative ((<$>), (<*>))
import Control.Monad (mzero)
import Data.Aeson
import Data.Typeable
data RestExperimentMeta = RestExperimentMeta
{ emLimit :: Integer
, emNext :... | carlohamalainen/imagetrove-uploader | src/Network/MyTardis/RestTypes.hs | bsd-2-clause | 20,122 | 0 | 39 | 8,808 | 3,745 | 2,092 | 1,653 | 401 | 1 |
module TB where
import CLaSH.Prelude
type Inp = (Signed 4,Outp)
type Outp = (Maybe (Signed 8,Bool),Bit)
topEntity :: Unbundled' Inp -> Unbundled' Outp
topEntity = transfer <^> initS
transfer s i = (i,o)
where
o = snd s
initS = (0,(Nothing,low))
testInput :: Signal Inp
testInput = stimuliGenerator $(v ([ ... | christiaanb/clash-compiler | tests/shouldwork/Testbench/TB.hs | bsd-2-clause | 714 | 0 | 15 | 239 | 297 | 170 | 127 | -1 | -1 |
module Problem48 where
main :: IO ()
main = print . last10 . sum . map (\x -> last10 $ x ^ x) $ [1 .. 1000]
where last10 = read . (\xs -> drop (length xs - 10) xs) . show
| adityagupta1089/Project-Euler-Haskell | src/problems/Problem48.hs | bsd-3-clause | 176 | 0 | 14 | 47 | 98 | 53 | 45 | 4 | 1 |
{-# LANGUAGE PackageImports #-}
module GHC.IORef (module M) where
import "base" GHC.IORef as M
| silkapp/base-noprelude | src/GHC/IORef.hs | bsd-3-clause | 100 | 0 | 4 | 18 | 21 | 15 | 6 | 3 | 0 |
{-# LANGUAGE PolyKinds #-}
-- | Explicit dictionaries.
--
-- When working with compound constraints such as constructed
-- using 'All' or 'All2', GHC cannot always prove automatically
-- what one would expect to hold.
--
-- This module provides a way of explicitly proving
-- conversions between such constraints to GHC.... | phadej/generics-sop | src/Generics/SOP/Dict.hs | bsd-3-clause | 4,217 | 2 | 12 | 873 | 984 | 527 | 457 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts, TypeFamilies, RankNTypes #-}
#ifdef __GHCJS__
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
#endif
-- |
module VK.DOM.Router (getLocation
, setLocation
, setLocationHash
, getLoc... | eryx67/vk-api-example | src/VK/DOM/Router.hs | bsd-3-clause | 3,604 | 11 | 13 | 855 | 1,018 | 537 | 481 | 50 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Inspection.Data.AuthToken
( AuthToken(..)
, toGithubAuth
) where
import MyLittlePrelude
import qualified Data.Text as Text
import Data.Text.Encoding (encodeUtf8, decodeUtf8)
import qualified GitHub as GH
import Web.HttpApiData (FromHttpApiData(..), ToHttpApi... | zudov/purescript-inspection | src/Inspection/Data/AuthToken.hs | bsd-3-clause | 843 | 0 | 13 | 148 | 234 | 133 | 101 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Graphics.Formats.STL.Printer where
import qualified Data.ByteString as BS
import Data.ByteString.Lazy.Builder
import Data.List (intersperse)
import Data.Monoid
import Data.Text.Encoding (encodeUtf8)
import Graphics.Formats.ST... | bergey/STL | src/Graphics/Formats/STL/Printer.hs | bsd-3-clause | 1,705 | 0 | 10 | 539 | 499 | 262 | 237 | 36 | 2 |
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE... | fosskers/mapalgebra | lib/Geography/MapAlgebra.hs | bsd-3-clause | 55,449 | 0 | 24 | 15,363 | 14,596 | 8,034 | 6,562 | -1 | -1 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, ForeignFunctionInterface #-}
-- | Duck interpreter values
-- For now, duck values are layed out in the following naive manner:
--
-- 1. All types are pointer sized. In particular, there are no zero size types as yet.
-- 2. Int and Char are stored as unboxed integ... | girving/duck | duck/Memory.hs | bsd-3-clause | 6,382 | 0 | 13 | 1,304 | 2,209 | 1,132 | 1,077 | 138 | 1 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
import Data.Proxy
import Data.Monoid
import GHC.Types
type UnaryCounter = [()]
class CounterLike a where
zero :: a
incr :: a -> a
toInt :: a -> Int
in... | sleexyz/haskell-fun | ExistentialsForFree2.hs | bsd-3-clause | 1,072 | 0 | 12 | 248 | 452 | 244 | 208 | 33 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
import Test.Sandbox.Compose
import Options.Applicative
import qualified Data.ByteString.Lazy as L
import qualified Data.Text as T
import Shelly hiding (command,run,FilePath)
import Network.HTTP.Conduit... | junjihashimoto/test-sandbox-compose | Main.hs | bsd-3-clause | 2,625 | 0 | 20 | 514 | 918 | 470 | 448 | 72 | 2 |
module HsImport.Utils
( srcLine
, declSrcLoc
, importDecls
) where
import qualified Language.Haskell.Exts as HS
type SrcLine = Int
srcLine :: HS.ImportDecl -> SrcLine
srcLine = HS.srcLine . HS.importLoc
declSrcLoc :: HS.Decl -> Maybe HS.SrcLoc
declSrcLoc decl =
case decl of
HS.TypeDecl srcL... | jystic/hsimport | lib/HsImport/Utils.hs | bsd-3-clause | 2,162 | 0 | 9 | 827 | 733 | 345 | 388 | 43 | 30 |
{-# LANGUAGE NoImplicitPrelude, FlexibleInstances, MultiParamTypeClasses #-}
module Network.NineP.Server.Utils
( getQid, fromStat, toWStat, toMode, walk, sendRMsg, convertPerm
) where
import Prelude hiding (lookup)
import Control.Monad (liftM)
import Control.Monad.Trans (MonadIO(..))
import Data.Bits (shiftL,... | Elemir/network-ninep | src/Network/NineP/Server/Utils.hs | bsd-3-clause | 3,269 | 0 | 20 | 793 | 1,284 | 663 | 621 | 83 | 2 |
{-# LANGUAGE TemplateHaskell #-}
{-|
Module : AERN2.WithGlobalParam.Elementary
Description : elementary functions on sequences
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental
Portability : portable
Elementary... | michalkonecny/aern2 | aern2-net/src/AERN2/WithGlobalParam/Elementary.hs | bsd-3-clause | 4,825 | 0 | 10 | 1,065 | 1,204 | 632 | 572 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Events
( events
) where
import IO
import Text
import Network.SimpleIRC
import qualified Data.ByteString.UTF8 as U
import qualified Data.ByteString.Char8 as B
import Data.Maybe
import Control.Applicative
import Control.Exception
import Control.Monad
import System.IO.Error
eve... | raposalorx/mssbot | Events.hs | bsd-3-clause | 2,954 | 0 | 15 | 725 | 1,091 | 540 | 551 | -1 | -1 |
{-# LANGUAGE TypeFamilies, OverloadedStrings, FlexibleContexts #-}
--------------------------------------------------------------------
-- |
-- Module : Diagrams.SVG.Tree
-- Copyright : (c) 2015 Tillmann Vogt <tillk.vogt@googlemail.com>
-- License : BSD3
--
-- Maintainer: diagrams-discuss@googlegroups.com
-- Stabi... | diagrams/diagrams-input | src/Diagrams/SVG/Tree.hs | bsd-3-clause | 24,547 | 0 | 15 | 6,254 | 5,974 | 3,339 | 2,635 | 337 | 6 |
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
data Nil
data Cons x xs
class First list x | list -> x
instance First Nil Nil
instance First (Cons x xs) x
class ListC... | wangbj/excises | peano.hs | bsd-3-clause | 2,844 | 0 | 8 | 713 | 1,298 | 658 | 640 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
#if __GLASGOW_HASKELL__ >= 706
{-# LANGUAGE PolyKinds #-}
#endif
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE TypeInType #-}
#endif
-------------------------------------------------------... | ddssff/lens | src/Control/Lens/Equality.hs | bsd-3-clause | 5,997 | 0 | 11 | 1,212 | 1,087 | 638 | 449 | 76 | 1 |
{-# OPTIONS -Wall -fno-warn-missing-signatures -fno-warn-name-shadowing #-}
import Prelude hiding (log)
import Control.Concurrent
import Control.Monad (forever, void)
import Criterion.Main
import Network (PortID(..))
import Network.Socket (Family(..), SocketType(..), PortNumber, SockAddr(..),... | joeyadams/haskell-iocp | testing/recv-bench.hs | bsd-3-clause | 1,610 | 0 | 21 | 423 | 457 | 241 | 216 | 41 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module UTxO.Translate (
-- * Monadic context for the translation from the DSL to Cardano
TranslateT(..)
, Translate
, runTranslateT
, runTranslateTNoErrors
, runTranslate
, runTranslateNoErrors
, withConfig
, mapTranslateErrors
, catchTranslateErrors
... | input-output-hk/pos-haskell-prototype | utxo/src/UTxO/Translate.hs | mit | 13,154 | 22 | 23 | 3,210 | 2,590 | 1,358 | 1,232 | -1 | -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-ec2/gen/Network/AWS/EC2/ReplaceRoute.hs | mpl-2.0 | 5,857 | 0 | 11 | 1,197 | 833 | 500 | 333 | 102 | 1 |
{-
- Copyright 2014 - 2015 Per Magnus Therning
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable la... | mmhat/cblrepo | src/Extract.hs | apache-2.0 | 1,550 | 0 | 12 | 304 | 298 | 157 | 141 | 23 | 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="ar-SA">
<title>تخصيص تقرير HTML</title>
<maps>
<homeID>top</homeID>
<mapref location="... | veggiespam/zap-extensions | addOns/customreport/src/main/javahelp/org/zaproxy/zap/extension/customreport/resources/help_ar_SA/helpset_ar_SA.hs | apache-2.0 | 986 | 89 | 62 | 158 | 400 | 203 | 197 | -1 | -1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP #-}
module GHC.Constants where
import Prelude
#include "../../../include/HaskellConstants.hs"
| joelburget/haste-compiler | libraries/base-ghc-7.8/GHC/Constants.hs | bsd-3-clause | 144 | 0 | 3 | 19 | 12 | 9 | 3 | 4 | 0 |
{-|
Module : Data.STM.Bag.Internal.TListBag
Description : STM-based Concurrent Bag data structure implementation
Copyright : (c) Alex Semin, 2015
License : BSD3
Maintainer : alllex.semin@gmail.com
Stability : experimental
Portability : portable
Implementation of the 'Data.STM.Bag.Class' using fine-graine... | Alllex/stm-data-collection | src/Data/STM/Bag/Internal/TListBag.hs | bsd-3-clause | 1,507 | 0 | 16 | 445 | 449 | 220 | 229 | 41 | 3 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
module Tests.Tokenize where
import Control.Applicative
import Data.Char ( isPrint )
import Test.QuickCheck
import Tests.Util
import Text.Trans.Tokenize
import Graphics.Vty.Widgets.Util
import qualified Data.Text as T
lineGen :: Gen [Token ()]
li... | KommuSoft/vty-ui | test/src/Tests/Tokenize.hs | bsd-3-clause | 4,733 | 0 | 18 | 2,402 | 1,554 | 792 | 762 | 77 | 1 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -cpp #-}
{-# OPTIONS_NHC98 -cpp #-}
{-# OPTIONS_JHC -fcpp #-}
-- #hide
module Distribution.Compat.Exception (
SomeException,
onException,
catchIO,
handleIO,
catchExit,
throwIOIO
) where
import System.Exit
import qualified Control.Exception as Exception
#if MIN_VERSION... | IreneKnapp/Faction | faction/Distribution/Compat/Exception.hs | bsd-3-clause | 1,419 | 0 | 9 | 283 | 233 | 134 | 99 | 28 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.CleanParser where
import Options.Applicative
import Stack.Clean (CleanOpts (..))
import Stack.Prelude
import Stack.Types.PackageName
-- | Command-line parser for the clean command.
cleanOptsParser :: ... | MichielDerhaeg/stack | src/Stack/Options/CleanParser.hs | bsd-3-clause | 747 | 0 | 12 | 244 | 112 | 62 | 50 | 18 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.AfterDrag
-- Copyright : (c) 2014 Anders Engstrom <ankaan@gmail.com>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : Anders Engstrom <ankaan@gmail.com>
-- Stability : unstable
-- Por... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Actions/AfterDrag.hs | bsd-2-clause | 2,739 | 0 | 16 | 663 | 328 | 187 | 141 | 29 | 2 |
module GenTerm () where
import Prelude hiding (reverse)
foo :: Int -> Int -> Int
{-@ foo :: n:Nat -> m:Nat -> Nat /[n+m] @-}
foo n m
| cond 1 = 0
| cond 2 && n > 1 = foo (n-1) m
| cond 3 && m > 2 = foo (n+1) (m-2)
{-@ cond :: Int -> Bool @-}
cond :: Int -> Bool
cond _ = undefined
data L a = N | C a (L a)
... | mightymoose/liquidhaskell | tests/pos/GeneralizedTermination.hs | bsd-3-clause | 868 | 0 | 10 | 288 | 341 | 170 | 171 | 16 | 1 |
-- | Utilities related to Monad and Applicative classes
-- Mostly for backwards compatability.
module MonadUtils
( Applicative(..)
, (<$>)
, MonadFix(..)
, MonadIO(..)
, liftIO1, liftIO2, liftIO3, liftIO4
, zipWith3M
, mapAndUnzipM, mapAndUnzip3M, mapAndUnz... | frantisekfarka/ghc-dsi | compiler/utils/MonadUtils.hs | bsd-3-clause | 5,218 | 6 | 12 | 1,383 | 2,139 | 1,146 | 993 | 90 | 2 |
-- |
--
-- Since 3.0.4
module Network.Wai.Middleware.StreamFile
(streamFile) where
import Network.Wai (responseStream)
import Network.Wai.Internal
import Network.Wai (Middleware, responseToStream)
import qualified Data.ByteString.Char8 as S8
import System.PosixCompat (getFileStatus, fileSize, FileOffset)
import Ne... | AndrewRademacher/wai | wai-extra/Network/Wai/Middleware/StreamFile.hs | mit | 1,408 | 0 | 22 | 305 | 293 | 163 | 130 | 23 | 2 |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
module A where
class Matrix a fa | a -> fa where
row :: [a] -> fa
| urbanslug/ghc | testsuite/tests/typecheck/prog001/A.hs | bsd-3-clause | 134 | 0 | 8 | 27 | 34 | 20 | 14 | 4 | 0 |
{-# LANGUAGE ViewPatterns #-}
{-|
Module : Language.C.Preprocessor.Remover.Internal.AddPadding
Description : Padding of the Cpp output
Copyright : (c) Carlo Nucera, 2016
License : BSD3
Maintainer : meditans@gmail.com
Stability : experimental
Portability : POSIX
After cpp preprocessing, the file is left ... | meditans/preprocessor | src/Language/C/Preprocessor/Remover/Internal/AddPadding.hs | mit | 5,418 | 0 | 15 | 1,162 | 673 | 378 | 295 | 55 | 1 |
module ErrorHandling.EitherSpec where
import Prelude hiding (Either(..), map, sequence, traverse)
import Test.Hspec
import ErrorHandling.Either
spec :: Spec
spec = do
describe "map" $ do
context "Left" $ do
it "does nothing" $ do
map (+1) (Left "Foo" :: Either String Int) `shouldBe` Left "Foo"
... | tomwadeson/fpinhaskell | test/ErrorHandling/EitherSpec.hs | mit | 2,464 | 0 | 20 | 659 | 937 | 452 | 485 | 50 | 3 |
module BattleNet.Plumbing where
import BattleNet.ApiKey
import Control.Applicative
import Control.Monad
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Text hiding (intersperse)
import Data.Aeson
import qualified Data.Aeson as Aeson
import Network.HTTP.Conduit hiding (path, queryString)
apiEndpoin... | teozkr/hs-battlenet | BattleNet/Plumbing.hs | mit | 1,555 | 0 | 13 | 299 | 446 | 243 | 203 | 31 | 1 |
{-|
Module: Y2015.D13
Description: Advent of Code Day 13 Solutions.
License: MIT
Maintainer: @tylerjl
Solutions to the day 13 set of problems for <adventofcode.com>.
-}
module Y2015.D13 (solveSeating) where
import Data.List (nub, permutations)
import Data.Map (Map, findWithDefault,... | tylerjl/adventofcode | src/Y2015/D13.hs | mit | 1,381 | 0 | 13 | 369 | 453 | 258 | 195 | 26 | 2 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid ((<>))
import Data.Time.Clock (getCurrentTime, utctDay)
import Data.Time.Calendar (addDays)
import Network.HTTP.Client hiding (port)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Network.HTTP.Types.Status (status200)
import Network.HTTP.Types.Header (h... | jhedev/campus | Main.hs | mit | 2,110 | 0 | 15 | 363 | 606 | 331 | 275 | 52 | 1 |
module GUBS.Term (
Term (..)
, fun
, variable
, constant
, funs
, funsDL
, vars
, varsDL
, args
, argsDL
, definedSymbol
, substitute
, interpret
, interpretM
) where
import Data.List (nub)
import Data.String (IsString (..))
import Data.Functor.Identity (runI... | mzini/gubs | src/GUBS/Term.hs | mit | 4,782 | 0 | 12 | 1,462 | 2,416 | 1,229 | 1,187 | 122 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Network.Wai.Test
( -- * Session
Session
, runSession
-- * Client Cookies
, ClientCookies
, getClientCookies
, modifyClientCookies
, setClientCookie
, deleteClientCookie
-- * R... | creichert/wai | wai-extra/Network/Wai/Test.hs | mit | 10,090 | 0 | 18 | 2,545 | 2,787 | 1,471 | 1,316 | 251 | 3 |
{-# LANGUAGE OverloadedStrings, ViewPatterns #-}
module Main where
import qualified Data.Text as T
import Data.Monoid
import Data.CSS.Syntax.Tokens
import Test.Hspec
import Test.Hspec.QuickCheck
import Prelude
import Test.QuickCheck
import Data.Sc... | wereHamster/haskell-css-syntax | test/Test.hs | mit | 19,177 | 0 | 20 | 5,443 | 4,919 | 2,311 | 2,608 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Error where
import ClassyPrelude.Yesod
import Data.Aeson
import Data.Aeson.TH
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
impo... | cliffano/swaggy-jenkins | clients/haskell-yesod/generated/src/Error.hs | mit | 1,856 | 0 | 10 | 314 | 376 | 198 | 178 | 34 | 1 |
{-# LANGUAGE RankNTypes #-}
module ConcSplit.Safe (
makeImpl
) where
import System.IO
import Control.Monad
import Control.Applicative ((<$>),pure)
import Control.Arrow (first,second) -- only to map over tuples with first and second
import Control.Exception
import Data.Iteratee.IO.Handle (enumHandle)
impo... | danidiaz/concsplit | src/ConcSplit/Safe.hs | mit | 3,481 | 0 | 22 | 1,074 | 698 | 368 | 330 | 45 | 4 |
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
module SDL.Geometry where
import qualified Graphics.UI.SDL.Types as SDL.T
import Foreign.C.Types
import Utils.Utils
import GHC.Int
instance Num a => Num (Point a) where
(ax, ay) + (bx, by) = (ax + bx, ay + by)
(ax, ay) - (bx, by) = (ax - ... | ublubu/tile-rider | src/SDL/Geometry.hs | mit | 2,131 | 0 | 10 | 452 | 1,052 | 585 | 467 | 48 | 1 |
module Data.Bitcoin.TypesSpec where
import Test.Hspec
spec :: Spec
spec = return ()
| solatis/haskell-bitcoin-types | test/Data/Bitcoin/TypesSpec.hs | mit | 96 | 0 | 6 | 24 | 27 | 16 | 11 | 4 | 1 |
{-# htermination (blockIO :: ((a -> IOResult) -> IO Tup0) -> IO a) #-}
import qualified Prelude
data MyInt = Pos Nat | Neg Nat ;
data Nat = Succ Nat | Zero ;
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Tup0 = Tup0 ;
data Maybe a = Nothing | Just a ;
data IOErrorKind = Junk ;
da... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/blockIO_1.hs | mit | 1,418 | 0 | 11 | 337 | 550 | 309 | 241 | 28 | 1 |
module HeartsSpec (spec) where
import Prelude hiding (foldr)
import qualified Data.Foldable as F
import Data.List (sort, group)
import qualified Data.Set as S
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck (arbitrary)
import Hearts
import Hearts.Hand
import Hearts.Instances()
{-# ANN module "... | nadirs/hearts-hs | tests/HeartsSpec.hs | mit | 4,365 | 0 | 25 | 1,696 | 1,201 | 589 | 612 | 84 | 9 |
module Math.Ray
( Ray(..)
, throughPoint
) where
import Math.Vector
data Ray = Ray Vector3 Unit3
throughPoint :: Vector3 -> Vector3 -> Ray
throughPoint s p = let d = unit $ p - s in Ray s d
| burz/Rayzer | Math/Ray.hs | mit | 194 | 0 | 10 | 43 | 81 | 44 | 37 | 7 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
module Test.Control.TimeWarp.Timed.ExceptionSpec
( spec
) where
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TVar (TVar, modifyTVar, newTVarIO, readTVarIO)
import Co... | serokell/time-warp | test/Test/Control/TimeWarp/Timed/ExceptionSpec.hs | mit | 9,889 | 0 | 17 | 3,609 | 2,224 | 1,147 | 1,077 | 233 | 2 |
{- Да се напише функция extractEvens string, която връща списък от всички
- четни числа в низа string.
-}
extractEvens :: String -> [String]
extractEvens [] = []
extractEvens s@(c:cs)
| isDigit c && isNumberEven s =
extractNumber s : extractEvens (dropWhile isDigit s)
| otherwise = extractEvens cs
where... | fmi-lab/fp-elective-2017 | exams/preparation/extractEvens.hs | mit | 583 | 0 | 10 | 123 | 178 | 90 | 88 | 11 | 1 |
#!/usr/bin/env runghc
import Data.List
import System.Cmd
main :: IO ()
main = do
system $ "rm -rf *.tix hpc_out"
system $ "cabal clean"
system $ "cabal configure --enable-tests --enable-library-coverage"
system $ "cabal build"
system $ "dist/build/specs/specs"
system $ hpc "markup" ["--... | thoughtpolice/hs-noise | scripts/coverage.hs | mit | 691 | 0 | 9 | 168 | 192 | 98 | 94 | 20 | 1 |
module Data.Expenses.Parse.Megaparsec.UsingDirective
( using
)
where
import Control.Monad ( void )
import qualified Data.List.NonEmpty as NE
import qualified Data.Set as Set
import Text.Megaparsec ( ErrorItem(Tokens)
... | rgoulter/expenses-csv-utils | src/Data/Expenses/Parse/Megaparsec/UsingDirective.hs | mit | 2,147 | 0 | 17 | 1,179 | 437 | 235 | 202 | 44 | 2 |
{-# LANGUAGE QuasiQuotes, ScopedTypeVariables, OverloadedStrings #-}
import qualified Hasql as H
import qualified Hasql.Postgres as H
import qualified Data.Int as I
psqlConf :: H.Postgres
psqlConf = H.Postgres "haruko.gonyeo.com" 5432 "psql-user" "s3kr1t" "my-database"
main :: IO ()
main = do s <- maybe (fail "Impro... | dgonyeo/blog-hasql-example | Main.hs | mit | 1,805 | 0 | 16 | 898 | 364 | 192 | 172 | 30 | 2 |
{-# LANGUAGE OverloadedStrings #-}
import Data.Char
import Network.HTTP.Types
import Network.Wai
import Network.Wai.Handler.Warp
import System.Directory
import System.Environment
import System.FilePath
import qualified Control.Concurrent.Lock as L
import qualified Data.ByteString.Lazy as BS
import qualified Data.Text a... | dvaergiller/mrag | Mrag.hs | mit | 1,086 | 0 | 14 | 202 | 332 | 169 | 163 | 28 | 3 |
module Git.Result where
import Foreign.C.Types
type Result a = IO (Either ErrorCode a)
newtype ErrorCode = ErrorCode Int
handle_git_return::IO CInt -> IO a -> Result a
handle_git_return action wrapper = do
return_value <- action
if return_value /= 0 then return $ Left $ ErrorCode $ fromIntegral return_value
e... | sakari/hgit | src/Git/Result.hs | gpl-2.0 | 344 | 0 | 10 | 62 | 112 | 58 | 54 | 9 | 2 |
import Control.Monad ( guard )
import System.Directory ( doesDirectoryExist, setCurrentDirectory )
import System.IO.Temp ( withSystemTempDirectory )
-- internal modules
import Command.Init ( gtInit )
import Command.Log ( gtLog )
main :: IO ()
main =
withSyste... | cblp/gt | Tests/Command/InitLog.hs | gpl-2.0 | 496 | 0 | 10 | 156 | 119 | 62 | 57 | 13 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
module Robots.Solver where
-- $Id$
import Robots.Config
import Robots.Data
import Robots.Move
import Robots.Final
import Robots.Hull
import Robots.Nice
import Robots.Final
import Robots.Examples
import Autolib.Schichten
import Data.Maybe
import Autolib.Set
import Autolib.ToDoc... | Erdwolf/autotool-bonn | src/Robots/Solver.hs | gpl-2.0 | 3,788 | 71 | 20 | 1,171 | 1,561 | 808 | 753 | 108 | 2 |
----
-- Factorial.hs
-- by Daniel Brice
-- Invoke as `Factorial <num>`
-- Prints <num> factorial
----
import System.Environment (getArgs)
import Data.List (foldl')
factorial :: Integer -> Integer
factorial n = foldl' (*) 1 [1..n]
main = print . factorial . read . head =<< getArgs
| friedbrice/hemingway | Factorial/Factorial.hs | gpl-2.0 | 283 | 1 | 8 | 48 | 82 | 46 | 36 | 5 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-|
Module : Database/Hedsql/CRUD.hs
Description : CRUD pre-built queries.
Copyright : (c) Leonard Monnier, 2016
License : GPL-3
Maintainer : leonard.monnier@gmail.com
Stability : experimental
Portability : portable
Pre-built generic CRUD SQL statements which can then b... | momomimachli/Hedsql | src/Database/Hedsql/CRUD.hs | gpl-3.0 | 4,245 | 0 | 11 | 903 | 613 | 333 | 280 | 62 | 1 |
module MakeContents(
handleMakefileDescr
) where
import qualified Data.List as Lists
import System.Directory
import Split
import System.FilePath
import Parser
import qualified Scaner as SC
data Info1=Info1{proj_name :: String,
main_f :: S... | geva995/murlyka | src/Utils/MakeContents.hs | gpl-3.0 | 6,704 | 0 | 18 | 1,911 | 2,258 | 1,166 | 1,092 | 190 | 2 |
{- |
A self-contained audio playback machine.
* Load from any number of audio files
* Combine them in an arbitrary mix configuration
* Play/pause audio at any time, with precise knowledge of audio timing
Currently assumes all audio files are stereo, 44.1 kHz.
-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaC... | mtolly/jelly | src/Jelly/AudioPipe.hs | gpl-3.0 | 12,775 | 8 | 30 | 3,830 | 4,223 | 2,148 | 2,075 | 281 | 7 |
-- otsu algorithm for binarization
module Otsu (threshold, binarize) where
import qualified Data.Array.Repa as R
import qualified Data.Map as Map
import Data.Array.Repa (U, D, Z (..), (:.)(..))
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as Vm
import qualified Data.List as L... | mikolajsacha/HaskellPics | otsu.hs | gpl-3.0 | 2,555 | 1 | 24 | 792 | 1,022 | 575 | 447 | 55 | 6 |
{-# 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-importexport/gen/Network/AWS/ImportExport/ListJobs.hs | mpl-2.0 | 5,246 | 0 | 16 | 1,257 | 926 | 541 | 385 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/DicomStores/SearchForSeries.hs | mpl-2.0 | 7,869 | 0 | 17 | 1,431 | 794 | 471 | 323 | 126 | 1 |
module Network.HighHock.Controller (
Controller,
newController,
stop,
trigger,
wait,
isStopped,
ticker) where
import Control.Monad (void, when)
import qualified Control.Concurrent.STM.TMVar as STM
import Control.Monad.STM (atomically)
import Control.Concurrent (threadDelay)
import Data.Maybe (fromMaybe)
... | bluepeppers/highhockwho | src/Network/HighHock/Controller.hs | agpl-3.0 | 1,320 | 0 | 12 | 264 | 478 | 239 | 239 | 42 | 2 |
{-# LANGUAGE TemplateHaskell #-}
--------------------------------------------------
-- |
-- Module : Crypto.Noise.Internal.CipherState
-- Maintainer : John Galt <jgalt@centromere.net>
-- Stability : experimental
-- Portability : POSIX
module Crypto.Noise.Internal.CipherState where
import Control.Exception.Safe... | centromere/cacophony | src/Crypto/Noise/Internal/CipherState.hs | unlicense | 2,721 | 0 | 14 | 747 | 560 | 294 | 266 | 50 | 1 |
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
{-
Copyright 2019 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a c... | pranjaltale16/codeworld | codeworld-base/src/Internal/Picture.hs | apache-2.0 | 11,092 | 0 | 13 | 1,984 | 3,109 | 1,667 | 1,442 | -1 | -1 |
module Clear ( ClearTag(..)
, parseClear
) where
import Text.Parsec.Combinator (choice)
import Data.Maybe (fromJust)
import ClassyPrelude
import Common
data ClearTag = Clear String
| ClearAll String
deriving (Show, Eq)
parseClear :: PParser ClearTag
parseClear =... | gamelost/pcgen-rules | src/Clear.hs | apache-2.0 | 1,345 | 0 | 10 | 546 | 265 | 147 | 118 | 34 | 1 |
#!/usr/local/bin/perl
##########################################################
##Check for referer, if not user is jumped to Home Page #
##########################################################
@referers = ('www.coastlinemicro.com','coastlinemicro.com');
&check_url;
sub check_url {
# Localize the check_ref... | drlouie/public-views | _client-workareas/COASTLINE/backup/03022001/referer.hs | apache-2.0 | 1,110 | 40 | 9 | 297 | 235 | 153 | 82 | -1 | -1 |
import P10
data ListItem a = Single a | Multiple Int a
deriving (Show)
encodeModified :: (Eq a) => [a] -> [ListItem a]
encodeModified xs = map (\s -> if fst s == 1 then Single (snd s) else Multiple (fst s) (snd s)) (encode xs)
| plilja/h99 | p11.hs | apache-2.0 | 234 | 0 | 11 | 53 | 123 | 65 | 58 | 5 | 2 |
module Laborantin (
prepare
, load
, remove
, runAnalyze
, missingParameterSets
, expandParameterSets
) where
import Laborantin.Types
import Laborantin.Query
import Laborantin.Implementation
import Control.Monad.IO.Class
import Control.Monad.Reader
import Control.Monad.State
im... | lucasdicioccio/laborantin-hs | Laborantin.hs | apache-2.0 | 4,262 | 0 | 18 | 1,057 | 959 | 501 | 458 | 61 | 1 |
{-# language TypeSynonymInstances #-}
{-# language LiberalTypeSynonyms #-}
module FrequencyResponse
(Analyzer (..),
AnalyzerAcyclic (..),
Spectrum (..),
SpecLin (..),
SpecWide ,
getResponse,
getResponseLin,
getResponseAcyclic)
where
import CLaSH.Prelude (Default(..))
import Prelude
import CLaSH.Sign... | ra1u/frequency-response | src/FrequencyResponse.hs | bsd-3-clause | 7,832 | 0 | 15 | 1,727 | 2,592 | 1,408 | 1,184 | 140 | 2 |
{-# LANGUAGE CPP #-}
module Servant.EDE.Internal.Validate where
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative
import Data.Foldable
import Data.Traversable
#endif
import Data.Functor.Compose
import Data.Semigroup
data Validated e a = OK a | NotOK e
deriving (Eq, Show)
instance Functor (Validated e) wher... | alpmestan/servant-ede | src/Servant/EDE/Internal/Validate.hs | bsd-3-clause | 2,024 | 0 | 9 | 516 | 1,005 | 492 | 513 | 53 | 1 |
module Test.QuickCheck.Instances.Eq (notEqualTo, notOneof) where
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Control.Monad.Extensions
notEqualTo :: (Eq a,Arbitrary a) => a -> Gen a -> Gen a
notEqualTo v = satisfiesM (/= v)
notOneof :: (Eq a,Arbitrary a) => [a] -> Gen a
notOneof es = arbitrarySatisf... | bitemyapp/checkers | src/Test/QuickCheck/Instances/Eq.hs | bsd-3-clause | 346 | 0 | 8 | 52 | 136 | 77 | 59 | 8 | 1 |
module Rfc6979Ex where
import Functions
import qualified Crypto.Hash.SHA1 as SHA1
import qualified Crypto.Hash.SHA256 as SHA256
q1 = 0x996f967f6c8e388d9e28d01e205fba957a5698b1
x1 = 0x411602cb19a6ccc34494d79d98ef1e7ed5af25f7
q2 = 0xf2c3119374ce76c9356990b465374a17f23f9ed35089bd969f61c6dde9998c1f
x2 = 0x69c7548c21d0d... | YoshikuniJujo/forest | subprojects/tls-analysis/rfc6979/examples2.hs | bsd-3-clause | 485 | 0 | 4 | 38 | 55 | 37 | 18 | 10 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module JKF.TypeSpec where
import Data.Aeson
import Data.HashMap.Strict (fromList)
import JKF.Type
import Test.Hspec
spec :: Spec
spec = do
let h1 = Header "habu" "moriuchi" "2015-10-28 07:43" "2015-10-28 20:40" "hirate"
h2 = Header "" ... | suzuki-shin/jkf-hs | test/JKF/TypeSpec.hs | bsd-3-clause | 2,150 | 0 | 24 | 730 | 507 | 276 | 231 | 44 | 1 |
module Problems.Problem3 where
import qualified Lib.Math as Math
getSolution :: Int
getSolution = head $ filter f valsDesc
where
num = 600851475143
maxVal = Math.maxPossiblePrimeFactor num
valsDesc = [maxVal, maxVal - 1 .. 2]
f :: Int -> Bool
f n = num `mod` n == 0 && Math.isPrime n
| sarangj/eulerhs | src/Problems/Problem3.hs | bsd-3-clause | 309 | 0 | 9 | 75 | 104 | 59 | 45 | 9 | 1 |
{-# OPTIONS_GHC -Wall -Werror #-}
module Main(main) where
import System.IO
import Text.PrettyPrint.Pp(
render,
above,
pp)
import qualified Lobster.SELinux.SELinux as SELinux
import Lobster.Common
main :: IO ()
main = do
(options,fns) <- processOptions
domain <- parseAndInterpretPolicyFiles_ options fns
l... | GaloisInc/sk-dev-platform | libs/lobster-selinux/src/Lobster/SELinux/Main.hs | bsd-3-clause | 607 | 0 | 17 | 95 | 206 | 109 | 97 | 19 | 1 |
module Test (main) where
import FFI
import HtmlCanvas
import Prelude
main :: Fay ()
main = do
addEventListener "load" start False
start :: Fay ()
start = do
canvas <- getElementById "can"
context <- getContext "2d" canvas
setFillStyle "rgb(200,0,0)" context
fillRect 0 0 10 10 ... | svaiter/fay-canvas | test.hs | bsd-3-clause | 328 | 0 | 8 | 89 | 102 | 50 | 52 | 13 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
module System.Win32.DHCP.DhcpStructure where
import Control.Monad (when)
import Import
-- |Function dictionary for objects used with the DHCP api.
-- * Ability to peek from a pointer to that object.
-- * Ability to properly free an object using Win3... | mikesteele81/Win32-dhcp-server | src/System/Win32/DHCP/DhcpStructure.hs | bsd-3-clause | 7,533 | 0 | 14 | 1,718 | 1,812 | 932 | 880 | 96 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Client.ClientStaticT where
import Control.Lens (makeLenses)
import qualified Data.ByteString as B
import QCommon.NetChanT
import Types
makeLenses ''ClientStaticT
newClientStaticT :: ClientStaticT
newClientStaticT = ClientStaticT
{ _csSta... | ksaveljev/hake-2 | src/Client/ClientStaticT.hs | bsd-3-clause | 1,051 | 0 | 6 | 404 | 185 | 120 | 65 | 31 | 1 |
-- | Detailed audio sample description.
module Data.ByteString.IsoBaseFileFormat.Boxes.AudioSampleEntry where
import Data.ByteString.IsoBaseFileFormat.Box
import Data.ByteString.IsoBaseFileFormat.Boxes.Handler
import Data.ByteString.IsoBaseFileFormat.ReExports
import Data.ByteString.IsoBaseFileFormat.Util.BoxContent
i... | sheyll/isobmff-builder | src/Data/ByteString/IsoBaseFileFormat/Boxes/AudioSampleEntry.hs | bsd-3-clause | 1,191 | 0 | 15 | 214 | 305 | 168 | 137 | -1 | -1 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Configure
-- Copyright : (c) David Himmelstrup 2005,
-- Duncan Coutts 2005
-- License : BSD-like
--
-- Maintainer : cabal-devel@haskell.org
-- Portab... | lukexi/cabal | cabal-install/Distribution/Client/Configure.hs | bsd-3-clause | 15,577 | 9 | 22 | 4,492 | 2,524 | 1,376 | 1,148 | 273 | 3 |
{-# LANGUAGE CPP, ForeignFunctionInterface, BangPatterns #-}
#if __GLASGOW_HASKELL__
{-# LANGUAGE DeriveDataTypeable #-}
#endif
{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.ByteString.Lazy.Internal
-- Copyright : (c) Don Stewart 2006-2008
-- (c) Duncan Coutts 2006-2011
-- License : BSD-s... | markflorisson/hpack | testrepo/bytestring-0.10.2.0/Data/ByteString/Lazy/Internal.hs | bsd-3-clause | 8,289 | 0 | 18 | 1,927 | 1,979 | 1,064 | 915 | 126 | 6 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Build the project.
module Stack.Build
(build
,loadPackage
,mkBaseConfigOpts
,queryBuildInfo
,... | juhp/stack | src/Stack/Build.hs | bsd-3-clause | 15,564 | 0 | 25 | 4,475 | 3,136 | 1,624 | 1,512 | 284 | 6 |
{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances -fallow-overlapping-instances #-}
{-# LANGUAGE MagicHash, UndecidableInstances, OverlappingInstances #-}
module Idris.RunIO where
-- import SimplDSL
import Ivor.TT
import Ivor.Shell
import Ivor.Construction
import Data.Typeable
import Data.IORef
import Sy... | avsm/Idris | Idris/RunIO.hs | bsd-3-clause | 5,393 | 0 | 15 | 1,770 | 1,971 | 955 | 1,016 | 144 | 2 |
module Widgets where
import Graphics.UI.Threepenny.Core
import qualified Graphics.UI.Threepenny as UI
import Control.Applicative
import Control.Monad (void, mapM, zipWithM_)
collapsiblePanel :: String -> UI Element -> String -> [UI Element] -> UI Element
collapsiblePanel ident titleLevel title contents = do
toggle... | ocramz/CurveProject | src/Widgets.hs | bsd-3-clause | 2,249 | 0 | 19 | 515 | 874 | 435 | 439 | 50 | 2 |
import qualified Database.Concelo.Ignis as Ignis
main = Ignis.main
| Concelo/concelo | src/Main.hs | bsd-3-clause | 68 | 0 | 5 | 9 | 17 | 11 | 6 | 2 | 1 |
-- Problem 6: Sum square difference
--
-- https://projecteuler.net/problem=6
--
-- The sum of the squares of the first ten natural numbers is,
-- 1^2 + 2^2 + ... + 10^2 = 385
--
-- The square of the sum of the first ten natural numbers is,
-- (1 + 2 + ... + 10)^2 = 55^2 = 3025
--
-- Hence the difference between the sum... | moddyz/euler | p6/p6.hs | mit | 666 | 0 | 9 | 140 | 84 | 52 | 32 | 2 | 1 |
module ValidateTheWord where
import Data.List (elemIndex)
-- Use the Maybe type to write a function that
-- counts the number of vowels in a string and the
-- number of consonants. If the number of vowels
-- exceeds the number of consonants return Nothing.
-- In many human languages, vowels rarely exceed
-- the nu... | brodyberg/Notes | ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/ValidateTheWordChapter12.hs | mit | 908 | 0 | 10 | 224 | 187 | 102 | 85 | 19 | 3 |
module Graph.TreeWidth where
-- $Id$
import Graph.Util
import Autolib.Graph
import Autolib.Dot ( peng )
import Autolib.Graph.Basic
import Autolib.Graph.Ops
import Inter.Types
import Autolib.ToDoc
import Autolib.Size
import Autolib.Set
import Autolib.FiniteMap
import qualified Challenger as C
import Data.Typeable
i... | florianpilz/autotool | src/Graph/TreeWidth.hs | gpl-2.0 | 3,621 | 53 | 18 | 1,228 | 1,302 | 664 | 638 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
module HplAssets.Hephaestus.Types where
import Language.Haskell.Syntax
import Data.Generics
data HephaestusTransformation
= SelectBaseProduct
| SelectAsset String
| SelectExport String
| BindProductName String
| RemoveProductMainFunction
| SelectCKParser
deriv... | rbonifacio/hephaestus-pl | src/meta-hephaestus/HplAssets/Hephaestus/Types.hs | lgpl-3.0 | 454 | 0 | 7 | 71 | 88 | 53 | 35 | 14 | 0 |
{-# LANGUAGE MagicHash #-}
module Foundation.Foreign.Alloc
( allocaBytes
) where
import qualified Foreign.Marshal.Alloc as A (allocaBytes)
import Basement.Imports
import Basement.Types.OffsetSize
allocaBytes :: CountOf Word8 -> (Ptr a -> IO b) -> IO b
allocaBytes (CountOf i) f = A.allocaBy... | vincenthz/hs-foundation | foundation/Foundation/Foreign/Alloc.hs | bsd-3-clause | 328 | 0 | 9 | 71 | 93 | 52 | 41 | 8 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
-- |
-- Module: $HEADER$
-- Description: TODO
-- Copyright: (c) 2016 Peter Trško
-- License: BSD3
--
-- Stability: experimental
-- Portability: GHC specific language extensions.
--
-- TODO
module Data.DHT.DKS.Type.EVar
where
import Control.Applicative (pure)
impo... | FPBrno/dht-dks | src/Data/DHT/DKS/Type/EVar.hs | bsd-3-clause | 797 | 0 | 7 | 148 | 219 | 130 | 89 | 19 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Stack.Config.Urls (urlsFromMonoid) where
import Stack.Types.Urls
import Stack.Prelude
urlsFromMonoid :: UrlsMonoid -> Urls
urlsFromMonoid monoid =
Urls
(fromFirst defaultLatestSnapshot $ urlsMonoidLatestSn... | MichielDerhaeg/stack | src/Stack/Config/Urls.hs | bsd-3-clause | 812 | 0 | 8 | 155 | 105 | 57 | 48 | 17 | 1 |
module Tst1 where
data Bool = False | True
data Nat = Zero | Succ Nat
-- length :: [a] -> Nat
length [] = Zero
length (x:xs) = Succ (length xs)
-- map :: (a->b) -> [a] -> [b]
map f [] = []
map f (x:xs) = f x:map f xs
mapLengthProp f xs = length (map f xs) == length xs
---
Zero == Zero = True
Succ _ =... | forste/haReFork | tools/hs2alfa/tst1.hs | bsd-3-clause | 386 | 0 | 8 | 112 | 194 | 96 | 98 | 12 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.