_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
fe5138fc4873de214a26c0afa3f4db1d3fd6062473fa614f22e78d4d37a9a239 | realworldocaml/mdx | library.mli |
* Copyright ( c ) 2019 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/realworldocaml/mdx/4d8e7e8321faeeabe7091fbe2e901e64ab19dc06/lib/library.mli | ocaml | * [from_string s] returns the library represented by [s] or an error if [s]
isn't a valid library.
* Set of libraries
* [to_package_set lib_set] returns the set of dune packages needed to get
all the libraries in [lib_set].
I.e. it's the set of basenames for all the libraries in [lib_set]. |
* Copyright ( c ) 2019 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
ebab1e56bc196e46c3f109629fe87728df4717f73f6e2528e83af5505c41b290 | sdiehl/elliptic-curve | SECT571K1.hs | module Data.Curve.Binary.SECT571K1
( module Data.Curve.Binary
, Point(..)
-- * SECT571K1 curve
, module Data.Curve.Binary.SECT571K1
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Binary
----------------------------------------------------------------------... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/src/Data/Curve/Binary/SECT571K1.hs | haskell | * SECT571K1 curve
-----------------------------------------------------------------------------
Types
-----------------------------------------------------------------------------
| SECT571K1 curve.
| Field of points of SECT571K1 curve.
SECT571K1 curve is a binary curve.
# INLINABLE a_ #
# INLINABLE h_ #
# INLINAB... | module Data.Curve.Binary.SECT571K1
( module Data.Curve.Binary
, Point(..)
, module Data.Curve.Binary.SECT571K1
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Binary
data SECT571K1
type F2m = Binary P
type P = 0x800000000000000000000000000000000000000000000... |
c332ab0b96d89c41b82b6deabe175cbe6e14677688bf1931a3f17e60e42a74f6 | rajasegar/cl-warehouse | cl-warehouse.lisp | (in-package :cl-user)
(defpackage cl-warehouse-test
(:use :cl
:cl-warehouse
:prove))
(in-package :cl-warehouse-test)
(plan nil)
;; blah blah blah.
(finalize)
| null | https://raw.githubusercontent.com/rajasegar/cl-warehouse/cb6313d42ba5df49c54f9bf7a9e30734c6f6cbd9/tests/cl-warehouse.lisp | lisp | blah blah blah. | (in-package :cl-user)
(defpackage cl-warehouse-test
(:use :cl
:cl-warehouse
:prove))
(in-package :cl-warehouse-test)
(plan nil)
(finalize)
|
ecbde65535236fd6d489c2283e7aa74c06298d94f72f09f29fc8ac5466f64132 | hjcapple/reading-sicp | exercise_2_85.scm | #lang racket
P137 - [ 练习 2.85 ]
(require "ch2support.scm")
(require (submod "complex_number_data_directed.scm" complex-op))
;;;;;;;;;;;;;;;;;;;;;;;;
(define (attach-tag type-tag contents)
(cons type-tag contents))
(define (type-tag datum)
(if (pair? datum)
(car datum)
(error "Bad tagged datum -- ... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_2/exercise_2_85.scm | scheme |
过滤 #t、#f 等没有 type-tag 的参数
| #lang racket
P137 - [ 练习 2.85 ]
(require "ch2support.scm")
(require (submod "complex_number_data_directed.scm" complex-op))
(define (attach-tag type-tag contents)
(cons type-tag contents))
(define (type-tag datum)
(if (pair? datum)
(car datum)
(error "Bad tagged datum -- TYPE-TAG" datum)))
(defi... |
aba071e44543245003ff0df7c60c0101ac0e686079a787af0a951bd534ee6d56 | cram2/cram | quasi.lisp | ;; Quasi-random sequences in arbitrary dimensions.
, Sun Jul 16 2006 - 15:54
Time - stamp : < 2012 - 01 - 13 12:01:20EST quasi.lisp >
;;
Copyright 2006 , 2007 , 2008 , 2009 , 2011
Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/random/quasi.lisp | lisp | Quasi-random sequences in arbitrary dimensions.
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR ... | , Sun Jul 16 2006 - 15:54
Time - stamp : < 2012 - 01 - 13 12:01:20EST quasi.lisp >
Copyright 2006 , 2007 , 2008 , 2009 , 2011
Distributed under the terms of the GNU General Public License
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version ... |
fdfd8b751d0b19520afdf1263ed4bf4ab65b9652806a5a46ddbc2e92f76962cd | smahood/re-frame-conj-2016 | step9.cljs | (ns show.steps.step9
(:require
[reagent.core :as reagent]
[re-frame.core :as re-frame]
[re-frisk.core :as re-frisk]
[cljs.spec :as s]
[show.slides.views :as views]))
(declare slides)
(def initial-state
{:slideshow/current-slide 0})
(re-frame/reg-event-fx
:slideshow/next-slide
(fn [context... | null | https://raw.githubusercontent.com/smahood/re-frame-conj-2016/51fe544a5f4e95f28c26995c11d64301ba9a2142/show/src/show/steps/step9.cljs | clojure | (ns show.steps.step9
(:require
[reagent.core :as reagent]
[re-frame.core :as re-frame]
[re-frisk.core :as re-frisk]
[cljs.spec :as s]
[show.slides.views :as views]))
(declare slides)
(def initial-state
{:slideshow/current-slide 0})
(re-frame/reg-event-fx
:slideshow/next-slide
(fn [context... | |
3ddfa2d5839e0ab64953dd8318e948859caf47faff14dd203fa3ae16207b8f17 | pingles/bandit | ucb_test.clj | (ns bandit.algo.ucb_test
(:use [expectations]
[bandit.arms :only (arm exploit unpulled)]
[bandit.algo.ucb]))
;; picking unpulled arms
(expect 2 (count (unpulled [(arm :arm1) (arm :arm2)])))
(expect empty? (unpulled [(arm :arm1 :pulls 1)]))
;; selecting best performing
(expect (arm :arm1 :ucb-value 1... | null | https://raw.githubusercontent.com/pingles/bandit/795666f3938e28f389691094bb1e07e4202290f6/bandit-core/test/bandit/algo/ucb_test.clj | clojure | picking unpulled arms
selecting best performing
ucb bonus values
selecting arms | (ns bandit.algo.ucb_test
(:use [expectations]
[bandit.arms :only (arm exploit unpulled)]
[bandit.algo.ucb]))
(expect 2 (count (unpulled [(arm :arm1) (arm :arm2)])))
(expect empty? (unpulled [(arm :arm1 :pulls 1)]))
(expect (arm :arm1 :ucb-value 1)
(exploit :ucb-value [(arm :arm1 :ucb-value 1... |
1d5bb2c9e291d9c94f23f8a222e2808f9e1ee594818b15e788ea76a560448e28 | input-output-hk/cardano-base | Main.hs | module Main (main) where
import Criterion.Main
import Cardano.Crypto.Libsodium.Init
import qualified Bench.Crypto.DSIGN (benchmarks)
import qualified Bench.Crypto.KES (benchmarks)
import qualified Bench.Crypto.VRF (benchmarks)
main :: IO ()
main = do
sodiumInit
defaultMain benchmarks
benchmarks :: [Benchmar... | null | https://raw.githubusercontent.com/input-output-hk/cardano-base/eee4b00005284582faa79ad8a49b98d12aded6f6/cardano-crypto-tests/bench/Main.hs | haskell | module Main (main) where
import Criterion.Main
import Cardano.Crypto.Libsodium.Init
import qualified Bench.Crypto.DSIGN (benchmarks)
import qualified Bench.Crypto.KES (benchmarks)
import qualified Bench.Crypto.VRF (benchmarks)
main :: IO ()
main = do
sodiumInit
defaultMain benchmarks
benchmarks :: [Benchmar... | |
04dda8d439cb87da9a3ba5fbf2bf98db0cb2c99117272107cbb43d1c29010c59 | autolwe/autolwe | SimpRules.mli | (* * Simplification rules *)
open Tactic
val t_simp : bool -> int -> tactic
val t_ctx_ev_maybe : int option -> tactic
val t_split_ineq : int -> tactic
| null | https://raw.githubusercontent.com/autolwe/autolwe/3452c3dae06fc8e9815d94133fdeb8f3b8315f32/src/Derived/SimpRules.mli | ocaml | * Simplification rules |
open Tactic
val t_simp : bool -> int -> tactic
val t_ctx_ev_maybe : int option -> tactic
val t_split_ineq : int -> tactic
|
8a68d12304c2e3a489df53ac4361f9c6b97da7548f7991cf84d9583ad131e08b | petertseng/adventofcode-hs-2015 | 03_delivery_grid.hs | import AdventOfCode (readInputFile)
import Data.Containers.ListUtils (nubOrd)
tested to be faster than using a Set ,
-- and also faster than using group . sort
type Pos = (Int, Int)
houses :: String -> [Pos]
houses = scanl move (0, 0)
move :: Pos -> Char -> Pos
move (x, y) c = case c of
'^' -> (x, y + 1)
'v... | null | https://raw.githubusercontent.com/petertseng/adventofcode-hs-2015/999f29d40230f731ec9ac34f3daf9ef50802616d/bin/03_delivery_grid.hs | haskell | and also faster than using group . sort
foldr because must preserve order
~ lazy pattern match:
(doesn't really matter for this input, but keep for education) | import AdventOfCode (readInputFile)
import Data.Containers.ListUtils (nubOrd)
tested to be faster than using a Set ,
type Pos = (Int, Int)
houses :: String -> [Pos]
houses = scanl move (0, 0)
move :: Pos -> Char -> Pos
move (x, y) c = case c of
'^' -> (x, y + 1)
'v' -> (x, y - 1)
'<' -> (x - 1, y)
'>' -... |
0c761eb3f711fd581cc753de674e9304dfbd8cbb0581ae2c5ce5427baa681e80 | chiroptical/snailscheme | IOSpec.hs | module Snail.IOSpec where
import Data.Either
import Snail.IO
import Test.Hspec
spec :: Spec
spec = do
describe "successfully lexes some basic snail files" $ do
it "lex a basic snail file" $ do
eResults <- readSnailFile "examples/basic.snail"
eResults `shouldSatisfy` isRight
it "lex an empty sna... | null | https://raw.githubusercontent.com/chiroptical/snailscheme/da7fbce2b9a29c1e9562467d913583ba1c6d62c9/test/Snail/IOSpec.hs | haskell | module Snail.IOSpec where
import Data.Either
import Snail.IO
import Test.Hspec
spec :: Spec
spec = do
describe "successfully lexes some basic snail files" $ do
it "lex a basic snail file" $ do
eResults <- readSnailFile "examples/basic.snail"
eResults `shouldSatisfy` isRight
it "lex an empty sna... | |
e1dcb0469e5a8c2b356152c5a47f8f2debd8e0128e5f882148d2bc06ea36e8fc | thephoeron/quipper-language | QWTFP.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
# LANGUAGE FlexibleContexts #
{-# OPTIONS -fconte... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/Algorithms/TF/QWTFP.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
# OPTIONS -fcontext-stack=50 #
The algorithm works by performing a Grover-based quantum walk on
We refer to this part of the algorith... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
# LANGUAGE FlexibleContexts #
| This module provides an implementation of the Quantum Walk for
the Triangle Finding Problem .
a larger graph /H/ , called the Hamming graph associated to
The overall algorithm is parameterized on int... |
ba33959f958507b3a57e9aba66de50a84c3c6a0ab3a05858d8326127bc628dd0 | ribelo/doxa | pick_api.cljc | (ns ribelo.doxa.pick-api
(:require
[ribelo.extropy :as ex]
[ribelo.doxa.util :as u]))
(defn -pick
([db ref]
(-pick db :* ref))
([db query ^clojure.lang.IPersistentVector ref]
(let [xs (persistent! (-pick db query (transient []) ref))]
(when (seq xs)
(if (= 1 (count xs))
(first xs... | null | https://raw.githubusercontent.com/ribelo/doxa/9739ad4b0f3f17503b203204fd5bdce8dfe3f439/src/main/ribelo/doxa/pick_api.cljc | clojure | (ns ribelo.doxa.pick-api
(:require
[ribelo.extropy :as ex]
[ribelo.doxa.util :as u]))
(defn -pick
([db ref]
(-pick db :* ref))
([db query ^clojure.lang.IPersistentVector ref]
(let [xs (persistent! (-pick db query (transient []) ref))]
(when (seq xs)
(if (= 1 (count xs))
(first xs... | |
34d0733f9c56a8f0457727a2228a6ec9cb2e9a54df39e47a74b4cbdac40709e7 | malcolmreynolds/GSLL | chebyshev.lisp | Regression test CHEBYSHEV for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST CHEBYSHEV
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 0.7159209901689866d0 -1.5019966658054353d0
0.172397194... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/chebyshev.lisp | lisp | Regression test CHEBYSHEV for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST CHEBYSHEV
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 0.7159209901689866d0 -1.5019966658054353d0
0.172397194... | |
ce4dbce620327f0b2c6936bae3c08eeb6efae8aaaa008945d5f2083fec370a1e | modular-macros/ocaml-macros | scanf.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/stdlib/scanf.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2002 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open CamlinternalFormatBasics
open CamlinternalFormat
type ('a, 'b, 'c, 'd, 'e, 'f) format6 =
('a, 'b... |
26f7fdf00bf48dee132c9b0eef59e4cb7114cb671f81c406e797ffc15aeaf546 | jbrisbin/amqp_client | amqp_rpc_client.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/jbrisbin/amqp_client/d50aec00b94f0766a048b4eceaf25ddfdeeb1d86/src/amqp_rpc_client.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
@doc This modul... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2016 Pivotal Software , Inc. All rights reserved .
... |
6bcfe32f30d2883094d877110f40e8785c547c80ebd8d4aae16cc0f0ca1dd418 | haskell-opengl/OpenGLRaw | FragmentCoverageToColor.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.FragmentCoverageToColor
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
---------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/NV/FragmentCoverageToColor.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.NV.FragmentCoverageToColor
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
* ... | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.NV.FragmentCoverageToColor (
glGetNVFragmentCoverageToColor,
gl_NV_fragment_coverage_to_color,
pattern GL_FRAGMENT_COVERAGE_COLOR_NV,
pattern GL_FRAGMENT_COVERAGE_TO_COLOR_NV,
glFragmentCoverageColorNV
)... |
655a5ff10719f3a1b822afe64fa889229bbb9e4677da13e477d4f296062a8d66 | statebox/cql | CQL.hs |
SPDX - License - Identifier : AGPL-3.0 - only
This file is part of ` statebox / cql ` , the categorical query language .
Copyright ( C ) 2019 <
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 S... | null | https://raw.githubusercontent.com/statebox/cql/b155e737ef4977ec753e44790f236686ff6a4558/src/Language/CQL.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE ExplicitForAll #
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTs #
# LANGUAGE LiberalTypeSynonyms #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE TypeSynonymInstances ... |
SPDX - License - Identifier : AGPL-3.0 - only
This file is part of ` statebox / cql ` , the categorical query language .
Copyright ( C ) 2019 <
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 S... |
50a56d487e5d0761c3db05769f6b5ecb3097f81679bcc8b5c15ef5b13219b656 | corecursive/sicp-study-group | exercise-1.3.scm | Exercise 1.3 .
;;
Define a procedure that takes three numbers as arguments and
returns the sum of the squares of the two larger numbers .
(define (square x) (* x x))
(define (sum-of-squares x y)
(+ (square x) (square y)))
(define (max x y)
(if (> x y) x y))
(define (min x y)
(if (< x y) x y))
(define (... | null | https://raw.githubusercontent.com/corecursive/sicp-study-group/145b2d48ce0fd6108c4568b0c3d206fbea7a3fcf/wulab/exercises/exercise-1.3.scm | scheme | Exercise 1.3 .
Define a procedure that takes three numbers as arguments and
returns the sum of the squares of the two larger numbers .
(define (square x) (* x x))
(define (sum-of-squares x y)
(+ (square x) (square y)))
(define (max x y)
(if (> x y) x y))
(define (min x y)
(if (< x y) x y))
(define (ex1... | |
603ee1f7aca517df45140eef30adead873ef08622fcb157da92558c1256a3dee | lambe-lang/nethra | t10_infer_function.ml | open Common
open Preface.Option.Functor
open Nethra.Lang.Ast.Term.Construct
open Nethra.Lang.Ast.Proof
open Nethra.Lang.Ast.Proof.Destruct
open Nethra.Lang.Ast.Hypothesis.Construct
open Nethra.Lang.Ast.Hypothesis.Access
open Nethra.Lang.System.Type
module Theory = struct
let type_in_type = true
end
module rec TypeI... | null | https://raw.githubusercontent.com/lambe-lang/nethra/892b84deb9475021b95bfa6274dc8b70cb3e44ea/test/nethra/lang/system/s03_typer/t10_infer_function.ml | ocaml | open Common
open Preface.Option.Functor
open Nethra.Lang.Ast.Term.Construct
open Nethra.Lang.Ast.Proof
open Nethra.Lang.Ast.Proof.Destruct
open Nethra.Lang.Ast.Hypothesis.Construct
open Nethra.Lang.Ast.Hypothesis.Access
open Nethra.Lang.System.Type
module Theory = struct
let type_in_type = true
end
module rec TypeI... | |
c57232ee33d1b656fb4b8595634b340dd2acb8896c7c8a57c3ac40690d4fbef3 | OCamlPro/operf-micro | option_array.mli |
include module type of Nullable_array_interface
| null | https://raw.githubusercontent.com/OCamlPro/operf-micro/d5d2bf2068204b889321b0c5a7bc0d079c0fca80/share/operf-micro/benchmarks/nullable_array/option_array.mli | ocaml |
include module type of Nullable_array_interface
| |
6adb288579e3947436152f231c0a9a9d065b0e8408b762a49b3322dc3ffd69e7 | serokell/servant-util | Base.hs | module Servant.Util.Combinators.Sorting.Base
( SortingParams
, SortParamsExpanded
, SortingSpec (..)
, ssBase
, ssAll
, SortingOrder (..)
, NullsSortingOrder (..)
, SortingItemTagged (..)
, SortingItem (..)
, TaggedSortingItemsList
, SortingOrderType (..)
, ReifySortingIt... | null | https://raw.githubusercontent.com/serokell/servant-util/290f0e6db5204ca64f54374a06bdc98cfbf4cda2/servant-util/src/Servant/Util/Combinators/Sorting/Base.hs | haskell | | Order of sorting.
| Where to place null fields.
| For a given field, user-supplied order of sorting.
This type is primarly for internal use, see also 'SortingItemTagged'.
^ Name of parameter.
^ Sorting order on the given parameter.
, siNullsOrder :: Maybe NullsSortingOrder
-- ^ Order of null fields.
Present o... | module Servant.Util.Combinators.Sorting.Base
( SortingParams
, SortParamsExpanded
, SortingSpec (..)
, ssBase
, ssAll
, SortingOrder (..)
, NullsSortingOrder (..)
, SortingItemTagged (..)
, SortingItem (..)
, TaggedSortingItemsList
, SortingOrderType (..)
, ReifySortingIt... |
8267b2ca3e87a89e097d9fe89e2204772fe6bb92d27e26f98b0eae035a380683 | brendanhay/terrafomo | Provider.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
Module : . OVH.Provider
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer ... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-ovh/gen/Terrafomo/OVH/Provider.hs | haskell | This module is auto-generated.
|
Stability : auto-generated
* OVH Specific Aliases
* OVH Configuration
^ @application_key@
- (Optional)
^ @application_secret@
- (Optional)
^ @consumer_key@
- (Optional)
- (Required)
^ The minimal/required arguments.
| The required arguments for 'newProvider'.
^ (Requir... |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# OPTIONS_GHC -fno - warn - unused - imports #
Module : . OVH.Provider
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay+ >
Portability : ... |
f2598ec9647559345923cb2a2869cbefc4c52d63b3a32257559525c73d29c949 | xmonad/xmonad-contrib | Place.hs | # LANGUAGE TupleSections #
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.Place
-- Description : Automatic placement of floating windows.
Copyright : < >
-- License : BSD-style (see LICENSE)
--
-- Maintainer : orphaned
-- Stability :... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/e2ffa533da76e6375179eff942bb0647dd22fb58/XMonad/Hooks/Place.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Hooks.Place
Description : Automatic placement of floating windows.
License : BSD-style (see LICENSE)
Maintainer : orphaned
Stability : unstable
Portability : unportable
Automatic placement of floati... | # LANGUAGE TupleSections #
Copyright : < >
placeFocused
, placeHook
, Placement
, smart
, simpleSmart
, fixed
... |
7737002a2b8bfbc61faca1ba89427ad75d69c94a3690a33f485b5ab575528e4b | agda/agda | Warshall.hs | # LANGUAGE TemplateHaskell #
module Internal.Utils.Warshall ( tests ) where
import Agda.Syntax.Common ( Nat )
import Agda.Utils.Warshall
import Data.List ( sort )
import qualified Data.Map as Map
import Data.Maybe
import Internal.Helpers
-- Testing ---------------------------------------------------------... | null | https://raw.githubusercontent.com/agda/agda/3543ef3df19228012a1ac5be766cc38fd2f65f6a/test/Internal/Utils/Warshall.hs | haskell | Testing ----------------------------------------------------------------
| Check that no edges get longer when completing a graph.
| Check that all transitive edges are added.
| Check that no edges are added between components.
----------------------------------------------------------------------
* All tests
----... | # LANGUAGE TemplateHaskell #
module Internal.Utils.Warshall ( tests ) where
import Agda.Syntax.Common ( Nat )
import Agda.Utils.Warshall
import Data.List ( sort )
import qualified Data.Map as Map
import Data.Maybe
import Internal.Helpers
genGraph :: Ord node => Float -> Gen edge -> [node] -> Gen (AdjList... |
89d91dc1d7aa017b6bd9cd5118c89cc536377f04af14b282444d9af0b176f980 | johnlawrenceaspden/hobby-code | multimethods.clj | Clojure Multimethods
(defn ticket [age]
(cond (< age 16) :child
(> age 64) :ancient
:else :adult))
(defrecord person [name age])
(defmulti print-name (fn [person] (ticket (:age person))))
(defmethod print-name :child [person] (str "Young " (:name person)))
(defmethod print-name :adult ... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/multimethods.clj | clojure | And an alternative version | Clojure Multimethods
(defn ticket [age]
(cond (< age 16) :child
(> age 64) :ancient
:else :adult))
(defrecord person [name age])
(defmulti print-name (fn [person] (ticket (:age person))))
(defmethod print-name :child [person] (str "Young " (:name person)))
(defmethod print-name :adult ... |
37d42f052aa5084afac667a80dcf38448d72c73030cdaa5e36c31b250209242e | sjl/scully | gdl.lisp | (in-package :scully.gdl)
(in-readtable :fare-quasiquote)
;;;; Utils --------------------------------------------------------------------
(defvar *ggp-gensym-counter* 0)
(defun gensym-ggp ()
"Return a unique symbol in the `ggp-rules` package."
(values (intern (mkstr 'rule- (incf *ggp-gensym-counter*))
... | null | https://raw.githubusercontent.com/sjl/scully/d4b595c38f91d6235758fa8b11f2ab64b893394b/src/gdl.lisp | lisp | Utils --------------------------------------------------------------------
Files --------------------------------------------------------------------
Temperance ---------------------------------------------------------------
Normalization ------------------------------------------------------------
(head . bo... | (in-package :scully.gdl)
(in-readtable :fare-quasiquote)
(defvar *ggp-gensym-counter* 0)
(defun gensym-ggp ()
"Return a unique symbol in the `ggp-rules` package."
(values (intern (mkstr 'rule- (incf *ggp-gensym-counter*))
(find-package :ggp-rules))))
(defun move< (a b)
(string< (structural-s... |
3a264bf05f3f04f29779887b96ec32c1d29a08b3777d8f74807c50b106104070 | zsau/id3 | id3_test.clj | (ns id3-test
(:import [java.io ByteArrayInputStream ByteArrayOutputStream])
(:require
[clojure.spec.test.alpha :as stest]
[clojure.test :refer :all]
[id3 :refer :all]
[id3.common :refer :all]
[id3.spec]
[medley.core :as m]))
(stest/instrument)
(defn write-tag-to-bytes [tag opts]
(let [buf (ByteArrayOut... | null | https://raw.githubusercontent.com/zsau/id3/94635b5fe5edc4d4b3b70469126b4d849bae5c1b/test/id3_test.clj | clojure | extra byte for the encoding marker | (ns id3-test
(:import [java.io ByteArrayInputStream ByteArrayOutputStream])
(:require
[clojure.spec.test.alpha :as stest]
[clojure.test :refer :all]
[id3 :refer :all]
[id3.common :refer :all]
[id3.spec]
[medley.core :as m]))
(stest/instrument)
(defn write-tag-to-bytes [tag opts]
(let [buf (ByteArrayOut... |
afa0e6b93fdf38bbdda6348d6f438f2646ec7abac5d1dc98d1b0bbabbb91f322 | bcc32/projecteuler-ocaml | solutions.ml | open! Core
open! Import
(* TODO: Allow positional arg to pick just one, maybe using a regexp? *)
let list_solutions verbose =
List.iter Euler_solutions.all ~f:(fun (name, (module Sol : Solution.S)) ->
print_endline name;
if verbose then print_endline (" " ^ Sol.description))
;;
let verbose_arg =
Arg.(v... | null | https://raw.githubusercontent.com/bcc32/projecteuler-ocaml/da90c3f3c74e7309efc6eecb6e6cff4cdc7a888b/bin/solutions.ml | ocaml | TODO: Allow positional arg to pick just one, maybe using a regexp? | open! Core
open! Import
let list_solutions verbose =
List.iter Euler_solutions.all ~f:(fun (name, (module Sol : Solution.S)) ->
print_endline name;
if verbose then print_endline (" " ^ Sol.description))
;;
let verbose_arg =
Arg.(value & flag & info [ "v"; "verbose" ] ~doc:"Show solution descriptions")
... |
ea2b8d6aabf44f82c7098a81b505fd79edad61ea84a60849b2157b12fcd3774f | alicemaz/digital_henge | Zodiac.hs | module Zodiac () where
import Data.List
import Types
import Util
instance CheckEvent Zodiac where
checkEvent y m d = case findIndex (== (m, d)) zodiacDates of
Just i -> Event (toEnum i :: Zodiac) (dateToTimestring y' m' d')
where (y', m', d') = (toInteger y, toInteger m, fromRational (toRatio... | null | https://raw.githubusercontent.com/alicemaz/digital_henge/0a1c75a5088fc6f256179024b51ebbbf4381c9e4/src/Zodiac.hs | haskell | module Zodiac () where
import Data.List
import Types
import Util
instance CheckEvent Zodiac where
checkEvent y m d = case findIndex (== (m, d)) zodiacDates of
Just i -> Event (toEnum i :: Zodiac) (dateToTimestring y' m' d')
where (y', m', d') = (toInteger y, toInteger m, fromRational (toRatio... | |
669c0981deffa2609c29e9f3c7100d3e850e66ce07ae889fc22202f414414d39 | kind2-mc/kind2 | lustreGlobals.mli | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... | null | https://raw.githubusercontent.com/kind2-mc/kind2/c601470eb68af9bd3b88828b04dbcdbd6bd6bbf5/src/lustre/lustreGlobals.mli | ocaml | *
* Free constants
* Register bounds of state variables for later use | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... |
efe1fbb47b2a3f3d73e145463f72c2878468cba6dde1e9248c83e194a016e122 | sbcl/sbcl | stream.lisp | ;;;; os-independent stream functions
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and ... | null | https://raw.githubusercontent.com/sbcl/sbcl/077affa9121970175d78296c41d4793f62d96e13/src/code/stream.lisp | lisp | os-independent stream functions
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
standard streams
The initialization of these streams is performed by
STREAM-COLD-INIT-OR-RESET.
stream mani... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-IMPL")
(defvar *terminal-io* () "terminal I/O stream")
(defvar *standard-input* () "default input stream")
... |
2053c51bd4d9c2e77f3f4e685502df5590cb39a88e0180e5cb9142e97504c3c7 | HunterYIboHu/htdp2-solution | ex232-eliminate-quasiquote.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex232-eliminate-quasiquote) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constru... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/intermezzo-quote-unquote/ex232-eliminate-quasiquote.rkt | racket | about the language level of this file in a form that our tools can easily process.
constants
eliminate the quasiquote and unquote with list.
Also written in nested list. | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex232-eliminate-quasiquote) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define title "ratings")
(check-expect... |
5fff07926b8456e61c49c7b5fb0ce7f720d22efe6301ef452fbbcca498fc54dc | bcc32/advent-of-code | game.ml | open! Core
open! Async
open! Import
let re =
Re.(
compile
(seq
[ group (rep1 digit)
; str " players; last marble is worth "
; group (rep1 digit)
; str " points"
]))
;;
type t =
{ players : int
; last_marble : int
}
let get () =
let%bind str = Reader.fi... | null | https://raw.githubusercontent.com/bcc32/advent-of-code/653c0f130e2fb2f599d4e76804e02af54c9bb19f/2018/09/game.ml | ocaml | open! Core
open! Async
open! Import
let re =
Re.(
compile
(seq
[ group (rep1 digit)
; str " players; last marble is worth "
; group (rep1 digit)
; str " points"
]))
;;
type t =
{ players : int
; last_marble : int
}
let get () =
let%bind str = Reader.fi... | |
c1c5825f5207538c21b36493044c03c4d1dd0fc10ad7d07cc7bcf9a415e45573 | Frama-C/Frama-C-snapshot | obfuscator_register.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/obfuscator/obfuscator_register.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
9cc5810abab6a80e127ab988877417256b32fc6f8248fd3bbc415d4e28995e40 | AndrewMagerman/wizard-book-study | grader.rkt | #lang racket
(require (planet dyoo/simply-scheme))
(provide (all-defined-out))
(require rackunit)
(require rackunit/text-ui)
(require "chatterbot.rkt")
(define file-tests
(test-suite
"All tests for chatterbot"
(test-case
"babybot"
(check-equal?
(babybot '(I am babybot))
'(I am b... | null | https://raw.githubusercontent.com/AndrewMagerman/wizard-book-study/779854631f17164cbddecf3fde102504df1a83f0/reference/cs61as_library/chatterbot/grader.rkt | racket | Add more tests here
Add more tests here
Add more tests here
Add more tests here
Add more tests here
Add more tests here
Add more tests here
Add more tests here
Add more tests here
Add more tests here | #lang racket
(require (planet dyoo/simply-scheme))
(provide (all-defined-out))
(require rackunit)
(require rackunit/text-ui)
(require "chatterbot.rkt")
(define file-tests
(test-suite
"All tests for chatterbot"
(test-case
"babybot"
(check-equal?
(babybot '(I am babybot))
'(I am b... |
929485a37c6a00c9d133a995e1f63cc2db24f40994afd0b824bcdc013ee47ff5 | danmey/ocaml-gui | blocks.ml | open Widget
open Draw
open Window
open GL
open Glu
type stickiness = TopBottom | LeftRight
let expand_rect_left dx rect constr =
let real_dx = ( dx / constr) * constr in
{ rect with
Rect.x = rect.Rect.x + real_dx;
Rect.w = rect.Rect.w - real_dx }
let block_cmp l r =
let y = r.Rect.y - l.Rect.y in
if y... | null | https://raw.githubusercontent.com/danmey/ocaml-gui/e446fae0af7e0e07414c7970514e2d02166b4293/blocks.ml | ocaml | method delete_properties =
List.iter (fun (_,widget) -> Window.remove self # window widget # window) widgets;
widgets <- []
end and block name = object ( self : 'self )
method paint state =
&& x2 + w2 <= x1 + w1 | open Widget
open Draw
open Window
open GL
open Glu
type stickiness = TopBottom | LeftRight
let expand_rect_left dx rect constr =
let real_dx = ( dx / constr) * constr in
{ rect with
Rect.x = rect.Rect.x + real_dx;
Rect.w = rect.Rect.w - real_dx }
let block_cmp l r =
let y = r.Rect.y - l.Rect.y in
if y... |
e6df98c4366df9e497fd2f5bca514b4a4b2fdd35d4b311534a0da6b4a24e0d65 | locusmath/locus | all.clj | (ns locus.number.sequence.all
(:refer-clojure :exclude [+ - * /])
(:require [locus.set.logic.core.set :refer :all :exclude [add]]
[locus.set.logic.numeric.natural :refer [factors]]
[locus.set.logic.structure.protocols :refer :all]
[locus.set.quiver.structure.core.protocols :refer... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/number/sequence/all.clj | clojure | Here we define a special number sequence data type for dealing with rings
of sequences over number fields.
Get the consecutive sums, differences, products and divisions
Inverse sequences
Functions for creating integer sequences
Nth negative integer
The fundamental polygonal number sequences
Centered figurate nu... | (ns locus.number.sequence.all
(:refer-clojure :exclude [+ - * /])
(:require [locus.set.logic.core.set :refer :all :exclude [add]]
[locus.set.logic.numeric.natural :refer [factors]]
[locus.set.logic.structure.protocols :refer :all]
[locus.set.quiver.structure.core.protocols :refer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.