_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 |
|---|---|---|---|---|---|---|---|---|
27d81e2bee15025ae9af32aba3e3f5dd84f0df4057172a5179c5668b9431f389 | leftaroundabout/manifolds | Manifold.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE UndecidableInstances #
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE UnicodeSyn... | null | https://raw.githubusercontent.com/leftaroundabout/manifolds/55330e7760fa8ea8948988a10a06bbf19e69b5f5/manifold-random/Data/Random/Manifold.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
|
@
@
| A shade can be considered a specification for a generalised normal distribution.
If you use 'rvar' to sample a large number of points from a shade @sh@ in a suffic... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE UnicodeSyntax #
module Data.Random.Manifold (shade, shadeT, D_S, uncertainFunctionSamplesT, uncrtFuncIntervalSpls) where
import Prelude hiding (($))
import... |
86f4e702765223869baab171c12ec8dc4acafea49ed8061c4b78ae6ac82d9ae0 | SimulaVR/godot-haskell | GDScriptFunctionState.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.GDScriptFunctionState
(Godot.Core.GDScriptFunctionSt... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/GDScriptFunctionState.hs | haskell | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.GDScriptFunctionState
(Godot.Core.GDScriptFunctionSt... | |
0bae8ae88c8bff8c5330e0d2e086d9df8ff28e0b13da329f4679a9afc4ed11f5 | GaloisInc/cryptol | SeqMap.hs | -- |
Module : Cryptol . Backend . SeqMap
Copyright : ( c ) 2013 - 2021 Galois , Inc.
-- License : BSD3
-- Maintainer :
-- Stability : provisional
-- Portability : portable
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
{-... | null | https://raw.githubusercontent.com/GaloisInc/cryptol/8cca24568ad499f06032c2e4eaa7dfd4c542efb6/src/Cryptol/Backend/SeqMap.hs | haskell | |
License : BSD3
Maintainer :
Stability : provisional
Portability : portable
# LANGUAGE BangPatterns #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DoAndIfThenElse #
* Sequence Maps
| A sequence map represents a mapping from nonnegative integer indices
to values. These are used to represent both finite... | Module : Cryptol . Backend . SeqMap
Copyright : ( c ) 2013 - 2021 Galois , Inc.
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE ImplicitParams #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGu... |
436f5590d58ae83b6345735b8eca0385085a211a88c2345507dfe5ac383c0629 | dwango/fialyzer | constant.ml | open Base
type number = Int of int | Float of float
[@@deriving sexp_of]
type t =
| Number of number
| Atom of string
[@@deriving sexp_of]
let pp = function
| Number (Int i) -> Int.to_string i
| Number (Float f) -> Float.to_string f
| Atom a -> "'" ^ a ^ "'"
| null | https://raw.githubusercontent.com/dwango/fialyzer/3c4b4fc2dacf84008910135bfef16e4ce79f9c89/lib/constant.ml | ocaml | open Base
type number = Int of int | Float of float
[@@deriving sexp_of]
type t =
| Number of number
| Atom of string
[@@deriving sexp_of]
let pp = function
| Number (Int i) -> Int.to_string i
| Number (Float f) -> Float.to_string f
| Atom a -> "'" ^ a ^ "'"
| |
1eb53ae1638781ccc3354f51e48d65b023712422a25d9cab60cd692c9f75f185 | weblocks-framework/weblocks | uri-parameters-mixin.lisp |
(in-package :weblocks)
(export '(uri-parameters-mixin uri-parameters-slotmap))
(defclass uri-parameters-mixin ()
())
(defgeneric uri-parameters-slotmap (w)
(:documentation "Returns an alist of (slotname . param-name)")
(:method (w) (declare (ignore w)) nil))
(defgeneric uri-parameter-values (w)
(:documenta... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/src/widgets/widget/uri-parameters-mixin.lisp | lisp |
(in-package :weblocks)
(export '(uri-parameters-mixin uri-parameters-slotmap))
(defclass uri-parameters-mixin ()
())
(defgeneric uri-parameters-slotmap (w)
(:documentation "Returns an alist of (slotname . param-name)")
(:method (w) (declare (ignore w)) nil))
(defgeneric uri-parameter-values (w)
(:documenta... | |
9fd3d0cf90dd1dac6f67ce60bdac2b0ac6df18db2f8f7be7dc4c66869eaa93c7 | NalaGinrut/artanis | session.scm | -*- indent - tabs - mode : nil ; coding : utf-8 -*-
;; Copyright (C) 2013,2014,2015,2016,2017
" Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License publishe... | null | https://raw.githubusercontent.com/NalaGinrut/artanis/3412d6eb5b46fde71b0965598ba085bacc2a6c12/artanis/session.scm | scheme | coding : utf-8 -*-
Copyright (C) 2013,2014,2015,2016,2017
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License and GNU Lesser General Public License
for more details.
and GNU Lesser Gener... | " Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License published by the Free Software
Foundation , either version 3 of the License , or ( at your option )
A... |
a2d807ec954a9cf688fa630e7828744414d6b66903b12fa54b116da2306139de | decal/pathgro | path-slashes.scm | (define-module (pathgro base path-slashes)
#:export (append-slashes prepend-slashes unappend-slashes unprepend-slashes))
(use-modules (pathgro util stdio))
(define (prepend-slashes slst)
(if (null? slst)
'()
(if (string=? (substring (car slst) 0 1) "/")
(cons (car slst) (prepend-slashes... | null | https://raw.githubusercontent.com/decal/pathgro/48c4007611f9c4ae6ff24e50ae27615c65cad3b2/pathgro/base/path-slashes.scm | scheme | (define-module (pathgro base path-slashes)
#:export (append-slashes prepend-slashes unappend-slashes unprepend-slashes))
(use-modules (pathgro util stdio))
(define (prepend-slashes slst)
(if (null? slst)
'()
(if (string=? (substring (car slst) 0 1) "/")
(cons (car slst) (prepend-slashes... | |
832dd237e94e69cec8e59efee22123b785c9b5d23244e4d932b9917749ddfd50 | mentat-collective/functional-numerics | richardson_test.cljc | ;;
Copyright © 2020 .
This work is based on the Scmutils system of MIT / GNU Scheme :
Copyright © 2002 Massachusetts Institute of Technology
;;
;; This 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 ;... | null | https://raw.githubusercontent.com/mentat-collective/functional-numerics/44856b0e3cd1f0dd9f8ebb2f67f4e85a68aa8380/test/numerical/interpolate/richardson_test.cljc | clojure |
This is free software; you can redistribute it and/or modify
either version 3 of the License , or ( at
your option) any later version.
This software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR... | Copyright © 2020 .
This work is based on the Scmutils system of MIT / GNU Scheme :
Copyright © 2002 Massachusetts Institute of Technology
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(ns sicmutils.numerical.interpolat... |
f5ba7ae95888c5a4ea9ec1618f1081302fcd2a9cdb390ddfe9fa119c7c3b78fc | maximedenes/native-coq | closure.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/checker/closure.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
Flags for profiling reductions.... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Names
open Term
... |
1edfd51e8b0faf03814d3c4ab8f9f3b8e71c249caaabb2783de0ed245594e8bf | commercialhaskell/stack | Spec.hs | import Lib (cyclicOutput)
main :: IO ()
main = cyclicOutput
| null | https://raw.githubusercontent.com/commercialhaskell/stack/255cd830627870cdef34b5e54d670ef07882523e/test/integration/tests/multi-test/files/cyclic/Spec.hs | haskell | import Lib (cyclicOutput)
main :: IO ()
main = cyclicOutput
| |
6393e62860268b5801c59d84ef9afbc1586ecb5675237ada36126e9834ff4871 | Deaf-Clojurian/sudoku-solver | solver.clj | (ns sudoku-solver.wire.in.solver
(:require
[schema.core :as s]
[sudoku-solver.wire.common :as wire.common]))
(s/defschema MatrixInput wire.common/skeleton-io)
| null | https://raw.githubusercontent.com/Deaf-Clojurian/sudoku-solver/223ef9fd178f96f13747fc99a32d76c94d890729/src/sudoku_solver/wire/in/solver.clj | clojure | (ns sudoku-solver.wire.in.solver
(:require
[schema.core :as s]
[sudoku-solver.wire.common :as wire.common]))
(s/defschema MatrixInput wire.common/skeleton-io)
| |
0ee7d98de053f49514f43375c054d5ead40c54234a3fe2839bc61bf7adec6879 | xapi-project/xen-api-libs | mime.mli |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api-libs/d603ee2b8456bc2aac99b0a4955f083e22f4f314/http-svr/mime.mli | ocaml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | |
1de97f8b1b8afa2163ef24c3d1ad1dd35620a31afb4f54934343c2948ff05595 | metosin/tilakone | util.cljc | (ns tilakone.util
#?@(:cljs
[(:require [goog.string :as gstring]
[goog.string.format])]))
;;
Generic utils :
;;
(defn find-first [pred? coll]
(some (fn [v]
(when (pred? v)
v))
coll))
;;
State :
;;
(defn state [fsm state-name]
(->> fsm
:... | null | https://raw.githubusercontent.com/metosin/tilakone/616410a17f26ebd83a7ee20d6b0cd49bc5b89c64/modules/core/src/tilakone/util.cljc | clojure |
Helper to find guards or actions:
No state change:
Guards:
Transitions:
Actions:
| (ns tilakone.util
#?@(:cljs
[(:require [goog.string :as gstring]
[goog.string.format])]))
Generic utils :
(defn find-first [pred? coll]
(some (fn [v]
(when (pred? v)
v))
coll))
State :
(defn state [fsm state-name]
(->> fsm
:tilakone.cor... |
57f4b745ff4899225df720b3a575aa4dc5166633f3472a856411ea107737a7cd | robert-strandh/SICL | binary-not-greater-defmethods.lisp | (cl:in-package #:sicl-arithmetic)
(defmethod binary-not-greater ((x fixnum) (y fixnum))
(if (cleavir-primop:fixnum-not-greater x y) t nil))
(defmethod binary-not-greater ((x ratio) (y integer))
(binary-not-greater (ceiling (numerator x) (denominator x)) y))
(defmethod binary-not-greater ((x integer) (y ratio))
... | null | https://raw.githubusercontent.com/robert-strandh/SICL/8822ce17afe352923e0a08c79b010c4ef73d2011/Code/Arithmetic/binary-not-greater-defmethods.lisp | lisp | (cl:in-package #:sicl-arithmetic)
(defmethod binary-not-greater ((x fixnum) (y fixnum))
(if (cleavir-primop:fixnum-not-greater x y) t nil))
(defmethod binary-not-greater ((x ratio) (y integer))
(binary-not-greater (ceiling (numerator x) (denominator x)) y))
(defmethod binary-not-greater ((x integer) (y ratio))
... | |
2c97f4d2db5dfc69c8b010a36a39718806531f34965b3a669e67aa11bbeb118c | magnusjonsson/tidder-icfpc-2008 | bheap.scm | #lang scheme
;;;Binary heap implementation
(provide make insert! remove! empty?)
;;Extensible vectors combine fast random access with automatic memory management
(require "../../../libraries/scheme/evector/evector.scm")
;;Supporting functions and data structures
(define-struct node (priority value) #:transparent)
(d... | null | https://raw.githubusercontent.com/magnusjonsson/tidder-icfpc-2008/84d68fd9ac358c38e7eff99117d9cdfa86c1864a/playground/scheme/search-alt/bheap.scm | scheme | Binary heap implementation
Extensible vectors combine fast random access with automatic memory management
Supporting functions and data structures
Actual implementation
move things down until we find the right spot
root or right order?
no more children or out of bounds? | #lang scheme
(provide make insert! remove! empty?)
(require "../../../libraries/scheme/evector/evector.scm")
(define-struct node (priority value) #:transparent)
(define-struct bheap (>? e))
(define (higher? b i this)
((bheap->? b)
(node-priority (evector-ref (bheap-e b) i))
(node-priority this)))
(define (... |
e45575d43033390b1f397c94f74e26d16fdd630260d64250ed6bed184e4c81fe | svenpanne/EOPL3 | exercise-B-05.rkt | #lang eopl
; ------------------------------------------------------------------------------
Exercise B.5
See : exercise 2.5
(define empty-env
(lambda () '()))
(define extend-env
(lambda (var val env)
(cons (cons var val) env)))
(define apply-env
(lambda (initial-env search-var)
(letrec ((loop (lamb... | null | https://raw.githubusercontent.com/svenpanne/EOPL3/3fc14c4dbb1c53a37bd67399eba34cea8f8234cc/appendixB/exercise-B-05.rkt | racket | ------------------------------------------------------------------------------
See: exercise B.4
Note that we use the grammar for operators instead of the scanner spec now,
otherwise the scanner always emits add-op for "-", even for unary minus.
We use a separate production for a line of input to make the repl wor... | #lang eopl
Exercise B.5
See : exercise 2.5
(define empty-env
(lambda () '()))
(define extend-env
(lambda (var val env)
(cons (cons var val) env)))
(define apply-env
(lambda (initial-env search-var)
(letrec ((loop (lambda (env)
(cond ((null? env)
(rep... |
0e2bdbd687b7fd8a8a030634bf9eac7ffb14c68f64bb4fa6ef485dcf52af5823 | lnostdal/SymbolicWeb | html_template.clj | (in-ns 'symbolicweb.core)
(defn mk-HTMLTemplate "Bind Widgets to existing, static HTML.
CONTENT-FN is something like:
(fn [html-template]
[\".itembox\" html-template
\".title\" (mk-p title-model)
\".picture\" [:attr :src \"logo.png\"]
\"#sw-js-bootstrap\" (sw-js-bootstrap)]) ;; String."
^W... | null | https://raw.githubusercontent.com/lnostdal/SymbolicWeb/d9600b286f70f88570deda57b05ca240e4e06567/src/symbolicweb/html_template.clj | clojure | String."
Always manipulate a copy to avoid any concurrency problems.
Assign id to template instance.
Instantiate (clone) template and assign HTML attr. ID for it. | (in-ns 'symbolicweb.core)
(defn mk-HTMLTemplate "Bind Widgets to existing, static HTML.
CONTENT-FN is something like:
(fn [html-template]
[\".itembox\" html-template
\".title\" (mk-p title-model)
\".picture\" [:attr :src \"logo.png\"]
^WidgetBase [^org.jsoup.nodes.Document html-resource ^Fn con... |
d0f3f06ad740979c7ca3d00deebc8b19af8a4395afd886c3f315ba59f445c54a | S8A/htdp-exercises | ex304.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-intermediate-lambda-reader.ss" "lang")((modname ex304) (read-case-sensitive #t) (teachpacks ((lib "abstraction.rkt" "teachpack" "2htdp")))... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex304.rkt | racket | about the language level of this file in a form that our tools can easily process. | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex304) (read-case-sensitive #t) (teachpacks ((lib "abstraction.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "abstraction.rk... |
bc78a97b1bdbc54308ba509f259c9713803f591df7a1441f06d6567fe78db7d4 | metasoarous/odum | server.clj | (ns odum.server
(:require [taoensso.timbre :as log :include-macros true]
[com.stuartsierra.component :as component]
[org.httpkit.server :refer (run-server)]))
(defrecord HttpServer [config ring-handler server-stop]
component/Lifecycle
(start [component]
(if server-stop
component... | null | https://raw.githubusercontent.com/metasoarous/odum/92965d14c8f5702a1bdbfcfb2e44ebbfa41c8cab/src/clj/odum/server.clj | clojure | (ns odum.server
(:require [taoensso.timbre :as log :include-macros true]
[com.stuartsierra.component :as component]
[org.httpkit.server :refer (run-server)]))
(defrecord HttpServer [config ring-handler server-stop]
component/Lifecycle
(start [component]
(if server-stop
component... | |
23f055cff08e88cc96638a28dd56424e7455dfadd518dd3ad93443d85bce6dd4 | overtone/overtone | machine_listening.clj | (ns overtone.sc.machinery.ugen.metadata.machine-listening
(:use [overtone.sc.machinery.ugen common check]))
(def specs
[
{:name "BeatTrack",
:summary "Autocorrelation based beat tracker"
:args [{:name "chain"
:doc "Audio input to track, already passed through an FFT
the expected size of FF... | null | https://raw.githubusercontent.com/overtone/overtone/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/src/overtone/sc/machinery/ugen/metadata/machine_listening.clj | clojure | it is provided just as a convenience.
this is a variant of an MP3 perceptual model, summing
these are obtained from a band-based
:init (fn [rate args spec]
{:args args
the testing takes
this pattern is tried out at scalings
because of block-based amortisation of
{
*kr { | buffer |
... | (ns overtone.sc.machinery.ugen.metadata.machine-listening
(:use [overtone.sc.machinery.ugen common check]))
(def specs
[
{:name "BeatTrack",
:summary "Autocorrelation based beat tracker"
:args [{:name "chain"
:doc "Audio input to track, already passed through an FFT
the expected size of FF... |
67d37376bed360daff9dc73bb5c14e25357656eda531682542e357d7b95bfbee | DavidAlphaFox/RabbitMQ | rabbit_msg_store_index.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/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/src/rabbit_msg_store_index.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.
| 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 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
22a0194b5a1c0fae47a459a5a72b880e879436b9f7ebb9e78a3c6f781f8f92e4 | aeternity/aeternity | aemon_default_config_SUITE.erl | -module(aemon_default_config_SUITE).
%% common_test exports
-export(
[
all/0,
init_per_suite/1, end_per_suite/1,
init_per_testcase/2, end_per_testcase/2
]).
%% test case exports
-export([ dont_start_by_default/1 ]).
-include_lib("common_test/include/ct.hrl").
-include_lib("stdlib/include/assert.hrl... | null | https://raw.githubusercontent.com/aeternity/aeternity/b7ce6ae15dab7fa22287c2da3d4405c29bb4edd7/apps/aemon/test/aemon_default_config_SUITE.erl | erlang | common_test exports
test case exports
============================================================
Test cases
============================================================
Make sure application start but no workers are present | -module(aemon_default_config_SUITE).
-export(
[
all/0,
init_per_suite/1, end_per_suite/1,
init_per_testcase/2, end_per_testcase/2
]).
-export([ dont_start_by_default/1 ]).
-include_lib("common_test/include/ct.hrl").
-include_lib("stdlib/include/assert.hrl").
all() -> [ dont_start_by_default ].
in... |
85c40197c91441beb0720ff44d13bb64959d7eef809c716baef6e90da1a67d8b | inaka/erlang_guidelines | nesting.erl | -module(nesting).
-export([bad/0, good/0]).
bad() ->
case this:function() of
has ->
try too:much() of
nested ->
receive
structures ->
it:should_be(refactored);
into ->
several:other(functions)
end
catch
_:_ ->
... | null | https://raw.githubusercontent.com/inaka/erlang_guidelines/7a802a23a08d120db7e94115b4600b26194dd242/src/nesting.erl | erlang | -module(nesting).
-export([bad/0, good/0]).
bad() ->
case this:function() of
has ->
try too:much() of
nested ->
receive
structures ->
it:should_be(refactored);
into ->
several:other(functions)
end
catch
_:_ ->
... | |
a19dd38b633aa6d8bdc167e104f785b304835209b9acd02805bc53b275554f89 | osstotalsoft/functional-guy | 04.ConvertingNumbers.hs | myAverage aList = sum aList / length aList
myAverage aList = sum aList / fromIntegral (length aList)
myAverage' aList = sum aList `div` length aList
half n = n / 2
half' n = fromIntegral n / 2
half'' = (`div` 2)
y = 2 :: Int
x = toInteger y | null | https://raw.githubusercontent.com/osstotalsoft/functional-guy/c02a8b22026c261a9722551f3641228dc02619ba/Chapter3.%20Haskell's%20Type%20System/Exercises/01.%20Built-in%20types/04.ConvertingNumbers.hs | haskell | myAverage aList = sum aList / length aList
myAverage aList = sum aList / fromIntegral (length aList)
myAverage' aList = sum aList `div` length aList
half n = n / 2
half' n = fromIntegral n / 2
half'' = (`div` 2)
y = 2 :: Int
x = toInteger y | |
15dd7b47f6c4917d956cbcbb473263950bd790344f83232ae0e0c9a82b002111 | geneweb/geneweb | json_converter.mli | (** Json converter driver *)
module type ConverterDriver = sig
type t
(** Json value *)
val str : string -> t
(** Convert to JSON string *)
val int : int -> t
(** Convert to JSON integer *)
val obj : (string * t) array -> t
(** Convert to JSON object *)
val null : t
(** Convert to JSON null val... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/json_export/json_converter.mli | ocaml | * Json converter driver
* Json value
* Convert to JSON string
* Convert to JSON integer
* Convert to JSON object
* Convert to JSON null value
* Convert array to JSON list
* Convert list to JSON list
* Convert to JSON boolean
* Functor building JSON convertion functions of the Geneweb data types.
* Convert [d... | module type ConverterDriver = sig
type t
val str : string -> t
val int : int -> t
val obj : (string * t) array -> t
val null : t
val array : 't array -> t
val list : 't list -> t
val bool : bool -> t
end
module Make : functor (D : ConverterDriver) -> sig
val conv_dmy : Def.dmy -> D.t
val co... |
2c436afae570d5d3563da6883c296c0729d6808a6ffe764987f17cfd520f3269 | ertugrulcetin/herfi | project.clj | (defproject herfi "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:dependencies [[ch.qos.logback/logback-classic "1.2.10"]
[clojure.java-time "0.3.3"]
[cprop "0.1.19"]
[expound "0.9.0"]
[luminus-aleph "0.1.6"]
... | null | https://raw.githubusercontent.com/ertugrulcetin/herfi/b5384d56c3e56c29ed82deafc4e56ad19ec12a60/project.clj | clojure | (defproject herfi "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:dependencies [[ch.qos.logback/logback-classic "1.2.10"]
[clojure.java-time "0.3.3"]
[cprop "0.1.19"]
[expound "0.9.0"]
[luminus-aleph "0.1.6"]
... | |
0b2ee0ead9d7411829be358b65d2c48d09c483091c02aff6813ec40c75635549 | myuon/quartz-hs | AST.hs | module Language.Quartz.AST where
import Data.Primitive.Array
import Data.Default
import Data.Dynamic
import Data.IORef
import Control.Monad.Primitive ( RealWorld )
data Literal
= IntLit Int
| DoubleLit Double
| CharLit Char
| StringLit String
... | null | https://raw.githubusercontent.com/myuon/quartz-hs/998edb502443d80cfe300730885de25bc7d15b08/src/Language/Quartz/AST.hs | haskell | テストでコード位置に左右されないようにEqでは飛ばす
references
以下、evaluation時のみ | module Language.Quartz.AST where
import Data.Primitive.Array
import Data.Default
import Data.Dynamic
import Data.IORef
import Control.Monad.Primitive ( RealWorld )
data Literal
= IntLit Int
| DoubleLit Double
| CharLit Char
| StringLit String
... |
74112da4d4f991bc88f826a3d4cb73f8b86db064375203d0ed6dca98bb050c32 | igorhvr/bedlam | dynwind.scm | ; "dynwind.scm", wind-unwind-protect for Scheme
Copyright ( c ) 1992 , 1993
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
;granted, subject to the following restrictions and understandings.
;
1 . Any copy made of this soft... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/slib/3b2/dynwind.scm | scheme | "dynwind.scm", wind-unwind-protect for Scheme
Permission to copy this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
in full.
this software will be error-free, and I am under no obligati... | Copyright ( c ) 1992 , 1993
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
DYNAMIC - WIND calls < thunk1 > , < thunk2 > , and then < thunk3 > . The val... |
b58f0318b4b82fd2f8fbc0ba1f54f8a98603b99d25d7f206f77d52307e353838 | rpav/spell-and-dagger | text-phase.lisp | (in-package :game)
(defclass text-phase (game-phase)
((text-screen :initform nil)))
(defmethod initialize-instance :after ((p text-phase) &key text (map t) &allow-other-keys)
(with-slots (text-screen) p
(setf text-screen
(make-instance 'text-screen :text text :map map))))
(defmethod phase-resume ((... | null | https://raw.githubusercontent.com/rpav/spell-and-dagger/0424416ff14a6758d27cc0f84c21bf85df024a7b/src/phases/text-phase.lisp | lisp | (in-package :game)
(defclass text-phase (game-phase)
((text-screen :initform nil)))
(defmethod initialize-instance :after ((p text-phase) &key text (map t) &allow-other-keys)
(with-slots (text-screen) p
(setf text-screen
(make-instance 'text-screen :text text :map map))))
(defmethod phase-resume ((... | |
fd24e691f7cf8d9735185ef5086ef2c908ca277a7a10a85cc0b1acfcfc02db35 | ericclack/overtone-loops | pattern_03_03.clj | (ns overtone-loops.dph-book.pattern-03-03
(:use [overtone.live]
[overtone-loops.loops]
[overtone-loops.samples]))
;; Stop any currently playing music and clear any patterns
(set-up)
BAR1 BAR2 BAR3 BAR4
;; ... | null | https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/src/overtone_loops/dph_book/pattern_03_03.clj | clojure | Stop any currently playing music and clear any patterns
1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 & // 1 & 2 & 3 & 4 &
---------------------------------------------
(stop) | (ns overtone-loops.dph-book.pattern-03-03
(:use [overtone.live]
[overtone-loops.loops]
[overtone-loops.samples]))
(set-up)
BAR1 BAR2 BAR3 BAR4
(defloop closed-hhs
1/2 cymbal-closed [7 7 7 7 7 7 7 7 ])
(d... |
4fecfc4c284e4693712adc834c619ef38dc782785b0cdee9f1ed64e44687db67 | Chattered/ocaml-monad | applicative.ml | module type Base = sig
type 'a m
val return : 'a -> 'a m
val ( <*> ) : ('a -> 'b) m -> 'a m -> 'b m
end
module type Applicative = sig
include Base
val lift1 : ('a -> 'b) -> 'a m -> 'b m
val lift2 : ('a -> 'b -> 'c) -> 'a m -> 'b m -> 'c m
val lift3 : ('a -> 'b -> 'c -> 'd) -> 'a m -> 'b m -> 'c m ->... | null | https://raw.githubusercontent.com/Chattered/ocaml-monad/2d6d1f2d443ddd517aef51d40e5cd068f456c235/src/applicative.ml | ocaml | module type Base = sig
type 'a m
val return : 'a -> 'a m
val ( <*> ) : ('a -> 'b) m -> 'a m -> 'b m
end
module type Applicative = sig
include Base
val lift1 : ('a -> 'b) -> 'a m -> 'b m
val lift2 : ('a -> 'b -> 'c) -> 'a m -> 'b m -> 'c m
val lift3 : ('a -> 'b -> 'c -> 'd) -> 'a m -> 'b m -> 'c m ->... | |
a9de1ca1e0e13c4e66ce9b69a1ada876be6deebc2f2271e3334d94699d992da1 | azimut/shiny | csound.lisp | (in-package :shiny)
NOTE : one of the limitations of the design of using & rest
;; for arbitrary params is (i think) that i cannot ask for
;; additional &key params i think...
;; Well, even if i could i won't see them on the created macro above
;; NOTE: Might be I need to add time after all...it would be... | null | https://raw.githubusercontent.com/azimut/shiny/774381a9bde21c4ec7e7092c7516dd13a5a50780/lib/inscore/csound.lisp | lisp | for arbitrary params is (i think) that i cannot ask for
additional &key params i think...
Well, even if i could i won't see them on the created macro above
NOTE: Might be I need to add time after all...it would be nice for
arpgeggios
Reset the stream if either, there is no stream or
is over the... | (in-package :shiny)
NOTE : one of the limitations of the design of using & rest
(defmethod playcsound-key :before
((iname string) (duration number)
(keynum integer) &rest rest)
(let ((c (gethash *window-name* *bar-counter*)))
(when (or (not c) (>= c 4))
(inscore-stream :meter *meter*)
(se... |
98ddf8aba3a72614579c6282416836e0156597661bea6243d6f98d4a8c8c4b52 | falsetru/htdp | 39.2.2.scm | #lang racket
(define COLORS
'(black white red blue green gold pink orange purple navy))
(define (make-master)
(local ((define target1 (first COLORS))
(define target2 (first COLORS))
(define (random-pick xs)
(list-ref xs (random (length xs))))
(define (master)
... | null | https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/39/39.2.2.scm | scheme | #lang racket
(define COLORS
'(black white red blue green gold pink orange purple navy))
(define (make-master)
(local ((define target1 (first COLORS))
(define target2 (first COLORS))
(define (random-pick xs)
(list-ref xs (random (length xs))))
(define (master)
... | |
a753c786d9ec84c9b86431523e67133ab4d490cc7b723b58dc54978fe35419fe | inaka/sumo_rest | sr_request.erl | -module(sr_request).
-export([ from_cowboy/1
, body/1
, headers/1
, path/1
, bindings/1
]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Types
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-type binding... | null | https://raw.githubusercontent.com/inaka/sumo_rest/19a3685ab477222738ac27b72e39346cbad9463d/src/sr_request.erl | erlang |
Types
Constructor, getters/setters
| -module(sr_request).
-export([ from_cowboy/1
, body/1
, headers/1
, path/1
, bindings/1
]).
-type binding_name() :: id | atom().
-type http_header_name_lowercase() :: binary().
-type http_header() :: {http_header_name_lowercase(), iodata()}.
-opaque req() ::
#{ body :=... |
8977501240177c889225908018f04f7b3ed1cc2c6f140abba89966db9b0ca2ee | bitemyapp/esqueleto | JSON.hs | {-# LANGUAGE OverloadedStrings #-}
|
This module contains PostgreSQL - specific JSON functions .
A couple of things to keep in mind about this module :
* The @Type@ column in the PostgreSQL documentation tables
are the types of the right operand , the left is always @jsonb@.
* Since t... | null | https://raw.githubusercontent.com/bitemyapp/esqueleto/b295bc6a5f2a221b074940c01d4590d865774fe0/src/Database/Esqueleto/PostgreSQL/JSON.hs | haskell | # LANGUAGE OverloadedStrings #
database table models as long as your type has 'FromJSON'
@
Example
|]
@
CAUTION: Remember that changing the 'FromJSON' instance
of your type might result in old data becoming unparsable!
* JSONAccessor
* Arrow operators
| /Better documentation included with individual fu... |
|
This module contains PostgreSQL - specific JSON functions .
A couple of things to keep in mind about this module :
* The @Type@ column in the PostgreSQL documentation tables
are the types of the right operand , the left is always @jsonb@.
* Since these operators can all take @NULL@ ... |
284711c751c4a5b6b8c5a4c0ea77ec2a9195d7099377e85b26b2d2d033c5ed7e | fragnix/fragnix | Network.Socket.ByteString.Lazy.Posix.hs | # LANGUAGE Haskell98 , CPP , DeriveDataTypeable , ForeignFunctionInterface , TypeSynonymInstances #
# LINE 1 " Network / Socket / ByteString / Lazy / Posix.hs " #
{-# LANGUAGE BangPatterns #-}
module Network.Socket.ByteString.Lazy.Posix
(
-- * Send data to a s... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/Network.Socket.ByteString.Lazy.Posix.hs | haskell | # LANGUAGE BangPatterns #
* Send data to a socket
-----------------------------------------------------------------------------
Sending
^ Connected socket
^ Data to send
^ Number of bytes sent
^ Connected socket
^ Data to send | # LANGUAGE Haskell98 , CPP , DeriveDataTypeable , ForeignFunctionInterface , TypeSynonymInstances #
# LINE 1 " Network / Socket / ByteString / Lazy / Posix.hs " #
module Network.Socket.ByteString.Lazy.Posix
(
send
, sendAll
) where
import Control.Mo... |
6750fdb52924dc3a289080a18e0348b5eb061bd9703d876c175eca8b162c4fe5 | circleci/circleci.test | retest.clj | (ns circleci.test.retest
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[circleci.test :as test]))
(defn- failed-tests-from [root]
(let [suite (:name (:attrs root))]
(for [test-case (:content root)
:when (some #(#{:failure :error} (:tag %)) (:content test-case))... | null | https://raw.githubusercontent.com/circleci/circleci.test/eb2e44fe94e430648c852f7f736419dc70a4e5a1/src/circleci/test/retest.clj | clojure | (ns circleci.test.retest
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[circleci.test :as test]))
(defn- failed-tests-from [root]
(let [suite (:name (:attrs root))]
(for [test-case (:content root)
:when (some #(#{:failure :error} (:tag %)) (:content test-case))... | |
14a656bcaa29204f8a81e15726578747a383b291e5797400331c300057511b45 | camlp4/camlp4 | fstream.mli | camlp4r
(* Module [Fstream]: functional streams *)
This module implement functional streams .
To be used with syntax [ pa_fstream.cmo ] . The syntax is :
- stream : [ fstream [: ... :] ]
- parser : [ parser [ [: ... :] - > ... | ... ] ]
Functional parsers are of type : [ Fstream.t ' a - ... | null | https://raw.githubusercontent.com/camlp4/camlp4/9b3314ea63288decb857239bd94f0c3342136844/camlp4/unmaintained/lib/fstream.mli | ocaml | Module [Fstream]: functional streams
The type of 'a functional streams
[Fstream.from f] returns a stream built from the function [f].
To create a new stream element, the function [f] is called with
the current stream count. The user function [f] must return either
[Some <value>] for a value or... | camlp4r
This module implement functional streams .
To be used with syntax [ pa_fstream.cmo ] . The syntax is :
- stream : [ fstream [: ... :] ]
- parser : [ parser [ [: ... :] - > ... | ... ] ]
Functional parsers are of type : [ Fstream.t ' a - > option ( ' a * Fstream.t ' a ) ]
Th... |
ceec32c5dcd0c0c8b4ac637836ac912c08e3a74f86b2b4968eae046f608a1e82 | grin-compiler/ghc-wpc-sample-programs | Definitions.hs | {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
| Preprocess ' Agda . Syntax . Concrete . Declaration 's , producing ' NiceDeclaration 's .
--
-- * Attach fixity and syntax declarations to the definition they refer to.
--
-- * Distribute the followi... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/Agda-2.6.1/src/full/Agda/Syntax/Concrete/Definitions.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE GADTs #
* Attach fixity and syntax declarations to the definition they refer to.
* Distribute the following attributes to the individual definitions:
@abstract@,
@instance@,
@postulate@,
@primitive@,
@private@,
ter... | # LANGUAGE GeneralizedNewtypeDeriving #
| Preprocess ' Agda . Syntax . Concrete . Declaration 's , producing ' NiceDeclaration 's .
* Gather the function clauses belonging to one function definition .
when one of the above transformation fails .
( ConcreteToAbstract ) , where we are in the TCM and ca... |
2cd17c58e635714a94e30139d1c432b12e2daf62cf6e9b8df5d186f5ec4eabbe | nponeccop/HNC | ArgumentValues.hs |
import CPP.CompileTools
import HN.Optimizer.ArgumentValues
import HN.Optimizer.GraphCompiler
import HN.Optimizer.Visualise
import FFI.TypeParser
import Compiler.Hoopl
main = do
ast <- parseHN "hn_tests/print15.hn"
ffi <- importHni "lib/lib.hni"
putStrLn $ foo $ run avPass $ fst $ compileGraph ffi $ head ast
run p... | null | https://raw.githubusercontent.com/nponeccop/HNC/d8447009a04c56ae2cba4c7c179e39384085ea00/Test/Optimizer/ArgumentValues.hs | haskell |
import CPP.CompileTools
import HN.Optimizer.ArgumentValues
import HN.Optimizer.GraphCompiler
import HN.Optimizer.Visualise
import FFI.TypeParser
import Compiler.Hoopl
main = do
ast <- parseHN "hn_tests/print15.hn"
ffi <- importHni "lib/lib.hni"
putStrLn $ foo $ run avPass $ fst $ compileGraph ffi $ head ast
run p... | |
4a854e2e9201b92762f575cab6cab238b3253a5496e33c289a01201feb0b5475 | biegunka/biegunka | Internal.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeFamilies #
-- | Support for git repositories as 'Sources'
module Control.Biegunka.Source.Git.Internal
( Git
, git
, Url
, Config(... | null | https://raw.githubusercontent.com/biegunka/biegunka/74fc93326d5f29761125d7047d5418899fa2469d/src/Control/Biegunka/Source/Git/Internal.hs | haskell | | Support for git repositories as 'Sources'
| Clone or update a clone of the git repository, then run a script on its contents.
An example:
@
git (url \"git\@github.com:edwinb\/Idris-dev\" . path \"git\/Idris-dev\" . branch \"develop\") $ do
link \"contribs\/tool-support\/vim\" \".vim\/bundle\/idris-vim\")
@... | # LANGUAGE DataKinds #
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeFamilies #
module Control.Biegunka.Source.Git.Internal
( Git
, git
, Url
, Config(..)
, url
, path
, branch
, failIfAhead... |
0be44f344770b57a9981de82bc7e4fda99d0e11a7f302e6e0fe3803c6fd02539 | jamesmccabe/stumpwm-demo-config | overrides.lisp | overrides.lisp --- preferred functionality for StumpWM
Copyright © 2020 - 2021
Author : < james.mccab3(at)gmail.com >
;; 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 versio... | null | https://raw.githubusercontent.com/jamesmccabe/stumpwm-demo-config/5fc9b35889d264faad6ba48613a0e1d8d0c688bd/overrides.lisp | lisp | 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 A PARTICULAR PURPOSE. See the
GNU General Public ... | overrides.lisp --- preferred functionality for StumpWM
Copyright © 2020 - 2021
Author : < james.mccab3(at)gmail.com >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Gen... |
3a3c78a0ff22a37e650510d1a58775f04d75a17b5119607444dc92b7f1b8f538 | dyzsr/ocaml-selectml | records.ml | (* TEST
flags = " -w +A -strict-sequence "
* expect
*)
(* Use type information *)
module M1 = struct
type t = {x: int; y: int}
type u = {x: bool; y: bool}
end;;
[%%expect{|
module M1 :
sig type t = { x : int; y : int; } type u = { x : bool; y : bool; } end
|}]
module OK = struct
open M1
let f1 (r:t) =... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-warnings/records.ml | ocaml | TEST
flags = " -w +A -strict-sequence "
* expect
Use type information
ok
non principal
ok
ok
non principal
ok
ok
ok
ok
non principal
non principal
ok
ok
ok
fails
fails for -principal
Use type information with modules
ok
ok
warning
warning
warning
warning
warning
... |
module M1 = struct
type t = {x: int; y: int}
type u = {x: bool; y: bool}
end;;
[%%expect{|
module M1 :
sig type t = { x : int; y : int; } type u = { x : bool; y : bool; } end
|}]
module OK = struct
open M1
let f3 (r: t) =
end;;
[%%expect{|
Line 3, characters 19-20:
^
Warning 42 [disa... |
5dcbc1bd918861e29aa165612ee7fda62f65645d39a836b8d66cf4db7732c9b6 | haskell/ThreadScope | Constants.hs | module GUI.Timeline.Render.Constants (
ox, firstTraceY, tracePad,
hecTraceHeight, hecInstantHeight, hecSparksHeight,
hecBarOff, hecBarHeight, hecLabelExtra,
activityGraphHeight, stdHistogramHeight, histXScaleHeight,
ticksHeight, ticksPad
) where
---------------------------------------------------... | null | https://raw.githubusercontent.com/haskell/ThreadScope/d70f45eb1d6a5dab13d4ea338d58d91389b77bd4/GUI/Timeline/Render/Constants.hs | haskell | -----------------------------------------------------------------------------
The standard gap in various graphs
Origin for traces
extra space to allow between HECs when labels are on.
Activity graph
Height of the spark graphs.
The X scale of histogram has this constant height, as opposed
Ticks | module GUI.Timeline.Render.Constants (
ox, firstTraceY, tracePad,
hecTraceHeight, hecInstantHeight, hecSparksHeight,
hecBarOff, hecBarHeight, hecLabelExtra,
activityGraphHeight, stdHistogramHeight, histXScaleHeight,
ticksHeight, ticksPad
) where
ox :: Int
ox = 10
firstTraceY :: Int
firstTrace... |
56cd744dccf207af2cbb6504203b517044e4fb9a1df1c6e5046940784d288c25 | 2600hz/kazoo | doodle_listener.erl | %%%-----------------------------------------------------------------------------
( C ) 2010 - 2020 , 2600Hz
%%% @doc
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/applications/doodle/src/doodle_listener.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
-----------------------------------------------------------------------------
=============================================================================
API
====================================================================... | ( C ) 2010 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(doodle_listener).
-behaviour(gen_listener).
-export([start_link/0]).
Responders
-export([handle_messag... |
d204b0c15e3e232155042ab739688bb7c4cbfca8fb61364642c5659b963ee50c | den1k/vimsical | error.cljc | (ns vimsical.remotes.error
(:require
[clojure.spec.alpha :as s]))
(s/def ::remote keyword?)
(s/def ::backoff int?)
(s/def ::reason string?)
(s/def ::message string?)
(s/def ::error (s/keys :req [::remote ::event] :opt [::backoff ::reason ::message]))
| null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/common/vimsical/remotes/error.cljc | clojure | (ns vimsical.remotes.error
(:require
[clojure.spec.alpha :as s]))
(s/def ::remote keyword?)
(s/def ::backoff int?)
(s/def ::reason string?)
(s/def ::message string?)
(s/def ::error (s/keys :req [::remote ::event] :opt [::backoff ::reason ::message]))
| |
7bd413ae4807fd43bda77e667c686904876b8402db88227f3fba1e1d5d27c37a | alpha123/cl-template | packages.lisp | (defpackage #:cl-template
(:use #:cl)
(:nicknames #:clt)
(:export #:compile-template #:*add-progn-to-if*))
;; Symbols that can be used in templates.
(defpackage #:cl-template-template-symbols
(:use #:cl))
| null | https://raw.githubusercontent.com/alpha123/cl-template/46193a9a389bb950530e579eae7e6e5a18184832/packages.lisp | lisp | Symbols that can be used in templates. | (defpackage #:cl-template
(:use #:cl)
(:nicknames #:clt)
(:export #:compile-template #:*add-progn-to-if*))
(defpackage #:cl-template-template-symbols
(:use #:cl))
|
ee5699e93dbfa4fcb9361620f8cfa7c7910e6cc2e7b8479fe5e0d26217dc5dd6 | kana/sicp | ex-3.37.scm | Exercise 3.37 . procedure is cumbersome
;;; when compared with a more expression-oriented style of definition, such as
;;;
;;; (define (celsius-fahrenheit-converter x)
( c+ ( c * ( c/ ( cv 9 ) ( cv 5 ) )
;;; x)
( cv 32 ) ) )
;;; (define C (make-connector))
;;; (de... | null | https://raw.githubusercontent.com/kana/sicp/912bda4276995492ffc2ec971618316701e196f6/ex-3.37.scm | scheme | when compared with a more expression-oriented style of definition, such as
(define (celsius-fahrenheit-converter x)
x)
(define C (make-connector))
(define F (celsius-fahrenheit-converter C))
Here c+, c*, etc. are the ``constraint'' versions of the arithmetic
a connector that is relate... | Exercise 3.37 . procedure is cumbersome
( c+ ( c * ( c/ ( cv 9 ) ( cv 5 ) )
( cv 32 ) ) )
operations . For example , c+ takes two connectors as arguments and returns
Define analogous procedures c- , c * , c/ , and ( constant value ) that enable
us to define compound constraints as i... |
f9460e4a422b02512791e3bb3c63726398b69d1e33aea3c378e947b3ce912c36 | youjinbou/gmaths | mersenneTwister.mli |
module Period : sig
val n : int
val m : int
end
module State : sig
type t
val create : unit -> t
val mt : t -> int64 array
val idx : t -> int
val incr_idx : t -> unit
val reset_idx : t -> unit
val init : t -> int64 -> t
val make : int64 -> t
val full_init : int array -> t
val make_self_init :... | null | https://raw.githubusercontent.com/youjinbou/gmaths/1a507444071941a45b39f8c65e90c37427ea68a3/src/rng/mersenneTwister.mli | ocaml | state as a module-scoped value |
module Period : sig
val n : int
val m : int
end
module State : sig
type t
val create : unit -> t
val mt : t -> int64 array
val idx : t -> int
val incr_idx : t -> unit
val reset_idx : t -> unit
val init : t -> int64 -> t
val make : int64 -> t
val full_init : int array -> t
val make_self_init :... |
c6faf27a1f667cbad052af358ee73c2a0be167346ae76d3784d19887a49c1f9c | tomgr/libcspm | Annotated.hs | # LANGUAGE DeriveGeneric , FlexibleContexts , FlexibleInstances #
module Util.Annotated where
import qualified Data.ByteString as B
import Data.Hashable
import GHC.Generics (Generic)
import Prelude
import Util.Exception
import Util.Prelude
import Util.PrettyPrint
data SrcLoc =
SrcLoc {
srcLocFile :: !B.B... | null | https://raw.githubusercontent.com/tomgr/libcspm/24d1b41954191a16e3b5e388e35f5ba0915d671e/src/Util/Annotated.hs | haskell | # UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
# UNPACK #
| A builtin thing | # LANGUAGE DeriveGeneric , FlexibleContexts , FlexibleInstances #
module Util.Annotated where
import qualified Data.ByteString as B
import Data.Hashable
import GHC.Generics (Generic)
import Prelude
import Util.Exception
import Util.Prelude
import Util.PrettyPrint
data SrcLoc =
SrcLoc {
srcLocFile :: !B.B... |
6d4c40bb149f2ac55d013276bda7ade7467b769e57ff6bc471b9915d791a63d2 | mbj/stratosphere | MonitoringResourcesProperty.hs | module Stratosphere.SageMaker.ModelBiasJobDefinition.MonitoringResourcesProperty (
module Exports, MonitoringResourcesProperty(..),
mkMonitoringResourcesProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURC... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/ModelBiasJobDefinition/MonitoringResourcesProperty.hs | haskell | # SOURCE # | module Stratosphere.SageMaker.ModelBiasJobDefinition.MonitoringResourcesProperty (
module Exports, MonitoringResourcesProperty(..),
mkMonitoringResourcesProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosph... |
e0adf4c06439d2db3ec691caf6f9d16850aff21d4b458c5aa89a639f8ab8bda6 | dym/movitz | run-time-context.lisp | ;;;;------------------------------------------------------------------
;;;;
Copyright ( C ) 2003 - 2005 ,
Department of Computer Science , University of Tromsoe , Norway .
;;;;
;;;; For distribution policy, see the accompanying file COPYING.
;;;;
;;;; Filename: run-time-context.lisp
;;;; Descriptio... | null | https://raw.githubusercontent.com/dym/movitz/56176e1ebe3eabc15c768df92eca7df3c197cb3d/losp/muerte/run-time-context.lisp | lisp | ------------------------------------------------------------------
For distribution policy, see the accompanying file COPYING.
Filename: run-time-context.lisp
Description:
------------------------------------------------------------------
'(quote <obj>)
| Copyright ( C ) 2003 - 2005 ,
Department of Computer Science , University of Tromsoe , Norway .
Author : < >
Created at : We d Nov 12 18:33:02 2003
$ I d : run - time - context.lisp , v 1.23 2005/05/05 20:51:19 Exp $
(require :muerte/basic-macros)
(require :muerte/los-closette)
(provid... |
670a97bf5a759017accd913ca5cd37e58cc5087d3574141b0346c9ed0a941f9a | jwiegley/notes | parsec.hs | import Data.Functor.Identity
import Control.Applicative
import Text.Parsec
data Operation = Rename String String deriving Show
rename :: Parsec String () Operation
rename = Rename <$> (string "rename" *> many1 space *> many1 letter <* spaces)
<*> (many1 letter <* spaces <* eof)
main :: IO ()
main = p... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/parsec.hs | haskell | import Data.Functor.Identity
import Control.Applicative
import Text.Parsec
data Operation = Rename String String deriving Show
rename :: Parsec String () Operation
rename = Rename <$> (string "rename" *> many1 space *> many1 letter <* spaces)
<*> (many1 letter <* spaces <* eof)
main :: IO ()
main = p... | |
e8d0b8c0d71791079b8aa6d008d0e056278b19a5fd13f53c2602c0971cdd682a | ocaml-doc/voodoo | tailwind.ml | Tailwind module
let numeric base n =
if n < 0 then "-" ^ base ^ "-" ^ string_of_int (-n)
else base ^ "-" ^ string_of_int n
(* {2 Core Concepts} *)
let group = "group"
let group_hover x = "group-hover:" ^ x
(* {2 Layout} *)
let container = "container"
let block = "block"
let inline_block = "inline-block"
let f... | null | https://raw.githubusercontent.com/ocaml-doc/voodoo/a57d7b4c12b5fa195d696bf39f4729a1ac7a7fc8/src/voodoo-web/tailwind.ml | ocaml | {2 Core Concepts}
{2 Layout}
* {2 Flexbox}
* {2 Grid}
{2 Spacing}
* {2 Typeography}
Text size
Modifiers
* Accessibility | Tailwind module
let numeric base n =
if n < 0 then "-" ^ base ^ "-" ^ string_of_int (-n)
else base ^ "-" ^ string_of_int n
let group = "group"
let group_hover x = "group-hover:" ^ x
let container = "container"
let block = "block"
let inline_block = "inline-block"
let flex = "flex"
let flex_none = "flex-none"
... |
13ed581b56027d97c98363164754de0ec3a4546095b2df8295284b78f6f57982 | jorgetavares/core-gp | output.lisp |
(in-package #:core-gp)
;;;
;;; output
;;;
(defgeneric output-stats (stats run-best new-best-p output streams)
(:documentation "Output the stats of a single iteration."))
(defmethod output-stats ((stats fitness-stats) run-best new-best-p output streams)
"Outputs the computed stats according to the type of output... | null | https://raw.githubusercontent.com/jorgetavares/core-gp/90ec1c4599a19c5a911be1f703f78d5108aee160/src/output.lisp | lisp |
output
|
(in-package #:core-gp)
(defgeneric output-stats (stats run-best new-best-p output streams)
(:documentation "Output the stats of a single iteration."))
(defmethod output-stats ((stats fitness-stats) run-best new-best-p output streams)
"Outputs the computed stats according to the type of output."
(unless (eql o... |
4898469c8f2021e4e6f391725c423c31c95ebc9b228dbe55cf792987ac9666f2 | ucsd-progsys/dsolve | sum-all-e.ml | let rec sum x = if x <= 0 then 0 else x + sum (x - 1)
let rec h y = assert ((y + y) <= sum y);h (y + 1)
let main () = h 0
| null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/negtests/sum-all-e.ml | ocaml | let rec sum x = if x <= 0 then 0 else x + sum (x - 1)
let rec h y = assert ((y + y) <= sum y);h (y + 1)
let main () = h 0
| |
5454966208fdc4087e401b9d0b755f997a920437b64cedff3be5e05af6c42154 | tonyg/kali-scheme | init.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
; System entry and exit
Entry point from OS executive . Procedures returned by USUAL - RESUMER
are suitable for use as the second argument to WRITE - IMAGE .
(define (usual-resumer entry-po... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/rts/init.scm | scheme | System entry and exit
port-flushing quantum
Add the full/empty buffer handlers. | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
Entry point from OS executive . Procedures returned by USUAL - RESUMER
are suitable for use as the second argument to WRITE - IMAGE .
(define (usual-resumer entry-point)
(lambda (resume-a... |
f867bbaf86d10cd96d94fc0313007011e17738d5d7b03eba2dbf0f07822756d5 | ocaml/ocaml | odoc_gen.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml/ocaml/04ddddd0e1d2bf2acb5091f434b93387243d4624/ocamldoc/odoc_gen.ml | ocaml | ************************************************************************
OCaml
... | , projet Gallium , INRIA Rocquencourt
Copyright 2010 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
class type doc_generator =
object method generate : Odoc_module.t_module list -> unit end
module type Ba... |
6f44eba3f801ebd2f46011ab9d63e11d3ec12f1fa15969e99e390f81d61c32a7 | emqx/emqx | emqx_prometheus_proto_v1.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2022 - 2023 EMQ Technologies Co. , Ltd. 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 copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_prometheus/src/proto/emqx_prometheus_proto_v1.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2022 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_prometheus_proto_v1).
-behaviour(emqx_bpapi).
-export([
introduced_in/0,
... |
df6698f4d78eeba4fbfb97a10f6312f95750dda6ebc5146ad534eb7c82c9cf06 | mhuebert/maria | project.clj | (defproject maria/shapes "0.1.1-SNAPSHOT"
:description "A shapes library"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0-alpha17"]
[org.clojure/clojurescript "1.9.854"]]
:source-paths ["... | null | https://raw.githubusercontent.com/mhuebert/maria/15586564796bc9273ace3101b21662d0c66b4d22/shapes/project.clj | clojure | (defproject maria/shapes "0.1.1-SNAPSHOT"
:description "A shapes library"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0-alpha17"]
[org.clojure/clojurescript "1.9.854"]]
:source-paths ["... | |
f65a4cb2ea52b84a162d8a2114d41f2d6f69c4f2b218d8ceedb9ed13dc868506 | tonyfloatersu/solution-haskell-craft-of-FP | Frequency.hs | -------------------------------------------------------------------------
--
-- Frequency.hs
--
-- Calculating the frequencies of words in a text, used in
Huffman coding .
-- ... | null | https://raw.githubusercontent.com/tonyfloatersu/solution-haskell-craft-of-FP/0d4090ef28417c82a7b01e4a764f657641cb83f3/Chapter15/Frequency.hs | haskell | -----------------------------------------------------------------------
Frequency.hs
Calculating the frequencies of words in a text, used in
----------... | Huffman coding .
( c ) Addison - Wesley , 1996 - 2011 .
module Frequency ( frequency ) where
import Test.QuickCheck hiding ( frequency )
frequency :: [Char] -> [ (Char,Int) ]
frequency
= mergeSort freqMerge . mergeSort alphaMerge . map start
wh... |
98bcca5c890cd0b5d4002ac0a9d96aa9ddc5f848e4f37bf61aa86e1de87652de | i-am-tom/learn-me-a-haskell | PropertySpec.hs | # LANGUAGE CPP , OverloadedStrings #
module PropertySpec (main, spec) where
import Test.Hspec
import Data.String.Builder
import Property
import Interpreter (withInterpreter)
main :: IO ()
main = hspec spec
isFailure :: PropertyResult -> Bool
isFailure (Failure _) = True
isFai... | null | https://raw.githubusercontent.com/i-am-tom/learn-me-a-haskell/08271f6cdd4fc88c26ed7a62ed1e786a900824be/vendor/doctest-0.16.0/test/PropertySpec.hs | haskell | try e.g.
>>> :t is
the error message | # LANGUAGE CPP , OverloadedStrings #
module PropertySpec (main, spec) where
import Test.Hspec
import Data.String.Builder
import Property
import Interpreter (withInterpreter)
main :: IO ()
main = hspec spec
isFailure :: PropertyResult -> Bool
isFailure (Failure _) = True
isFai... |
fb2fba9c1d4bf3e1e8afe95754a1730bde639629e26d61b38a5b59ba3ce9719d | hdima/erlport | ruby_options_tests.erl | Copyright ( c ) 2009 - 2015 , < >
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without
%%% modification, are permitted provided that the following conditions are met:
%%%
%%% * Redistributions of source code must retain the above copyright notice,
%%% this list of... | null | https://raw.githubusercontent.com/hdima/erlport/246b7722d62b87b48be66d9a871509a537728962/test/ruby_options_tests.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistribution... | Copyright ( c ) 2009 - 2015 , < >
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , E... |
545fb7b70c7406fd66a2c10563130860ddfd6f4def22e6a8e4895a6360aa5b44 | lambdacube3d/lambdacube-edsl | HindleyMilner.hs | import Data.Functor.Identity
import Control.Monad.Except
import Control.Monad.State
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Monoid
import Data.Functor
data Lit
= LInt
| LBool
| LFloat
deriving (Show,Eq,Ord)
data PrimFun
= PAdd... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-edsl/4347bb0ed344e71c0333136cf2e162aec5941df7/typesystem/HindleyMilner.hs | haskell | primitive types
test | import Data.Functor.Identity
import Control.Monad.Except
import Control.Monad.State
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Monoid
import Data.Functor
data Lit
= LInt
| LBool
| LFloat
deriving (Show,Eq,Ord)
data PrimFun
= PAdd... |
66fbdd3fe967a773f39a1fbf3f19fa20140a34b8e4aa0a74afb5cb979085d0f6 | jwiegley/notes | Swift.hs | module Swift where
data FooArgs = FooArgs
data Result = Result
untilRight :: (e -> Either e a) -> e -> a
untilRight f = go where
go x = case f x of
Left y -> go y
Right y -> y
swift :: (FooArgs -> Either FooArgs Result) -> FooArgs -> Result
swift = untilRight
| null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/Swift.hs | haskell | module Swift where
data FooArgs = FooArgs
data Result = Result
untilRight :: (e -> Either e a) -> e -> a
untilRight f = go where
go x = case f x of
Left y -> go y
Right y -> y
swift :: (FooArgs -> Either FooArgs Result) -> FooArgs -> Result
swift = untilRight
| |
1e489601af180b5a5d6cfe6a4fde51cdc6894e631f1c58851466ecf36891d242 | ryanpbrewster/haskell | P122Test.hs | module Problems.P122Test
( case_122_main
) where
import Problems.P122
import Test.Tasty.Discover (Assertion, (@?=))
case_122_main :: Assertion
case_122_main = solve @?= "233168"
| null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/tests/Problems/P122Test.hs | haskell | module Problems.P122Test
( case_122_main
) where
import Problems.P122
import Test.Tasty.Discover (Assertion, (@?=))
case_122_main :: Assertion
case_122_main = solve @?= "233168"
| |
fb9d430f936ad53e01aa41dd812c7d2a86c2178d0d69ef90c7ffee135562cd61 | BranchTaken/Hemlock | test_nbI_wX.ml | open! Basis.Rudiments
open! Basis
let test () =
File.Fmt.stdout
|> (fun formatter ->
List.fold I16.([kv (-32768L); kv (-1L); kv 0L; kv 1L; kv 32767L]) ~init:formatter
~f:(fun formatter i ->
formatter
|> Fmt.fmt "extend_to_i512 "
|> I16.pp i
|> Fmt.fmt " -> "
|> I51... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/convert/test_nbI_wX.ml | ocaml | open! Basis.Rudiments
open! Basis
let test () =
File.Fmt.stdout
|> (fun formatter ->
List.fold I16.([kv (-32768L); kv (-1L); kv 0L; kv 1L; kv 32767L]) ~init:formatter
~f:(fun formatter i ->
formatter
|> Fmt.fmt "extend_to_i512 "
|> I16.pp i
|> Fmt.fmt " -> "
|> I51... | |
1f38795b1b0601294f23a5517a6848b994039e0b0899d4b1cd4de45b5f0ae3ed | dyzsr/ocaml-selectml | pr5057a_bad.ml | TEST
flags = " -w -a "
ocamlc_byte_exit_status = " 2 "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
* * * check - ocamlc.byte - output
flags = " -w -a "
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
(* This one should fail *)
let f flag... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml | ocaml | This one should fail | TEST
flags = " -w -a "
ocamlc_byte_exit_status = " 2 "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
* * * check - ocamlc.byte - output
flags = " -w -a "
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
let f flag =
let module T = Set.Mak... |
0c064901925a89aee52e747f9af290f479e6807ef22157291679118b73816e49 | janestreet/sexp | main_pp.ml | open! Core
(* Options are provided for parameters which are likely to change a lot and are likely to
vary depending on the file that is being processed.
*)
let command =
Command.basic
~summary:"Pretty print S expressions in a human-friendly way."
~readme:(fun () ->
"Use pre-defined styles or load a ... | null | https://raw.githubusercontent.com/janestreet/sexp/df820aa2a657238face2c244880cb8b2e3f0a322/bin/main_pp.ml | ocaml | Options are provided for parameters which are likely to change a lot and are likely to
vary depending on the file that is being processed.
| open! Core
let command =
Command.basic
~summary:"Pretty print S expressions in a human-friendly way."
~readme:(fun () ->
"Use pre-defined styles or load a custom style from a file."
^ "\nYou can use -p to print out one of the predefined styles and customize it.")
(let%map_open.Command config_... |
8b940a14001a04f6326a2ec851376a827d290a677a50927a8986995c87cab1f6 | neeraj9/hello-erlang-rump | uwiki_app.erl | %%%-------------------------------------------------------------------
@author nsharma
( C ) 2016 ,
%%% @doc
%%%
%%% @end
Copyright ( c ) 2016 , < > .
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without
%%% modification, are permitted provided that the followi... | null | https://raw.githubusercontent.com/neeraj9/hello-erlang-rump/304d2f0faaef64677de22d9a3495297e08d90a3f/apps/uwiki/src/uwiki_app.erl | erlang | -------------------------------------------------------------------
@doc
@end
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
... | @author nsharma
( C ) 2016 ,
Copyright ( c ) 2016 , < > .
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT
LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVI... |
7cc5e0bf9a3048521695d563f6bcbc81b3774a449b7414116a2ecf6d6237c9a0 | jaspervdj/number-six | Irc.hs | --------------------------------------------------------------------------------
| Various IRC utilities
{-# LANGUAGE OverloadedStrings #-}
module NumberSix.Util.Irc
( mode
, meAction
, kick
) where
--------------------------------------------------------------------------------
import Con... | null | https://raw.githubusercontent.com/jaspervdj/number-six/1aba681786bd85bd20f79406c681ea581b982cd6/src/NumberSix/Util/Irc.hs | haskell | ------------------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
----------------------------------------------------... | | Various IRC utilities
module NumberSix.Util.Irc
( mode
, meAction
, kick
) where
import Control.Monad (when)
import Data.Text (Text)
import NumberSix.Irc
import NumberSix.Util
| Make an action a /me command
meAction :: Text -> Text
meAction x = "... |
55f307d57906dfa9aafff828910d33c6f18bf320dc07e448ce19ab9cfb092c11 | music-suite/music-score | Phrases.hs |
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
-- | Provides phrase-wise traversal.
module Music.Score.Phrases (
* HasPhrases class
HasPhrases(..),
HasPhrases',
phrases,
phrases',
... | null | https://raw.githubusercontent.com/music-suite/music-score/aa7182d8ded25c03a56b83941fc625123a7931f8/src/Music/Score/Phrases.hs | haskell | # LANGUAGE ConstraintKinds #
| Provides phrase-wise traversal.
* Phrase types etc
** Utility
|
For a phrase, we simply use a voice without rests.
* 'PVoice' is a sequence of phrases or durations.
|
A sequence of phrases or rests, represented as notes or rests.
Each consecutive sequence of non-re... |
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
module Music.Score.Phrases (
* HasPhrases class
HasPhrases(..),
HasPhrases',
phrases,
phrases',
Phrase,
MVoice,
PVoice,
TVoice,
mVoicePVoice,
mVoiceTV... |
60272514d332495f768b5e05018edc6968f9fb4e59eaa78eecd130c44324cdeb | liqd/thentos | SimpleAuthSpec.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeOperators #
module Thentos.Action.SimpleAuthSpec where
import Control.Concurrent (forkIO, killThread)
import Control.Exception (bracket)
import Da... | null | https://raw.githubusercontent.com/liqd/thentos/f7d53d8e9d11956d2cc83efb5f5149876109b098/thentos-tests/tests/Thentos/Action/SimpleAuthSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE ScopedTypeVariables #
ActionStack (ActionError Void) () | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
module Thentos.Action.SimpleAuthSpec where
import Control.Concurrent (forkIO, killThread)
import Control.Exception (bracket)
import Data.Configifier (Source(YamlString), Tagged(Tagged), (>>.))
import LIO (LIO)
import Network.Wai (Application)
impor... |
afbc10f8236cd6d1ccdd7cbe41831775e9227fa33d03b6a668a023c791cc868e | larcenists/larceny | 141.body.scm |
;;; -*- Mode: Scheme -*-
Integer Division Operators
;;; Given a QUOTIENT and REMAINDER defined for nonnegative numerators
;;; and positive denominators implementing the truncated, floored, or
Euclidean integer division , this implements a number of other
;;; integer division operators.
Copyright ( c ) 2010 - ... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/lib/SRFI/srfi/141.body.scm | scheme | -*- Mode: Scheme -*-
Given a QUOTIENT and REMAINDER defined for nonnegative numerators
and positive denominators implementing the truncated, floored, or
integer division operators.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that t... |
Integer Division Operators
Euclidean integer division , this implements a number of other
Copyright ( c ) 2010 - -2011
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND C... |
2af03580f8537170a095542b3fd44c649f632c0b37c66ce641e0fd1ef787a875 | mirage/shared-block-ring | ring.mli |
* Copyright ( C ) 2013 - 2015 Citrix Systems Inc
*
* 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 "... | null | https://raw.githubusercontent.com/mirage/shared-block-ring/e780fd9ed2186c14dd49f9e8d00211be648aa762/lib/ring.mli | ocaml | * A producer/consumer ring on top of a shared block device. The producer may
push variable-sized items (if there is enough space) and the consumer may
then pop the items. Items are pushed and popped atomically. There should
be at-most-one producer and at-most-one consumer at any point in time.
Since blo... |
* Copyright ( C ) 2013 - 2015 Citrix Systems Inc
*
* 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 "... |
e93c4b42947a5f9a4b6ba10f314c97168b2cf57cd91d0d2c158171f53a2713b1 | lipas-liikuntapaikat/lipas | tasks.clj | (ns lipas.integration.old-lipas.tasks
(:require
[clojure.java.jdbc :as jdbc]
[clojure.stacktrace :as stacktrace]
[lipas.backend.db.db :as db]
[lipas.migrate-data :as migrate]
[lipas.integration.old-lipas.core :as old-lipas]
[lipas.utils :as utils]
[taoensso.timbre :as log]))
Data integrations ... | null | https://raw.githubusercontent.com/lipas-liikuntapaikat/lipas/5d7ccb3f6b55bd19b6da89f9bd0589ec7ebfa20d/webapp/src/clj/lipas/integration/old_lipas/tasks.clj | clojure | new data (old UI is disabled).
;
OUTBOUND ;; | (ns lipas.integration.old-lipas.tasks
(:require
[clojure.java.jdbc :as jdbc]
[clojure.stacktrace :as stacktrace]
[lipas.backend.db.db :as db]
[lipas.migrate-data :as migrate]
[lipas.integration.old-lipas.core :as old-lipas]
[lipas.utils :as utils]
[taoensso.timbre :as log]))
Data integrations ... |
56ea66dc2342403f26cf53c74d84f68b081cce7ef68e8bdd1b10eca4904fe675 | fission-codes/fission | Status.hs | module Fission.CLI.Linking.Status (module Fission.CLI.Linking.Status.Types) where
import Fission.CLI.Linking.Status.Types
| null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-cli/library/Fission/CLI/Linking/Status.hs | haskell | module Fission.CLI.Linking.Status (module Fission.CLI.Linking.Status.Types) where
import Fission.CLI.Linking.Status.Types
| |
a23458f40f471e5c8ac99d34553d19d5351f7be79ab59e2e962face0836578c0 | mentat-collective/functional-numerics | midpoint.cljc | (ns quadrature.midpoint
(:require [quadrature.interpolate.richardson :as ir]
[quadrature.common :as qc
#?@(:cljs [:include-macros true])]
[quadrature.riemann :as qr]
[sicmutils.generic :as g]
[sicmutils.util :as u]
[quadrature.util.aggregate :as... | null | https://raw.githubusercontent.com/mentat-collective/functional-numerics/44856b0e3cd1f0dd9f8ebb2f67f4e85a68aa8380/src/quadrature/midpoint.cljc | clojure | (ns quadrature.midpoint
(:require [quadrature.interpolate.richardson :as ir]
[quadrature.common :as qc
#?@(:cljs [:include-macros true])]
[quadrature.riemann :as qr]
[sicmutils.generic :as g]
[sicmutils.util :as u]
[quadrature.util.aggregate :as... | |
83f42caedab91f6a891bb2b787620e3ef1cba2d46940afba8293fd9272c89694 | BU-CS320/Fall-2018 | StatefulUnsafeMonad.hs | module StatefulUnsafeMonad where
import Control.Monad(ap)
data Unsafe a = Error String | Ok a deriving (Show, Eq)
-- notice how we handled state in -CS320/Fall-2018/blob/master/assignments/week7/hw/src/week5/Lang4.hs
-- we can make a monadic type to handle the details for us
data StatefulUnsafe s a = StatefulUnsafe... | null | https://raw.githubusercontent.com/BU-CS320/Fall-2018/beec3ca88be5c5a62271a45c8053fb1b092e0af1/project/src/StatefulUnsafeMonad.hs | haskell | notice how we handled state in -CS320/Fall-2018/blob/master/assignments/week7/hw/src/week5/Lang4.hs
we can make a monadic type to handle the details for us
a helper function to pull out the function bit
a way to easily return an error (for instance in do notation)
fmap :: (a -> b) -> Stateful a -> Stateful b
ignor... | module StatefulUnsafeMonad where
import Control.Monad(ap)
data Unsafe a = Error String | Ok a deriving (Show, Eq)
data StatefulUnsafe s a = StatefulUnsafe (s -> (Unsafe a,s))
app :: StatefulUnsafe s a -> (s ->(Unsafe a,s))
app (StatefulUnsafe stateful) = stateful
err :: String -> StatefulUnsafe e a
err s = State... |
e8d46178d6a534469fa765fe9056a3f47dc796c14cab98bec96f96caf6c7190b | ocaml/ocaml | pr5985.ml | (* TEST
* expect
*)
Report from
module F (S : sig type 'a s end) = struct
include S
type _ t = T : 'a -> 'a s t
end;; (* fail *)
[%%expect{|
Line 3, characters 2-29:
3 | type _ t = T : 'a -> 'a s t
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: In the GADT constructor
T : 'a -> 'a s t
the type v... | null | https://raw.githubusercontent.com/ocaml/ocaml/19f759652b6c7531d77abe2837e1bee11bd659bd/testsuite/tests/typing-gadts/pr5985.ml | ocaml | TEST
* expect
fail
Fix it using #-annotations
syntax error
fail
ok
fail
ok
fail
Another (more direct) instance using polymorphic variants
PR#6275
fail
fail
fail
fail
fail
It is not OK to allow modules exported by other compilation units
fail
fail
we found a contradiction
The ... |
Report from
module F (S : sig type 'a s end) = struct
include S
type _ t = T : 'a -> 'a s t
[%%expect{|
Line 3, characters 2-29:
3 | type _ t = T : 'a -> 'a s t
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: In the GADT constructor
T : 'a -> 'a s t
the type variable 'a cannot be deduced from the ty... |
a39ef982e476fc5299c8ca8790a128d7e5fea2c1ef5a821ac4c87edbba58fab2 | sarabander/p2pu-sicp | setup.scm |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; This is Generic Arithmetic Package ;;
;; ---------------------------------- ;;
( from chapter 2 of SICP ) ; ;
;; ;;
To setup all , eval... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/2.5/generic-arithmetic/setup.scm | scheme |
;;
This is Generic Arithmetic Package ;;
---------------------------------- ;;
;
;;
; ( works in Racket 5.0 )
;;
Hashtable for operations, plus backup to retain o... |
(define optable (make-hash))
(define optable-backup (make-hash))
(define coercions (make-hash))
(define coercions-backup (make-hash))
(define (get operation types)
(hash-ref optable (list operation types) false))
(define (get-backup operation types)
(hash-ref optable-backup (list operation types) false))
(de... |
4206f2e3293f31eec84b9702e82d91e03f730e3f8109eb574d2942dc05e4c176 | StrykerKKD/Jerboa | middleware_config.ml | let apply_middlewares middleware_config request =
Base.List.fold middleware_config ~init:request ~f:(fun request_accumulator middleware -> middleware request_accumulator) | null | https://raw.githubusercontent.com/StrykerKKD/Jerboa/0c1cbfcba003e99a39a37c4a9795b911f8eb2e7b/lib/middleware_config.ml | ocaml | let apply_middlewares middleware_config request =
Base.List.fold middleware_config ~init:request ~f:(fun request_accumulator middleware -> middleware request_accumulator) | |
01c44dcb22ea4044b88f7fcf36682e7c0d0b51f525d0ed85c94b36a66625895c | jrm-code-project/LISP-Machine | nf-system.lisp | -*- Mode : LISP ; Package : USER ; Base:8 ; : ZL -*-
(defpackage nf)
(defsystem nf
)
| null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/pace/nf/nf-system.lisp | lisp | Package : USER ; Base:8 ; : ZL -*- | (defpackage nf)
(defsystem nf
)
|
8a650b57e8e48b7705f5f2e64071d683489133f7ea71a8849fa5a342d9da0217 | ndmitchell/ghc-make | Main.hs |
import A
import C.C
main = print $ a + b + c
| null | https://raw.githubusercontent.com/ndmitchell/ghc-make/5164c721efa38a02be33d340cc91f5c737c29156/tests/simple/Main.hs | haskell |
import A
import C.C
main = print $ a + b + c
| |
03a4faa700e60fe1e0a739fb32b80536fdcae697c0df7e13ab735ceb0232994a | gregcman/sucle | camera-matrix.lisp | (defpackage #:camera-matrix
(:use #:cl)
(:export
#:make-camera
#:camera-vec-forward
#:camera-vec-position
#:camera-vec-noitisop
#:camera-aspect-ratio
#:camera-fov
#:camera-frustum-far
#:camera-frustum-near
#:camera-matrix-projection-view-player)
(:export
#:update-matrices))
(in-packa... | null | https://raw.githubusercontent.com/gregcman/sucle/258be4ac4daaceea06a55f893227584d3772bb47/src/camera-matrix/camera-matrix.lisp | lisp | the negative of position
positional information of camera
view matrix
projection matrix
projection * view matrix
The normals of each plane.
[FIXME]necessary?
(near (camera-frustum-near camera))
(far (camera-frustum-far camera))
FIXME:optimize, does this create a lot of garbage?
(camera-vec-backwards camera)
| (defpackage #:camera-matrix
(:use #:cl)
(:export
#:make-camera
#:camera-vec-forward
#:camera-vec-position
#:camera-vec-noitisop
#:camera-aspect-ratio
#:camera-fov
#:camera-frustum-far
#:camera-frustum-near
#:camera-matrix-projection-view-player)
(:export
#:update-matrices))
(in-packa... |
be681b7825166cb2c3962b8c1e5aaaf01dfe26895effdaa2b51c216e2a6b4e12 | geophf/1HaskellADay | Solution.hs | module Y2016.M09.D29.Solution where
import Control.Arrow ((&&&), second)
import Control.Monad ((>=>))
import Data.Foldable (toList)
import Data.Function (on)
import Data.List (sortBy)
import Data.Maybe (mapMaybe)
import Data.Ord
import Data.Time.LocalTime
below imports available via 1HaskellADay git repository
imp... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2016/M09/D29/Solution.hs | haskell | }
so foldable is WORKING !
which address has the most transactions ?
which address has the transaction involving the most bitcoins exchanged
so foldable is WORKING!
which address has the most transactions?
which address has the transaction involving the most bitcoins exchanged
}
}
- BONUS ---------------------... | module Y2016.M09.D29.Solution where
import Control.Arrow ((&&&), second)
import Control.Monad ((>=>))
import Data.Foldable (toList)
import Data.Function (on)
import Data.List (sortBy)
import Data.Maybe (mapMaybe)
import Data.Ord
import Data.Time.LocalTime
below imports available via 1HaskellADay git repository
imp... |
f6ec50e37787e1e66b051bc0677ab35b2a31dae74f8ddecb923458ce37c369f1 | serokell/haskell-crypto | Public.hs | SPDX - FileCopyrightText : 2020
--
SPDX - License - Identifier : MPL-2.0
# OPTIONS_HADDOCK not - home #
-- ! This module merely re-exports definitions from the corresponding
! module in NaCl and alters the to make it more specific
-- ! to crypto-sodium. So, the docs should be kept more-or-less in sync.
-- | ... | null | https://raw.githubusercontent.com/serokell/haskell-crypto/27e67c4b54ac388cb5ab504ddaf7bbf5ab8df2ae/crypto-sodium/lib/Crypto/Sodium/Encrypt/Public.hs | haskell |
! This module merely re-exports definitions from the corresponding
! to crypto-sodium. So, the docs should be kept more-or-less in sync.
| Public-key authenticated encryption.
It is best to import this module qualified:
@
import qualified Crypto.Sodium.Encrypt.Public as Public
encrypted = Public.'encrypt' pk... | SPDX - FileCopyrightText : 2020
SPDX - License - Identifier : MPL-2.0
# OPTIONS_HADDOCK not - home #
! module in NaCl and alters the to make it more specific
A box is an abstraction from NaCl . One way to think about it
in advance . It might seem strange at first that the receiver
module Crypto.Sodium.En... |
fcc838e9b599ed8ead1aae516af09772cbfb196e3b596b5de7f52360b133504c | vonli/Ext2-for-movitz | defstruct.lisp | ;;;;------------------------------------------------------------------
;;;;
Copyright ( C ) 2001 - 2004 ,
Department of Computer Science , University of Tromso , Norway
;;;;
;;;; Filename: defstruct.lisp
;;;; Description:
Author : < >
Created at : Mon Jan 22 13:10:59 2001
;;;; Di... | null | https://raw.githubusercontent.com/vonli/Ext2-for-movitz/81b6f8e165de3e1ea9cc7d2035b9259af83a6d26/losp/muerte/defstruct.lisp | lisp | ------------------------------------------------------------------
Filename: defstruct.lisp
Description:
Distribution: See the accompanying file COPYING.
------------------------------------------------------------------
type test
type test passed, read slot
type tes... | Copyright ( C ) 2001 - 2004 ,
Department of Computer Science , University of Tromso , Norway
Author : < >
Created at : Mon Jan 22 13:10:59 2001
$ I d : defstruct.lisp , v 1.17 2006/04/03 21:22:39 ffjeld Exp $
(require :muerte/basic-macros)
(require :muerte/los-closette)
(provide :muerte... |
a7c42e26f93c7da2e5288c08e1ec687a833e35b49accaa67002de2bb34d288ff | mkoppmann/eselsohr | Assert.hs | | We use @hspec@ testing framework and it does n't support monad transformers .
At this moment there 's no testing framework that supports monad transformers . So
we need to pass @AppEnv@ manually to every function .
All functions take ` AppEnv ` as last argument . Like this one :
@
satisfies : : App ... | null | https://raw.githubusercontent.com/mkoppmann/eselsohr/3bb8609199c1dfda94935e6dde0c46fc429de84e/test/Test/Assert.hs | haskell | | Checks that given action runs successfully.
| Checks whether return result of the action satisfies given predicate.
| Checks whether action fails and returns given error.
| Checks whether action issues a redirect.
| Checks whether action returns expected value. | | We use @hspec@ testing framework and it does n't support monad transformers .
At this moment there 's no testing framework that supports monad transformers . So
we need to pass @AppEnv@ manually to every function .
All functions take ` AppEnv ` as last argument . Like this one :
@
satisfies : : App ... |
b51539d7d5f4e3530991a5286717a72333740230438dde8d75446fea66991dbb | goblint/analyzer | fileDomain.ml | open Prelude
module D = LvalMapDomain
module Val =
struct
type mode = Read | Write [@@deriving eq, ord, hash]
type s = Open of string*mode | Closed | Error [@@deriving eq, ord, hash]
let name = "File handles"
let var_state = Closed
let string_of_mode = function Read -> "Read" | Write -> "Write"
let strin... | null | https://raw.githubusercontent.com/goblint/analyzer/bd6b944afcfe98af8ff1791835c919e252a0b72b/src/cdomains/fileDomain.ml | ocaml | properties of records (e.g. used by Dom.warn_each)
returns a tuple (thunk, result)
must
may
none
evaluate thunk
handling state
TODO what about must-set? | open Prelude
module D = LvalMapDomain
module Val =
struct
type mode = Read | Write [@@deriving eq, ord, hash]
type s = Open of string*mode | Closed | Error [@@deriving eq, ord, hash]
let name = "File handles"
let var_state = Closed
let string_of_mode = function Read -> "Read" | Write -> "Write"
let strin... |
8272959dfbf294a6f6156cc3ca8c4619cf1c8cb7ce853adb19998f4e263e05f8 | cedlemo/OCaml-GI-ctypes-bindings-generator | Statusbar.mli | open Ctypes
type t
val t_typ : t typ
val create :
unit -> Widget.t ptr
val get_context_id :
t -> string -> Unsigned.uint32
val get_message_area :
t -> Box.t ptr
val pop :
t -> Unsigned.uint32 -> unit
val push :
t -> Unsigned.uint32 -> string -> Unsigned.uint32
val remove :
t -> Unsigned.uint32 -> Unsigned... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Statusbar.mli | ocaml | open Ctypes
type t
val t_typ : t typ
val create :
unit -> Widget.t ptr
val get_context_id :
t -> string -> Unsigned.uint32
val get_message_area :
t -> Box.t ptr
val pop :
t -> Unsigned.uint32 -> unit
val push :
t -> Unsigned.uint32 -> string -> Unsigned.uint32
val remove :
t -> Unsigned.uint32 -> Unsigned... | |
8c91983624c7af76a1460a495e538d9e568c5d2bf7201701af0a85c26ef290ea | spawnfest/eep49ers | wxCheckBox.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . 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 copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxCheckBox.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(wxCheckBox).
-include("wxe.hrl").
-export([create/4,create/5,destroy/1,get3StateValue/1,getValue/1,is3State/... |
8ec16075531dad8443bf583e88c6a0d9bcea39814aa3680640e4fc36c51360ed | cram2/cram | padding-mask.lisp | Copyright ( c ) 2010 , < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list o... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_common/cram_location_costmap/src/padding-mask.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Red... | Copyright ( c ) 2010 , < >
* Neither the name of the Intelligent Autonomous Systems Group/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
959583ffb4682e5ac55e3bb1a6469388712847d39d239248d8e597e965d294be | trskop/command-wrapper | Message.hs | -- |
-- Module: $Header$
-- Description: Experiment to make help messages easier to create.
Copyright : ( c ) 2019 - 2020
License : BSD3
--
-- Maintainer:
-- Stability: experimental
Portability : GHC specific language extensions .
--
-- Experiment to make help messages easier to create. Highly... | null | https://raw.githubusercontent.com/trskop/command-wrapper/4f2e2e1f63a3296ccfad9f216d75a708969890ed/command-wrapper-core/src/CommandWrapper/Core/Help/Message.hs | haskell | |
Module: $Header$
Description: Experiment to make help messages easier to create.
Maintainer:
Stability: experimental
Experiment to make help messages easier to create. Highly experimental!
* Combinators
* Rendering
** IO
TODO: TMP
a special meaning. Better encoding would be desirable, however,... | Copyright : ( c ) 2019 - 2020
License : BSD3
Portability : GHC specific language extensions .
module CommandWrapper.Core.Help.Message
( Annotation(..)
, Annotated(..)
, HelpMessage(..)
, Paragraph
, Usage
, longOption
, shortOption
, metavar
, command
, value
... |
e62bac9f8be61fae6b02a3d7e9d5bfc0791c323e9f782cb3b8326b52ef62d48e | RefactoringTools/HaRe | Overload.hs | module Overload where
import Maybe(isJust)
class ToBool a where toBool :: a -> Bool
instance ToBool (Maybe a) where toBool = maybeToBool
maybeToBool = isJust
assert Trivial = {True} === {True}
assert Simple = {maybeToBool (Just 'a')} === {True}
assert Overloaded = {toBool (Just 'a')} === {True}
| null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/tools/property/tests/Overload.hs | haskell | module Overload where
import Maybe(isJust)
class ToBool a where toBool :: a -> Bool
instance ToBool (Maybe a) where toBool = maybeToBool
maybeToBool = isJust
assert Trivial = {True} === {True}
assert Simple = {maybeToBool (Just 'a')} === {True}
assert Overloaded = {toBool (Just 'a')} === {True}
| |
f69cd86949333a8247933ee24208443f351565b89b9328ad320eb6b34ce78737 | heechul/crest-z3 | cabs.ml |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/frontc/cabs.ml | ocaml |
** Types
Type specifier elements. These appear at the start of a declaration
Everywhere they appear in this file, they appear as a 'spec_elem list',
which is not interpreted by cabs -- rather, this "word soup" is passed
on to the compiler. Thus, we can represent e.g. 'int long float x' even
though the compi... |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions... |
33d948c656078eca2de35a3193af96d3610e99f469d928a659bb45fe7c14bd38 | jariazavalverde/blog | programacion-a-nivel-de-tipo.hs | # LANGUAGE DataKinds , KindSignatures , GADTs , TypeFamilies , StandaloneDeriving #
data Nat = Zero | Succ Nat
data Vector (n :: Nat) (a :: *) where
VNil :: Vector 'Zero a
VCons :: a -> Vector n a -> Vector ('Succ n) a
deriving instance Show a => Show (Vector n a)
type family Add (n :: Nat) (m :: Nat) where
... | null | https://raw.githubusercontent.com/jariazavalverde/blog/c8bbfc4394b077e8f9fc34593344d64f3a94153e/src/programacion-a-nivel-de-tipo/programacion-a-nivel-de-tipo.hs | haskell | # LANGUAGE DataKinds , KindSignatures , GADTs , TypeFamilies , StandaloneDeriving #
data Nat = Zero | Succ Nat
data Vector (n :: Nat) (a :: *) where
VNil :: Vector 'Zero a
VCons :: a -> Vector n a -> Vector ('Succ n) a
deriving instance Show a => Show (Vector n a)
type family Add (n :: Nat) (m :: Nat) where
... | |
d161ad4556671c6ed6227d3159ecc901c9c2ee3ec634fd671d50f2aa68b1b01d | robert-strandh/CLIMatis | rigidity.lisp | (in-package #:rigidity)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
Utilities .
;;; Check whether an object is a proper list. We expect the list to
;;; be relatively short, so there is no point in doing anything fancy.
;;; Loop over the CONS cells of the list until either the end of ... | null | https://raw.githubusercontent.com/robert-strandh/CLIMatis/4949ddcc46d3f81596f956d12f64035e04589b29/Rigidity/rigidity.lisp | lisp |
Check whether an object is a proper list. We expect the list to
be relatively short, so there is no point in doing anything fancy.
Loop over the CONS cells of the list until either the end of the
list is found, or we see a cell that we have already seen. If se
see a cell we have already seen, or we reach the e... | (in-package #:rigidity)
Utilities .
NIL at the end of the slist without having seen a cell twice , then
(defun proper-list-p (object)
(let ((cells '())
(rest object))
(loop until (atom rest)
do (if (member rest cells :test #'eq)
(return-from proper-list-p nil)
(progn (push rest cells)
(pop rest... |
6251404e7fb9dc7e2c0e9ccf4d692fde67b244306864bdfb10e5c76a15dcc9f7 | nextjournal/clerk | dice.clj | # 🎲
(ns dice
(:require [clojure.java.shell :as shell]
[nextjournal.clerk :as clerk]))
My kids have [ this game]( / produkte / spiele / mitbringspiele / nanu-23063 / index.html ) and we lost the dice that comes with it . It ca n't be too hard to make on in Clojure , can it ? The dice has five color... | null | https://raw.githubusercontent.com/nextjournal/clerk/625b607bfec1725019fca6c32054a97ed8f96d3f/notebooks/dice.clj | clojure | Here, we define a viewer using hiccup that will the dice as well as a button. Note that this button has an `:on-click` event handler that uses `v/clerk-eval` to tell Clerk to evaluate the argument, in this cases `(roll!)` when clicked.
Our roll! function `resets!` our `dice` with a random side and prints and says the... | # 🎲
(ns dice
(:require [clojure.java.shell :as shell]
[nextjournal.clerk :as clerk]))
My kids have [ this game]( / produkte / spiele / mitbringspiele / nanu-23063 / index.html ) and we lost the dice that comes with it . It ca n't be too hard to make on in Clojure , can it ? The dice has five color... |
f0d46707c531c843125a5454c822b24d8354efa08b22e4ce38e62c472933d0f0 | jsa-aerial/saite | tabs.cljs | (ns aerial.saite.tabs
(:require
[cljs.core.async
:as async
:refer (<! >! put! chan)
:refer-macros [go go-loop]]
[clojure.string :as cljstr]
[aerial.hanami.core
:as hmi
:refer [printchan user-msg
re-com-xref xform-recom
default-header-fn start
get-vspec... | null | https://raw.githubusercontent.com/jsa-aerial/saite/b4105c8619b2e0d112eeabfe0528ecf19434f933/src/cljs/aerial/saite/tabs.cljs | clojure | Interactive Editor Tab Constructors =================================== ;;;
General - multiple uses =============================================== ;;;
Header Editor Mgt Components ========================================== ;;;
Header Misc Component ================================================= ;;;
; ; | (ns aerial.saite.tabs
(:require
[cljs.core.async
:as async
:refer (<! >! put! chan)
:refer-macros [go go-loop]]
[clojure.string :as cljstr]
[aerial.hanami.core
:as hmi
:refer [printchan user-msg
re-com-xref xform-recom
default-header-fn start
get-vspec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.