_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 |
|---|---|---|---|---|---|---|---|---|
6c16360535d4da9a3d0731b0f56506e25483c8111c39147ca736ff355dfa3215 | janestreet/ppx_accessor | type.ml | open! Base
open! Import
module Variant = Ppx_accessor_variant
open Common
module Kind = struct
type t =
| Record of Record.t
| Variant of Variant.t
| Polymorphic_variant of Polymorphic_variant.t
let of_type_kind tk manifest ~loc =
match tk with
| Ptype_abstract ->
(match manifest with
... | null | https://raw.githubusercontent.com/janestreet/ppx_accessor/e5b9fbec2c91e8fced2dddee9d40fc9985307518/src/type.ml | ocaml | open! Base
open! Import
module Variant = Ppx_accessor_variant
open Common
module Kind = struct
type t =
| Record of Record.t
| Variant of Variant.t
| Polymorphic_variant of Polymorphic_variant.t
let of_type_kind tk manifest ~loc =
match tk with
| Ptype_abstract ->
(match manifest with
... | |
c6e331198a4b2e971783cd0f1e2fb9d2f9551c4335f50268e4d6e97c243bdd93 | haskell-servant/servant | Handler.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Servant.Server.Internal.Handler where
import Prelude ()
import Prelude.Compat
import... | null | https://raw.githubusercontent.com/haskell-servant/servant/8fccfccae04a2f7d2bbb013a53be3ff2967b8cfa/servant-server/src/Servant/Server/Internal/Handler.hs | haskell | # LANGUAGE DeriveGeneric # | # LANGUAGE CPP #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Servant.Server.Internal.Handler where
import Prelude ()
import Prelude.Compat
import Control.Monad.Base
... |
f4aad4c6275b370602a6f00bf7e3792eb30ee2ff6e6248cc0f6c7866675bf184 | msimon/chip8js | admin.ml | {server{
let session = Eliom_reference.eref ~persistent:"admin" ~scope:Eliom_common.default_session_scope false
let is_connected =
server_function Json.t<unit> (
fun _ ->
Eliom_reference.get session
)
let sign_in =
server_function Json.t<string> (
fun pwd ->
if pwd = (Co... | null | https://raw.githubusercontent.com/msimon/chip8js/67f6ea0e25a2cc2287b6915c4ca2639a9d64c632/src/admin.ml | ocaml | clean previous signal
regenerate the dom | {server{
let session = Eliom_reference.eref ~persistent:"admin" ~scope:Eliom_common.default_session_scope false
let is_connected =
server_function Json.t<unit> (
fun _ ->
Eliom_reference.get session
)
let sign_in =
server_function Json.t<string> (
fun pwd ->
if pwd = (Co... |
2c203cf4b24bbf1ce9d291f3cbf6c802bdf3295c5636548d300f7658f7dccf01 | aziem/binaryninja-ocaml | test.ml | let print_build_id () =
Binaryninja.get_build_id () |> Printf.printf "BUILD ID: %d\n"
let _ = print_build_id ();
| null | https://raw.githubusercontent.com/aziem/binaryninja-ocaml/5773d791ebb717816b8c47863bce8122f39764b4/test.ml | ocaml | let print_build_id () =
Binaryninja.get_build_id () |> Printf.printf "BUILD ID: %d\n"
let _ = print_build_id ();
| |
44d0eb381ef4583194b03d562cf9bea25cdd436a3636cc9dccfd7bf513424e12 | vikram/lisplibraries | package.lisp | ;;;;
Copyright ( c ) 2008 , 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/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/zs3-1.0.4/package.lisp | lisp |
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.
* Redistributions in binary form... | Copyright ( c ) 2008 , All Rights Reserved
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
package.lisp
(defpackage #:zs3
(:use #:cl)
(:export #:*credentials*
#:access-key
#:secret-key
... |
2ff5db594d6a742b9af2d2e1d561985f15faa46d957465d5bf9a66f1da2ab0f2 | omariosouto/learnin-public-clojure | util.cljc | (ns pokebank-ui.util)
(defn foo-cljc [x]
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| null | https://raw.githubusercontent.com/omariosouto/learnin-public-clojure/bb66040ef397d4d6e8275330acdd553bbf850a39/projects/pokebank-ui/src/cljc/pokebank_ui/util.cljc | clojure | (ns pokebank-ui.util)
(defn foo-cljc [x]
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| |
1a1f6b42cdbb25b75973f7a5d956cec65a718499603e90fdeaad70b2416f15f6 | pnwamk/tr-calc | dtr-fme.rkt | #lang racket
;; functions responsible for converting redex model representations
;; into data the 'fme' library can parse, and for taking 'fme' library
;; output and converting it back into redex model representations
(require fme
racket/contract
racket/set
"dtr-lang.rkt"
"utils.r... | null | https://raw.githubusercontent.com/pnwamk/tr-calc/17baa511af28139e686737c1f4c30d3b187efa2d/dtr-redex/dtr-fme.rkt | racket | functions responsible for converting redex model representations
into data the 'fme' library can parse, and for taking 'fme' library
output and converting it back into redex model representations | #lang racket
(require fme
racket/contract
racket/set
"dtr-lang.rkt"
"utils.rkt")
(provide (all-defined-out)
fme-sat?
fme-elim-vars)
(define int? exact-integer?)
(define/contract (satisfiable-Φ? Φ)
(-> Φ? boolean?)
(fme-sat? (φ-list->sli (dot-list->list Φ))... |
3deda4413c252568b6601570219da2db494feabaec1bc4909ee26ea21492c729 | tweag/ormolu | grouped-splices-out.hs | # LANGUAGE TemplateHaskell #
$(deriveJSON fieldLabelMod ''A)
$(deriveJSON fieldLabelMod ''B)
$(deriveJSON fieldLabelMod ''C)
| null | https://raw.githubusercontent.com/tweag/ormolu/50d0e28bfdeb5a39e975e16a4fba5bf0f9f78a6d/data/examples/declaration/splice/grouped-splices-out.hs | haskell | # LANGUAGE TemplateHaskell #
$(deriveJSON fieldLabelMod ''A)
$(deriveJSON fieldLabelMod ''B)
$(deriveJSON fieldLabelMod ''C)
| |
6b924983da67c7eaa9a0befebb4f290c5cb7154b5c6bff2629093106508a9940 | RRethy/nvim-treesitter-textsubjects | textsubjects-smart.scm | ((comment) @_start @_end
(#make-range! "range" @_start @_end))
(([
(left_assignment)
(left_assignment2)
(equals_assignment)
(super_assignment)
(super_right_assignment)
(right_assignment)
(call)
(function_definition)
(lambda_function)
(while)
(if)
(for)
(repeat)
... | null | https://raw.githubusercontent.com/RRethy/nvim-treesitter-textsubjects/b2a82b38a02fffa24c2177bf4bed97e5df5b1645/queries/r/textsubjects-smart.scm | scheme | ((comment) @_start @_end
(#make-range! "range" @_start @_end))
(([
(left_assignment)
(left_assignment2)
(equals_assignment)
(super_assignment)
(super_right_assignment)
(right_assignment)
(call)
(function_definition)
(lambda_function)
(while)
(if)
(for)
(repeat)
... | |
ae7937eb033800907b3a62e5665c7f898acfeb3b13894c82c117202fdec7a39a | HunterYIboHu/htdp2-solution | ex482-place-queens.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 place-queens-undergoing) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t cons... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter5/Section29-algorithm-that-backtrack/ex482-place-queens.rkt | racket | about the language level of this file in a form that our tools can easily process.
data definitions
(make-posn CI CI)
A CI is an N in [0, QUEENS).
interpretation (make-posn r c) denotes the square at
A Board is (make-board [List-of Posn] [List-of Posn] N)
data examples
constants
functions
N -> [Maybe [List... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname place-queens-undergoing) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(require 2htdp/image)
(define QUEEN... |
4a091502d75d77eaee225dd06dc0e50730892b6a3d00bd00f63f2054dc76186c | kerneis/cpc | dataslicing.ml |
*
* Copyright ( c ) 2004 ,
* < >
* < >
* 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 of source code must reta... | null | https://raw.githubusercontent.com/kerneis/cpc/0ca695d25e58dadbd92639162338a06a517875d9/src/ext/dataslicing.ml | ocaml | Avoid discarding void*.
Note: We strip off integer cast operations.
Note: We strip off integer cast operations.
Note: We update statements destructively so that goto/switch work.
Defer processing of vars until end. |
*
* Copyright ( c ) 2004 ,
* < >
* < >
* 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 of source code must reta... |
a496355382170907d5f35ddf6221ddb1c6f5659af0e0c88f95d39a8dedf402fc | falgon/htcc | StorageClass.hs | |
Module : Htcc . CRules . Types .
Description : The storage - class of C language
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
The storage - class of C language
Module : Htcc.CRules.Types.StorageClass
Description : Th... | null | https://raw.githubusercontent.com/falgon/htcc/3cef6fc362b00d4bc0ae261cba567bfd9c69b3c5/src/Htcc/CRules/Types/StorageClass.hs | haskell | ^ The @auto@ keyword
^ The @static@ keyword
^ The @register@ keyword | |
Module : Htcc . CRules . Types .
Description : The storage - class of C language
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
The storage - class of C language
Module : Htcc.CRules.Types.StorageClass
Description : Th... |
0c57368d626ac8f28fae6bcd65fdb981752a9632bba5cbe4c23aa73cb0a416db | macourtney/Dark-Exchange | get_peers.clj | (ns test.darkexchange.model.actions.get-peers
test - util must be required first .
[darkexchange.model.actions.action-keys :as action-keys]
[darkexchange.model.peer :as peer-model]
[test.fixtures.peer :as peer-fixture]
[test.fixtures.util :as fixtures-util])
... | null | https://raw.githubusercontent.com/macourtney/Dark-Exchange/1654d05cda0c81585da7b8e64f9ea3e2944b27f1/test/test/darkexchange/model/actions/get_peers.clj | clojure | (ns test.darkexchange.model.actions.get-peers
test - util must be required first .
[darkexchange.model.actions.action-keys :as action-keys]
[darkexchange.model.peer :as peer-model]
[test.fixtures.peer :as peer-fixture]
[test.fixtures.util :as fixtures-util])
... | |
a9d196f12fd501afcddd9d2602f5eace5a5d48b83c5b5e1d9378db11aa8914fd | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentMethodP24.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema PaymentMethodP24
module StripeAPI.Types.PaymentMethodP24 where
import qual... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentMethodP24.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema PaymentMethodP24
| Defines the object schema located at @components.schemas.payment_method_p24@ in the specification.
| bank: The customer\'s bank, if provided.
The customer\'s bank, if provided.
| This case is u... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.PaymentMethodP24 where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified ... |
5867b8ca286e42ae3e82f46146759e98d52ddd9e41781553ea58a6fd82dc6f19 | openworkload/swm-core | wm_state.erl | -module(wm_state).
-behaviour(gen_fsm).
-export([start_link/1]).
-export([enter/1, breakdown/1, get_current/0]).
-export([init/1, handle_event/3, handle_sync_event/4, handle_info/3, code_change/4, terminate/3]).
-export([stopped/2, loading/2, maint/2, offline/2, idle/2]).
-include("wm_log.hrl").
-record(mstate, {})... | null | https://raw.githubusercontent.com/openworkload/swm-core/c4d2b3101c446909f2eb4b1e575e6b706733b248/src/lib/wm_state.erl | erlang | ============================================================================
API
============================================================================
@doc Get current node state
============================================================================
Callbacks
========================================... | -module(wm_state).
-behaviour(gen_fsm).
-export([start_link/1]).
-export([enter/1, breakdown/1, get_current/0]).
-export([init/1, handle_event/3, handle_sync_event/4, handle_info/3, code_change/4, terminate/3]).
-export([stopped/2, loading/2, maint/2, offline/2, idle/2]).
-include("wm_log.hrl").
-record(mstate, {})... |
c430121d16a0f368daf00b4e9d7ff9e0d33055e34cb42ae3426601812c2340d4 | rodo/tsung-tricks | percentile_tests.erl | %%
%% @doc erlang module to calculate percentile
%%
@author < >
%% []
%%
2013
%%
-module(percentile_tests).
-include_lib("eunit/include/eunit.hrl").
%% tests
percentile95_test() ->
?assertEqual(25.80902099609375, percentile:percentile95([19.656982421875,196.5009765625,12.508056640625,15.0078125,20.738... | null | https://raw.githubusercontent.com/rodo/tsung-tricks/f6c1e9638132745cec3628a65fbea2fdfcb6e17a/percentile_tests.erl | erlang |
@doc erlang module to calculate percentile
[]
tests | @author < >
2013
-module(percentile_tests).
-include_lib("eunit/include/eunit.hrl").
percentile95_test() ->
?assertEqual(25.80902099609375, percentile:percentile95([19.656982421875,196.5009765625,12.508056640625,15.0078125,20.738037109375,12.696044921875,17.593017578125,12.496826171875,12.367919921875,1... |
c654a8366fbfcd4a6f18b76468a0c290194aa3e039eb3fd3bbdc11fc673b51bf | VincentToups/racket-lib | dungeon-scratch.rkt | #lang racket
(require (except-in utilities/lists any all)
(rename-in utilities/lists [any lists.any] [all lists.all])
functional/monads
(except-in functional/point-free compose)
(rename-in functional/point-free [compose comp])
utilities/one-of
utilities/simple-infix... | null | https://raw.githubusercontent.com/VincentToups/racket-lib/d8aed0959fd148615b000ceecd7b8a6128cfcfa8/roguelikes/dungeon-scratch.rkt | racket | #lang racket
(require (except-in utilities/lists any all)
(rename-in utilities/lists [any lists.any] [all lists.all])
functional/monads
(except-in functional/point-free compose)
(rename-in functional/point-free [compose comp])
utilities/one-of
utilities/simple-infix... | |
f991d3b84de62198ae373149e3e56f617d9a185c4a68c50087e7c35cb319a0a9 | practicalli/four-clojure | 022_count_a_sequence.clj | (ns four-clojure.022-count-a-sequence)
# 22 Count a Sequence
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Difficulty: Easy
Topics : seqs core - functions
;; Restricted: `count`
;; Write a function which returns the total number of elements in a sequence.
(= ( _ _ ' ( 1 2 3 3 1 ) ) 5 )
(= ( _ _ " Hello Wo... | null | https://raw.githubusercontent.com/practicalli/four-clojure/9812b63769a06f9b0bfd63e5ffce380b67e5468b/src/four_clojure/022_count_a_sequence.clj | clojure |
Difficulty: Easy
Restricted: `count`
Write a function which returns the total number of elements in a sequence.
The `count` function would solve this exercise all by itself, but its restricted, so we have a chance to think about how the `count` function works.
REPL experiments
using loop recur
Wrapping the lo... | (ns four-clojure.022-count-a-sequence)
# 22 Count a Sequence
Topics : seqs core - functions
(= ( _ _ ' ( 1 2 3 3 1 ) ) 5 )
(= ( _ _ " Hello World " ) 11 )
(= ( _ _ [ [ 1 2 ] [ 3 4 ] [ 5 6 ] ] ) 3 )
(= ( _ _ ' ( 13 ) ) 1 )
(= ( _ _ ' (: a : b : c ) ) 3 )
Deconstruct the problem
(loop [collec... |
d126beea73c5f069b1913584d42eb8939f8a7d85e6281e927ba3488b3373c31a | csabahruska/jhc-components | HashConst.hs | module Grin.HashConst(newConst,HcHash(),HcNode(..),toList,emptyHcHash) where
import Control.Monad.State
import qualified Data.Map as Map
import qualified Data.Set as Set
import Grin.Grin
import StringTable.Atom
import Util.Graph
-- TODO tuples
data HcNode = HcNode {-# UNPACK #-} !Atom [Either Val Int]
deriving(... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-grin/src/Grin/HashConst.hs | haskell | TODO tuples
# UNPACK # | module Grin.HashConst(newConst,HcHash(),HcNode(..),toList,emptyHcHash) where
import Control.Monad.State
import qualified Data.Map as Map
import qualified Data.Set as Set
import Grin.Grin
import StringTable.Atom
import Util.Graph
deriving(Show,Ord,Eq)
data HcHash = HcHash !Int (Map.Map HcNode Int)
deriving(... |
e3fadffd3145b40802226045dbd89f9e0f1dc229ae0bba80be6bd1f3970a0493 | erwanor/binbin | binbin.ml | type t = string
let empty = ""
let zero_b = "0"
let one_b = "1"
let unsafe_s binstr = binstr
let unsafe_b binstr = binstr
let init n = String.make n '0'
let size binstr = String.length (unsafe_s binstr)
(** UTILITIES AND HELPERS **)
let is_bit_on b = (b = one_b)
let distance_to_byte b =
let len = size b ... | null | https://raw.githubusercontent.com/erwanor/binbin/0124fdc7838314963d302eb6c89e802c4bbdb7d0/lib/binbin.ml | ocaml | * UTILITIES AND HELPERS *
* IMPLEMENTATION * | type t = string
let empty = ""
let zero_b = "0"
let one_b = "1"
let unsafe_s binstr = binstr
let unsafe_b binstr = binstr
let init n = String.make n '0'
let size binstr = String.length (unsafe_s binstr)
let is_bit_on b = (b = one_b)
let distance_to_byte b =
let len = size b in
if len < 8 then (8 - le... |
35ca35b7ef86006ba605f9b3b0ca731c6b058cc99d14d38cf59885cc4fccf6e2 | kaznum/programming_in_ocaml_exercise | canvas.ml | 15.2.16
open Tk
let top = openTk()
let cv = Canvas.create top
let c = Canvas.create_oval cv
~x1:10 ~y1:10 ~x2:100 ~y2:100 ~fill:`Blue ~width:5 ~outline:`Red
let b = Button.create top ~text:"Press me!"
~command:(fun () -> Canvas.configure_oval cv c ~fill:`Red)
let () =
pack [coe b; coe cv];
mainLoop()
| null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ch15/canvas.ml | ocaml | 15.2.16
open Tk
let top = openTk()
let cv = Canvas.create top
let c = Canvas.create_oval cv
~x1:10 ~y1:10 ~x2:100 ~y2:100 ~fill:`Blue ~width:5 ~outline:`Red
let b = Button.create top ~text:"Press me!"
~command:(fun () -> Canvas.configure_oval cv c ~fill:`Red)
let () =
pack [coe b; coe cv];
mainLoop()
| |
cb3757359922206a1d440f2b08ec0f83b57f7cf0822e27af2f069bb3468413ff | jbrisbin/rabbit_common | mirrored_supervisor.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/jbrisbin/rabbit_common/80814606ae23cc820c74e443383e192cd69ec030/src/mirrored_supervisor.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.
Mirrored Superv... | 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 ) 2011 - 2015 Pivotal Software , Inc. All rights reserved .
... |
3d139d098f8483dd1563288d4978f76ed9a082e188bce7a35359f48f055876d5 | lokedhs/containers | tree.lisp | (in-package :receptacle)
(defclass tree (container)
()
(:documentation "Generic tree class that provides implementations of
generic functions that are implemented through the standard tree
API."))
(defclass tree-iterator ()
((tree :type t
:initarg :tree
:reader tree-iterator/tree)
... | null | https://raw.githubusercontent.com/lokedhs/containers/5d4ce688bddd51ee34a4259e37b698b84f650bdf/src/tree.lisp | lisp | (in-package :receptacle)
(defclass tree (container)
()
(:documentation "Generic tree class that provides implementations of
generic functions that are implemented through the standard tree
API."))
(defclass tree-iterator ()
((tree :type t
:initarg :tree
:reader tree-iterator/tree)
... | |
d9971d7fc23a804fdd7f45f93342ee2eab11f3b6049be29954b9d941dd6c163a | hiroshi-unno/coar | sum_nonlinear.ml | @require nonlinear invariants
@todo can we find an interpolant " r > = x * x / 2 " by solving the following interpolation problem :
" x = 0 /\ r = 0 ; not ( 2 * r > = x * x ) " ?
@todo can we find an interpolant "r >= x * x / 2" by solving the following interpolation problem:
"x = 0 /... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/benchmarks/OCaml/safety/tacas2015/sum_nonlinear.ml | ocaml | @require nonlinear invariants
@todo can we find an interpolant " r > = x * x / 2 " by solving the following interpolation problem :
" x = 0 /\ r = 0 ; not ( 2 * r > = x * x ) " ?
@todo can we find an interpolant "r >= x * x / 2" by solving the following interpolation problem:
"x = 0 /... | |
50ab07a769cd2979706960f647ccf7898508fe48036b63c31fcab9410ce09ec2 | fiddlerwoaroof/lisp-sandbox | tip-calc.lisp | #!/usr/local/bin/sbcl --script
(declaim (optimize (speed 0) (safety 3) (debug 3)))
(load #p"~/quicklisp/setup.lisp")
(ql:quickload :qtools)
(ql:quickload :cells)
(ql:quickload :qtcore)
(ql:quickload :qtgui)
(ql:quickload :parse-number)
(ql:quickload :alexandria)
(ql:quickload :anaphora)
(cl:defpackage :tipcalc.models
... | null | https://raw.githubusercontent.com/fiddlerwoaroof/lisp-sandbox/38ff817c95af35db042faf760b477675264220d2/tip-calc.lisp | lisp | (defparameter *service-rating* (make-instance 'service-rating))
(defparameter *tip-calc* (make-instance 'tip-calc :rate (rate *service-rating*)))
I want this to run:
EITHER When the old value is not bound
OR When the old value is not equal to the new value | #!/usr/local/bin/sbcl --script
(declaim (optimize (speed 0) (safety 3) (debug 3)))
(load #p"~/quicklisp/setup.lisp")
(ql:quickload :qtools)
(ql:quickload :cells)
(ql:quickload :qtcore)
(ql:quickload :qtgui)
(ql:quickload :parse-number)
(ql:quickload :alexandria)
(ql:quickload :anaphora)
(cl:defpackage :tipcalc.models
... |
e30ab43f8b509d6e88b1ea27c04c5819ff3a873e4b7288c6d9e82f98f397b342 | DSiSc/why3 | why3execute.ml | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/tools/why3execute.ml | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
open Format
open Why3
open Wstdlib
let usage_msg = sprintf
"Usage: %s [options] file module.ident..."
... |
be966a2ab43b735631ac16a261ce616b61be01cb1b6372d68f294c08110de69d | raptazure/experiments | Main.hs | module Main where
import Control.Monad (when)
import qualified Data.ByteString as B
import Data.List
import Lib
import System.Environment
import System.Random
-- main :: IO ()
-- main = do
-- gen <- getStdGen
-- let randomChars = randomRs ('a', 'z') gen
( first20 , rest ) = splitAt 20 randomChars
... | null | https://raw.githubusercontent.com/raptazure/experiments/c48263980d1ce22ee9407ff8dcf0cf5091b01c70/haskell/learnyouahaskell/ch09e/app/Main.hs | haskell | main :: IO ()
main = do
gen <- getStdGen
let randomChars = randomRs ('a', 'z') gen
main = do
gen <- getStdGen
gen' <- newStdGen
main = do
gen <- getStdGen
numberString <- getLine
when (not $ null numberString) $ do
let number = read numberString
then putStrLn "You are correct!"
... | module Main where
import Control.Monad (when)
import qualified Data.ByteString as B
import Data.List
import Lib
import System.Environment
import System.Random
( first20 , rest ) = splitAt 20 randomChars
( second20 , _ ) = splitAt 20 rest
first20
putStrLn $ take 20 ( randomRs ( ' a','... |
275117ca73bfb7528075d559a8b77115adb50cef491bc998da17b098021e5dbb | janestreet/sexp | main_print.ml | open Core
let command =
Command.basic
~summary:"pretty-print an s-expression"
(let%map_open.Command { machine; fail_on_parse_error } =
Shared_params.machine_and_fail_on_parse_error
in
fun () ->
let perform_query sexp_ext ~on_result =
let lazy_results = Sexp_app.Semantics.quer... | null | https://raw.githubusercontent.com/janestreet/sexp/2414e8f11fadff4a33fff87bd79fb614ee7642f3/bin/main_print.ml | ocaml | open Core
let command =
Command.basic
~summary:"pretty-print an s-expression"
(let%map_open.Command { machine; fail_on_parse_error } =
Shared_params.machine_and_fail_on_parse_error
in
fun () ->
let perform_query sexp_ext ~on_result =
let lazy_results = Sexp_app.Semantics.quer... | |
eb53e738d4066393e4b6d61169f9ef86e5a5d3482f5891cb049e94fcb500275b | mzp/coq-ide-for-ios | explore.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/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/lib/explore.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
s Search strategies.
s A search pro... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : explore.mli 13323 2... |
94d14d15ea732ba98e5e162cc35c5afe6f0f68fe51ccec39f2b74f48b2a51c54 | chenyukang/eopl | top.scm | ;; here are some other things that could be provided:
;; (provide (all-defined))
;; (provide (all-from "interp.scm"))
;; (provide (all-from "lang.scm"))
;;;;;;;;;;;;;;;; interface to test harness ;;;;;;;;;;;;;;;;
run : String - > ExpVal
Page : 71
(define run
(lambda (string)
... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter3/let-lang/top.scm | scheme | here are some other things that could be provided:
(provide (all-defined))
(provide (all-from "interp.scm"))
(provide (all-from "lang.scm"))
interface to test harness ;;;;;;;;;;;;;;;;
run-all : () -> unspecified
runs all the tests in test-list, comparing the results with
equal-answer?
run-one : s... |
run : String - > ExpVal
Page : 71
(define run
(lambda (string)
(value-of-program (scan&parse string))))
(define run-all
(lambda ()
(run-tests! run equal-answer? test-list)))
(define equal-answer?
(lambda (ans correct-ans)
(equal? ans (sloppy->expval corr... |
b3a74efdf32a8c81e97c12943ba849b93f85de36ce75e71eaadbe666828c2a92 | ryancrum/bifrost | bifrost.erl | %%%-------------------------------------------------------------------
%%% File : bifrost.erl
Author : < >
%%% Description : Pluggable FTP Server gen_server
%%%-------------------------------------------------------------------
-module(bifrost).
-behaviour(gen_server).
-include("bifrost.hrl").
-include_lib(... | null | https://raw.githubusercontent.com/ryancrum/bifrost/c91a176be39535540aa688a7ad24d5d7c7fce479/src/bifrost.erl | erlang | -------------------------------------------------------------------
File : bifrost.erl
Description : Pluggable FTP Server gen_server
-------------------------------------------------------------------
gen_server callbacks
gen_server callbacks implementation
ssl:ssl_accept/2 will return {error, not_owner} otherw... | Author : < >
-module(bifrost).
-behaviour(gen_server).
-include("bifrost.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([start_link/2, establish_control_connection/2, await_connections/2, supervise_connections/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_chang... |
ee1d27e41b974b760116747a48f12854b1253e98cab0ca1198861854e5c6e745 | mirage/index | buffer.mli | The MIT License
Copyright ( c ) 2021 < >
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
to use ... | null | https://raw.githubusercontent.com/mirage/index/fe5e962534d192389484ecc63a25e4ab4668a2f0/src/unix/buffer.mli | ocaml | * Extensible buffers with non-allocating access to the buffer's contents.
* The type of buffers.
* [create n] is a fresh buffer with initial size [n].
* [length b] is the number of bytes contained in the buffer.
* [is_empty t] iff [t] contains 0 characters.
* [clear t] clears the data contained in [t]. It does not... | The MIT License
Copyright ( c ) 2021 < >
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
to use ... |
ad081c55cf3160610f6da11930aac22c3477764a9a3c3a49c539605a21f664a5 | moonpolysoft/dynomite | vector_clock.erl | -module (vector_clock).
-export ([create/1, truncate/1, increment/2, compare/2, resolve/2, merge/2]).
-ifdef(TEST).
-include("etest/vector_clock_test.erl").
-endif.
create(NodeName) -> [{NodeName, lib_misc:now_float()}].
truncate(Clock) when length(Clock) > 10 ->
lists:nthtail(length(Clock) - 10, lists:keysort(2, ... | null | https://raw.githubusercontent.com/moonpolysoft/dynomite/a5618dcbe17b16cefdc9c567f27a1f4445aee005/elibs/vector_clock.erl | erlang | exists an index z' such that ClockA[z'] < ClockB[z']
length takes care of the case when clockA is shorter than B | -module (vector_clock).
-export ([create/1, truncate/1, increment/2, compare/2, resolve/2, merge/2]).
-ifdef(TEST).
-include("etest/vector_clock_test.erl").
-endif.
create(NodeName) -> [{NodeName, lib_misc:now_float()}].
truncate(Clock) when length(Clock) > 10 ->
lists:nthtail(length(Clock) - 10, lists:keysort(2, ... |
4e914a036fe30e95ed878b3d22839909cce906b129c732a3e372bc58a4d38f79 | kiselgra/c-mera | cxx.misc.trycatch.00.lisp | (include <iostream>)
(include <stdexcept>)
(using-namespace std)
(function bar1 () -> int
(throw 1))
(function bar2 () -> int
(throw (logic_error "not logical")))
(function bar3 () -> int
(throw (runtime_error "error")))
(function bar4 () -> int
(return 123))
(function bar5 () -> int
(throw 0.0f))
(type... | null | https://raw.githubusercontent.com/kiselgra/c-mera/d06ed96d50a40a3fefe188202c8c535d6784f392/tests/cxx.misc.trycatch.00.lisp | lisp | ## base exception: not logical
## runtime error: error
## whatever! | (include <iostream>)
(include <stdexcept>)
(using-namespace std)
(function bar1 () -> int
(throw 1))
(function bar2 () -> int
(throw (logic_error "not logical")))
(function bar3 () -> int
(throw (runtime_error "error")))
(function bar4 () -> int
(return 123))
(function bar5 () -> int
(throw 0.0f))
(type... |
fda366f750a671cf3f6b3e21482c919ab5316dbcc20df7fc896909755bb64c69 | lndl/chesssimple | BoardAI.hs | module Chesssimple.BoardAI (evaluateBoard) where
import Data.Matrix
import Chesssimple.Board
import Chesssimple.Color
------------------
-- For AI Scoring
------------------
inf = 99999999999999999999999999999
evaluateBoard :: Board -> Color -> Int
evaluateBoard board color
| isCheckMate board color = - inf -- No... | null | https://raw.githubusercontent.com/lndl/chesssimple/dec08b72d72bc9dee62a11486c8d2b5126de612a/Chesssimple/BoardAI.hs | haskell | ----------------
For AI Scoring
----------------
Note: is always negative because 'isCheckMate' evaluates true when the current color lose by than condition | module Chesssimple.BoardAI (evaluateBoard) where
import Data.Matrix
import Chesssimple.Board
import Chesssimple.Color
inf = 99999999999999999999999999999
evaluateBoard :: Board -> Color -> Int
evaluateBoard board color
| otherwise =
let numberOf = \color piece -> length $ positionsOf board color piece
... |
c4047e17e4bfe715f4244d9d3360330715ab3fcf3ebc250b9f1d56203b83299d | bdeket/rktsicm | vandermonde.rkt | #lang racket/base
(require rackunit
"../../../numerics/linear/vandermonde.rkt"
"../../../kernel-intr.rkt"
)
(define the-tests
(test-suite
"numerics/linear/vandermonde"
(check-equal? (solve-vandermonde-system '(3 5 7) '(9 11 13)
(lambda (x) x) (lambda () 'foo))
... | null | https://raw.githubusercontent.com/bdeket/rktsicm/9a6177d98040f058214add392bd791f5259b83b5/rktsicm/sicm/tests/numerics/linear/vandermonde.rkt | racket | #lang racket/base
(require rackunit
"../../../numerics/linear/vandermonde.rkt"
"../../../kernel-intr.rkt"
)
(define the-tests
(test-suite
"numerics/linear/vandermonde"
(check-equal? (solve-vandermonde-system '(3 5 7) '(9 11 13)
(lambda (x) x) (lambda () 'foo))
... | |
0065f4cd476ca489a109a96a1db352b31ee7a4e40d917ca630c0832ff5511ae5 | arowM/heterocephalus | Heterocephalus.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - orphans #
|
Module : Text . Heterocephalus
Copyright : 2016
License : MIT
Stability : experimental
Portability : unknown
This module exports ... | null | https://raw.githubusercontent.com/arowM/heterocephalus/ecb08006fc9cbe72f25498f3ce7c5f30a41d4e48/src/Text/Heterocephalus.hs | haskell | * Core functions
* QuasiQuoters
* low-level
$setup
>>> :set -XTemplateHaskell -XQuasiQuotes
>>> import Text.Blaze.Renderer.String
| Same as 'compileTextFile' but escapes template variables in HTML.
>>> putStr $ renderMarkup (let as = ["<a>", "b"] in $(compileHtmlFile "templates/sample.txt"))
sample
key:... | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - orphans #
|
Module : Text . Heterocephalus
Copyright : 2016
License : MIT
Stability : experimental
Portability : unknown
This module exports ... |
18a6262203264255ebcb38ef420043d8effd6d97bc441c4354c94c320a460058 | argp/bap | reduced_havlak_suite.ml | open BatPervasives
open OUnit
open Lnf_test
module L = Lnf_reduced_havlak.Make(G)
open Lnf
let n = G.G.V.create;;
let v0 = n 0
and va = n 1
and vb = n 2
and vc = n 3
and vd = n 4
and ve = n 5
and vf = n 6
and vg = n 7
and vh = n 8
and vend = n 9
let ramalingam_fig2 : test = (v0, [
(v0, [va; vend]);
(va, [vb; v... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/tests/reduced_havlak_suite.ml | ocaml | open BatPervasives
open OUnit
open Lnf_test
module L = Lnf_reduced_havlak.Make(G)
open Lnf
let n = G.G.V.create;;
let v0 = n 0
and va = n 1
and vb = n 2
and vc = n 3
and vd = n 4
and ve = n 5
and vf = n 6
and vg = n 7
and vh = n 8
and vend = n 9
let ramalingam_fig2 : test = (v0, [
(v0, [va; vend]);
(va, [vb; v... | |
99c2ad922743d88d97149e7d27368e783a85d851d3b8f3a03bf657484cc06452 | haskell-numerics/hmatrix | Bessel.hs | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - unused - top - binds #
------------------------------------------------------------
-- |
-- Module : Numeric.GSL.Special.Bessel
Copyright : ( c ) 2006 - 11
-- License : GPL
Maintainer : ( aruiz at um dot es )
-- Stability : provisional
-- Por... | null | https://raw.githubusercontent.com/haskell-numerics/hmatrix/2694f776c7b5034d239acb5d984c489417739225/packages/special/lib/Numeric/GSL/Special/Bessel.hs | haskell | ----------------------------------------------------------
|
Module : Numeric.GSL.Special.Bessel
License : GPL
Stability : provisional
Portability : uses ffi
Wrappers for selected functions described at:
<>
---------------------------------------------------------- | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - unused - top - binds #
Copyright : ( c ) 2006 - 11
Maintainer : ( aruiz at um dot es )
module Numeric.GSL.Special.Bessel(
bessel_J0_e
, bessel_J0
, bessel_J1_e
, bessel_J1
, bessel_Jn_e
, bessel_Jn
, bessel_Y0_e
, bessel_Y0
, bessel_Y1_e
, bessel_Y1
, b... |
182f4a7aa9f9851dc1f2dd4469212a808e9682b202191698501b971b21a1d718 | VitoVan/calm | canvas.lisp | (in-package #:calm)
(defparameter *color-list* '((0.83 0.82 0.84) (0.89 0.12 0.17) (0.94 0.87 0.47) (0 0.35 0.59)))
(defun draw ()
(dotimes (i 7)
(apply #'c:set-source-rgb (nth (if (>= i 4) (- i 4) i) *color-list*))
(c:arc (+ 60 (* (- (/ *calm-window-width* 5) 40) i)) 70 50 0 (* 2 pi))
(c:fill-path)))
| null | https://raw.githubusercontent.com/VitoVan/calm/1f0ef3d978fc83a16eaee897cd982bfad2a08373/docs/src/examples/circles/canvas.lisp | lisp | (in-package #:calm)
(defparameter *color-list* '((0.83 0.82 0.84) (0.89 0.12 0.17) (0.94 0.87 0.47) (0 0.35 0.59)))
(defun draw ()
(dotimes (i 7)
(apply #'c:set-source-rgb (nth (if (>= i 4) (- i 4) i) *color-list*))
(c:arc (+ 60 (* (- (/ *calm-window-width* 5) 40) i)) 70 50 0 (* 2 pi))
(c:fill-path)))
| |
962a8ad20271e3e2b8e32aa1e9ef0640ece98841ae3950c2ca3f79e598355f47 | CompSciCabal/SMRTYPRTY | ynasser-3.1.rkt | #lang racket
Exercise 3.1
(define (make-accumulator a)
(lambda (x) (begin (set! a (+ a x)) a)))
Exercise 3.2
;; This works, but I don't quite understand why. Is it just because of the
;; order in which things are called?
(define (make-monitored fn)
(define counter 0)
(define (mf n)
(cond
((eq? n '... | null | https://raw.githubusercontent.com/CompSciCabal/SMRTYPRTY/4a5550789c997c20fb7256b81469de1f1fce3514/sicp/v1/chapter-3.1/ynasser-3.1.rkt | racket | This works, but I don't quite understand why. Is it just because of the
order in which things are called?
a new password. Make-joint is to create an additional access to the original account using the new
(define (estimate-pi trials)
(sqrt (/ 6 (monte-carlo trials cesaro-test))))
(define (cesaro-test)
(define (it... | #lang racket
Exercise 3.1
(define (make-accumulator a)
(lambda (x) (begin (set! a (+ a x)) a)))
Exercise 3.2
(define (make-monitored fn)
(define counter 0)
(define (mf n)
(cond
((eq? n 'how-many-calls) counter)
((eq? n 'reset) (set! counter 0))
(else (set! counter (+ 1 counter))
... |
b5187f9b76cb6d826727922bff0b1baf7b1707048dce32f067d7420e1afb10ff | lehitoskin/blight | chat.rkt | #lang racket/gui
; chat.rkt
; contains chat-window definitions
(require libtoxcore-racket
(only-in racket/flonum
fl->exact-integer)
"msg-editor.rkt"
"msg-history.rkt"
"../helpers.rkt"
"../history.rkt"
"../config.rkt"
"../utils.rkt"
... | null | https://raw.githubusercontent.com/lehitoskin/blight/807b0437c92ee41c68ca5a767d973817ae416b65/gui/chat.rkt | racket | chat.rkt
contains chat-window definitions
clipboard control thingie
key event from editor%
key event from frame itself
obtain our tox id
the sending file transfer list and its path list
(define/private repeat
(λ (proc times)
tell the chat frame to change the chat window title
when msg-read? is #f
create a... | #lang racket/gui
(require libtoxcore-racket
(only-in racket/flonum
fl->exact-integer)
"msg-editor.rkt"
"msg-history.rkt"
"../helpers.rkt"
"../history.rkt"
"../config.rkt"
"../utils.rkt"
(only-in pict
bitmap
... |
7da696e8f542261f16273dc107908edff25d67cc710a251ad4fc2a366bc0e176 | smudgelang/smudge | Extra.hs | Copyright 2017 Bose Corporation .
-- This software is released under the 3-Clause BSD License.
-- The license can be viewed at
# LANGUAGE ExistentialQuantification #
module System.Console.GetOpt.Extra (
ArgOrder(..),
ArgDescr(..),
OptDescr(..),
usageInfo,
getOpt
) where
import Text.Wrap (wrapT... | null | https://raw.githubusercontent.com/smudgelang/smudge/c4f4fc3c7e6344fb0dd39d4679752120c7ff83da/src/System/Console/GetOpt/Extra.hs | haskell | This software is released under the 3-Clause BSD License.
The license can be viewed at
The option conversion is as follows:
if there are no negative long opts, the char opts are positive
if all long opts are negative, the char opts are negative
else, the char opts are positive, and the long opts are split | Copyright 2017 Bose Corporation .
# LANGUAGE ExistentialQuantification #
module System.Console.GetOpt.Extra (
ArgOrder(..),
ArgDescr(..),
OptDescr(..),
usageInfo,
getOpt
) where
import Text.Wrap (wrapText, defaultWrapSettings)
import Data.Text (Text, pack, unpack)
import Data.List (partition, i... |
0f946731cbbabb1fa20e1269e792bc513a38288f659dbb401f123ed34e954b8c | nachivpn/mt | b19.erl | -module(b19).
-type either(A) :: {left,A} | {right, A}.
-type dir(A) :: {left,A} | {right, A} | {fwd,A} | {bwd,A}.
extract({left,A}) -> A;
extract({right,A}) -> A.
un - unifiable return types
foo12() -> extract({left,1.0});
foo12() -> extract({left,true}). | null | https://raw.githubusercontent.com/nachivpn/mt/fcffbcb770cfe0b19c189e6c8ce2ccab61062195/test/bad/b19.erl | erlang | -module(b19).
-type either(A) :: {left,A} | {right, A}.
-type dir(A) :: {left,A} | {right, A} | {fwd,A} | {bwd,A}.
extract({left,A}) -> A;
extract({right,A}) -> A.
un - unifiable return types
foo12() -> extract({left,1.0});
foo12() -> extract({left,true}). | |
adf18e68213592fd9171dcaea3f93c27448aa7aee4931294dea1ad1b78fb64a3 | ocaml/ocamlfind | fl_dynload.mli | $ Id$
(** Utilities for loading dynamically packages *)
val load_packages : ?debug:bool -> string list -> unit
* Load the given packages and all their dependencies dynamically . Packages
already loaded or already in - core are not loaded again . The predicates
are taken from { ! Findlib.recorded_predica... | null | https://raw.githubusercontent.com/ocaml/ocamlfind/678148e559cf207bee5d3836ac4d18ed4dffda6c/src/findlib/fl_dynload.mli | ocaml | * Utilities for loading dynamically packages | $ Id$
val load_packages : ?debug:bool -> string list -> unit
* Load the given packages and all their dependencies dynamically . Packages
already loaded or already in - core are not loaded again . The predicates
are taken from { ! Findlib.recorded_predicates } , which are normally the
predicates fr... |
ff5268a8dbbd944a403b36e6f7809200e9982df11135c266adb4c70d57e80bdc | brunjlar/simple-plutus | Counter.hs | {-# LANGUAGE OverloadedStrings #-}
module Examples.Counter where
import Plutus
-- | A simple state machine implementing a counter.
counter :: StateMachine Natural ()
counter = StateMachine
{ initialState = 0
, transit = \n () -> Just $ n + 1
, isFinal = const False
}
-- | Submits a transac... | null | https://raw.githubusercontent.com/brunjlar/simple-plutus/20fe63533cb5006e4dabce09ef02c3bd960fd3bb/src/Examples/Counter.hs | haskell | # LANGUAGE OverloadedStrings #
| A simple state machine implementing a counter.
| Submits a transaction that ticks the counter.
find the current state machine output
|
RESULT : ()
outputs:
<BLANKLINE>
TxId Ix Address Value ... |
module Examples.Counter where
import Plutus
counter :: StateMachine Natural ()
counter = StateMachine
{ initialState = 0
, transit = \n () -> Just $ n + 1
, isFinal = const False
}
count :: ScriptId -> Token -> ChainM ()
count sid t = do
(ptr, output) <- do
x <- stateMachineOu... |
b59440c5cd6ae8a3bfd841cdd021c7f0fc2d2cff9e265f5df4c4da4e9f5b329d | 4clojure/4clojure | static.clj | (ns foreclojure.static
(:use [compojure.core :only [defroutes GET]]
[foreclojure.ring-utils :only [static-url]]
[foreclojure.template :only [def-page]]
[hiccup.form :only [hidden-field]]))
(def-page help-page []
{:title "Help"
:content
[:div#help-conte... | null | https://raw.githubusercontent.com/4clojure/4clojure/25dec057d9d6871ce52aee9e2c3de7efdab14373/src/foreclojure/static.clj | clojure | (ns foreclojure.static
(:use [compojure.core :only [defroutes GET]]
[foreclojure.ring-utils :only [static-url]]
[foreclojure.template :only [def-page]]
[hiccup.form :only [hidden-field]]))
(def-page help-page []
{:title "Help"
:content
[:div#help-conte... | |
f2633965646cd82b93dc2f6c8b18197b929cf2fab5c46af99746fb09ac99d531 | oshyshko/adventofcode | D18.hs | module Y21.D18 where
import Imports
import Parser
data Tree
= Lit Int
| Pair Tree Tree
deriving (Show, Eq)
[ [ 1,2],3 ]
tree :: Parser Tree
tree =
between (char '[') (char ']')
(Pair <$> litOrPair <* char ',' <*> litOrPair)
where
litOrPair = (Lit <$> natural) <|> t... | null | https://raw.githubusercontent.com/oshyshko/adventofcode/cbf5632417fc1a81bae968ece0ec31aeb6049447/src/Y21/D18.hs | haskell | try change A (left branch)
otherwise, try change B (right branch) | module Y21.D18 where
import Imports
import Parser
data Tree
= Lit Int
| Pair Tree Tree
deriving (Show, Eq)
[ [ 1,2],3 ]
tree :: Parser Tree
tree =
between (char '[') (char ']')
(Pair <$> litOrPair <* char ',' <*> litOrPair)
where
litOrPair = (Lit <$> natural) <|> t... |
f56bbbf10bbd12bf0631d9a1ce9de559fe2e3a166ff885e3cd34168d3f40689f | bblimke/clj-pusher | core.clj | (ns org.rathore.amit.conjure.core
(:use clojure.test))
(def call-times (atom {}))
(defn stub-fn [function-name return-value]
(swap! call-times assoc function-name [])
(fn [& args]
(swap! call-times update-in [function-name] conj args)
return-value))
(defn mock-fn [function-name]
(stub-fn function-nam... | null | https://raw.githubusercontent.com/bblimke/clj-pusher/e81e7e6a4fa26d0ae989de51427428776003ba21/test/org/rathore/amit/conjure/core.clj | clojure | (ns org.rathore.amit.conjure.core
(:use clojure.test))
(def call-times (atom {}))
(defn stub-fn [function-name return-value]
(swap! call-times assoc function-name [])
(fn [& args]
(swap! call-times update-in [function-name] conj args)
return-value))
(defn mock-fn [function-name]
(stub-fn function-nam... | |
038c71cb43883c462caec4f9ae6f207a95deaf7113e0e3a35e25a3a7f21a8b01 | mput/sicp-solutions | 2_31.test.rkt | #lang racket
(require rackunit/text-ui)
(require rackunit "custom-checks.rkt")
(require rackunit "../solutions/utils.rkt")
(require rackunit "../solutions/2_31.rkt")
(define tree (list 2 3 (list 4 5)))
(define tree-in-square (list 4 9 (list 16 25)))
(define tests
(test-suite
"Test for exercise 2_30"
(test-... | null | https://raw.githubusercontent.com/mput/sicp-solutions/fe12ad2b6f17c99978c8fe04b2495005986b8496/tests/2_31.test.rkt | racket | #lang racket
(require rackunit/text-ui)
(require rackunit "custom-checks.rkt")
(require rackunit "../solutions/utils.rkt")
(require rackunit "../solutions/2_31.rkt")
(define tree (list 2 3 (list 4 5)))
(define tree-in-square (list 4 9 (list 16 25)))
(define tests
(test-suite
"Test for exercise 2_30"
(test-... | |
d1a2ef58e2777e0157ef535453bfcbaf6436c90487c658cde0f3740a93a08995 | typeclasses/dsv | Prelude.hs | # LANGUAGE NoImplicitPrelude #
module DSV.Prelude (module Prelude) where
import Prelude hiding ((.), id, init)
import Control.Category as Prelude ((.), id, (>>>), (<<<))
import Data.Coerce as Prelude
import Data.Foldable as Prelude (toList)
import Data.Functor as Prelude (void)
import Data.Functor.Compose as Prelude ... | null | https://raw.githubusercontent.com/typeclasses/dsv/ae4eb823e27e4c569c4f9b097441985cf865fbab/dsv/library/DSV/Prelude.hs | haskell | # LANGUAGE NoImplicitPrelude #
module DSV.Prelude (module Prelude) where
import Prelude hiding ((.), id, init)
import Control.Category as Prelude ((.), id, (>>>), (<<<))
import Data.Coerce as Prelude
import Data.Foldable as Prelude (toList)
import Data.Functor as Prelude (void)
import Data.Functor.Compose as Prelude ... | |
8c914c2a12b661b188c33d0880bf774eb8b08f01ab40400fe2ea81b70e28fe01 | poscat0x04/telegram-types | InlineQueryResult.hs | # LANGUAGE StandaloneDeriving #
module Web.Telegram.Types.Internal.InlineQueryResult where
import Common
import Web.Telegram.Types.Internal.InlineKeyboardMarkup
import Web.Telegram.Types.Internal.InputMedia
import Web.Telegram.Types.Internal.InputMessageContent
import Web.Telegram.Types.Internal.MessageEntity
data I... | null | https://raw.githubusercontent.com/poscat0x04/telegram-types/c09ccc81cff10399538894cf2d1273022c797e18/src/Web/Telegram/Types/Internal/InlineQueryResult.hs | haskell | | A link to an article or web page.
| Title of the result
| Content of the message to be sent
| URL of the result
| Pass True, if you don't want the URL to be shown in the message
| Short description of the result
| Url of the thumbnail for the result
| Thumbnail width
| Thumbnail height
| A valid URL of the ... | # LANGUAGE StandaloneDeriving #
module Web.Telegram.Types.Internal.InlineQueryResult where
import Common
import Web.Telegram.Types.Internal.InlineKeyboardMarkup
import Web.Telegram.Types.Internal.InputMedia
import Web.Telegram.Types.Internal.InputMessageContent
import Web.Telegram.Types.Internal.MessageEntity
data I... |
e42df4ababe19229bb41f97e7bddddb4abdff56f39a9eb8bfcd638f465b18047 | timbertson/passe | hash.ml | open Passe.Common
module type Sig = sig
type t
val serialize : t -> string
val hash : count:int -> seed:string -> string -> t
val alg : string
end
let _impls = ref StringMap.empty
let _register (module Impl: Sig) =
let () = _impls := StringMap.add Impl.alg (module Impl : Sig) !_impls in
()
let string_of_hex : H... | null | https://raw.githubusercontent.com/timbertson/passe/a0aa00695022657a222ea06a4796da36141aaa1a/src/server/hash.ml | ocaml | open Passe.Common
module type Sig = sig
type t
val serialize : t -> string
val hash : count:int -> seed:string -> string -> t
val alg : string
end
let _impls = ref StringMap.empty
let _register (module Impl: Sig) =
let () = _impls := StringMap.add Impl.alg (module Impl : Sig) !_impls in
()
let string_of_hex : H... | |
6f364554455792917daf4be9ed104ea2e23b4c3b3f8ba67ec9bc2eb33876b2c0 | district0x/cljs-ipfs-http-client | dag.cljs | (ns cljs-ipfs-api.dag
(:require [cljs-ipfs-api.core :refer-macros [defsignatures]]
[cljs-ipfs-api.utils :refer [wrap-callback api-call js->cljkk cljkk->js]]))
(defsignatures
[[dag.put [dagNode options callback]]
[dag.get [cid [path] [options] callback]]
[dag.tree [cid [path] [options] callback]]]... | null | https://raw.githubusercontent.com/district0x/cljs-ipfs-http-client/2352396430fb1ca179054845b956184c871ceedd/src/cljs_ipfs_api/dag.cljs | clojure | (ns cljs-ipfs-api.dag
(:require [cljs-ipfs-api.core :refer-macros [defsignatures]]
[cljs-ipfs-api.utils :refer [wrap-callback api-call js->cljkk cljkk->js]]))
(defsignatures
[[dag.put [dagNode options callback]]
[dag.get [cid [path] [options] callback]]
[dag.tree [cid [path] [options] callback]]]... | |
5eafea644e3663105744dc04604b64ef83664acc14b3ca78e207315841398e63 | tdp2110/HaskellTiger | test_semant.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Frame
import qualified Parser
import qualified Semant
import qualified Symbol
import qualified Temp
import qualified Translate
import qualified TreeIR
import qualified Types
import qualified X64Frame
import qualified Data.Text a... | null | https://raw.githubusercontent.com/tdp2110/HaskellTiger/f6ce2b92727fb8702501ee273d2702c23cc2edad/test/test_semant.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import qualified Frame
import qualified Parser
import qualified Semant
import qualified Symbol
import qualified Temp
import qualified Translate
import qualified TreeIR
import qualified Types
import qualified X64Frame
import qualified Data.Text as T
import Test.HUnit
im... |
a31df623c0428861bcd0a4da22fdeb32b8426f4043c3e059d58ca96598e8f076 | vinted/kafka-elasticsearch-tool | pprint.clj | (ns core.pprint
(:require [clojure.pprint :as pprint]
[clojure.string :as str]))
(defn keys-in
"Returns a sequence of all key paths in a given map using DFS walk."
[m]
(letfn [(children [node]
(let [v (get-in m node)]
(if (map? v)
(map (fn [x] (conj node x)... | null | https://raw.githubusercontent.com/vinted/kafka-elasticsearch-tool/281de24d51cbd2a7ad78e3c1d13a4619b786210d/src/core/pprint.clj | clojure | (ns core.pprint
(:require [clojure.pprint :as pprint]
[clojure.string :as str]))
(defn keys-in
"Returns a sequence of all key paths in a given map using DFS walk."
[m]
(letfn [(children [node]
(let [v (get-in m node)]
(if (map? v)
(map (fn [x] (conj node x)... | |
d76caf171faeaa7ee2abf235a54c2508929a07ff84820d70d342a4a017e54b71 | philnguyen/soft-contract | ex-11.rkt | #lang racket
(require soft-contract/fake-contract)
(define (f g p)
(if #|HERE|# (number? (car p)) (g p) 'no))
(provide/contract
[f (((cons/c number? number?) . -> . symbol?) cons? . -> . symbol?)])
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/unsafe/octy/ex-11.rkt | racket | HERE | #lang racket
(require soft-contract/fake-contract)
(define (f g p)
(provide/contract
[f (((cons/c number? number?) . -> . symbol?) cons? . -> . symbol?)])
|
1571d28e8a73b232bf0872c8b0c72ddb143d0f6ffa59ac53445888c1be31f8d3 | larcenists/larceny | 16with-win5.scm | (bits 16)
(text
(mov ax 10)
this should loop 7 times
(label foo
(if (= ax 3)
(with-win (ret))
(with-win foo
(sub ax 1)))))
00000000 B80A00 mov ax,0xa
00000003 3D0300 cmp ax,0x3
00000006 7501 jnz 0x9
00000008 C3 ret
00000009 2D010... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/tests/prims16/16with-win5.scm | scheme | (bits 16)
(text
(mov ax 10)
this should loop 7 times
(label foo
(if (= ax 3)
(with-win (ret))
(with-win foo
(sub ax 1)))))
00000000 B80A00 mov ax,0xa
00000003 3D0300 cmp ax,0x3
00000006 7501 jnz 0x9
00000008 C3 ret
00000009 2D010... | |
ca0908482de03aa908f4788d42b5c6fe338792fada28fd7bbdfb66ccf83cddfe | RyanGlScott/th-lift | Test.hs | # LANGUAGE CPP #
# LANGUAGE MagicHash #
# LANGUAGE TemplateHaskell #
module Main (main) where
import Foo
import Language.Haskell.TH.Syntax
main :: IO ()
main = do print $( lift (Foo "str1" 'c') )
print $( lift (Bar "str2") )
print $( lift (Rec {field = 'a'}) )
print $( lift (Unboxed
#if ... | null | https://raw.githubusercontent.com/RyanGlScott/th-lift/1aef38766820e8264684db33f39c5f0132b77793/t/Test.hs | haskell | # LANGUAGE CPP #
# LANGUAGE MagicHash #
# LANGUAGE TemplateHaskell #
module Main (main) where
import Foo
import Language.Haskell.TH.Syntax
main :: IO ()
main = do print $( lift (Foo "str1" 'c') )
print $( lift (Bar "str2") )
print $( lift (Rec {field = 'a'}) )
print $( lift (Unboxed
#if ... | |
372b40ca7892ea4b4a523a526f1496eb5e6258bbb60c3a9f70fa57184f4c11ed | xapi-project/xen-api | secretString.mli |
* Copyright ( C ) 2020 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 described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/5278397aae0f158d8ad99340f6784c3eb6ea56d0/ocaml/xapi-types/secretString.mli | ocaml | Prevent direct conversions to string to avoid accidental misuse.
* It is still possible to convert it to Rpc.t and recover it that way,
* it is not a protection against willfully recovering the protected string
* (we do need to send these as parameters in RPCs).
*
* a type with no direct conversions to string
* ... |
* Copyright ( C ) 2020 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 described in fi... |
a556726561f61a535638e1d6757dc3ef5ae04d525b04e325c6026d865252dfd6 | metaocaml/ber-metaocaml | t140-switch-1.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
match 0 with
| 0 -> ()
| 1 -> raise Not_found
| _ -> raise Not_foun... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t140-switch-1.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
match 0 with
| 0 -> ()
| 1 -> raise Not_found
| _ -> raise Not_foun... | |
3617abe49c6abe8cf5d76343e398a409bcb27f3beec0f0a719f77cc9de6aef15 | deg/re-frame-storage-fx | watch.clj | (require '[cljs.build.api :as b])
(b/watch "src"
{:main 'com.degel.re-frame.storage
:output-to "out/re_frame_storage_fx.js"
:output-dir "out"})
| null | https://raw.githubusercontent.com/deg/re-frame-storage-fx/a00606f99bb4542b68269e223603b3cfb4dc744e/scripts/watch.clj | clojure | (require '[cljs.build.api :as b])
(b/watch "src"
{:main 'com.degel.re-frame.storage
:output-to "out/re_frame_storage_fx.js"
:output-dir "out"})
| |
ef3996b972ea5f2f088d003ae8833a6ef42d853fa54d72ba117afd2583f9568a | dreixel/regular | Show.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE TypeOperators #-}
-----------------------------------------------------------------------------
-- |
-- Module : Generics.Regular.Functions.Show
Copyright : ( c ) 2008 Universiteit Utrecht
-- License : BSD3
--
Maintainer :
-- Stability : expe... | null | https://raw.githubusercontent.com/dreixel/regular/c8460ee827f1eb04dd31b873380ff9626a4a4220/src/Generics/Regular/Functions/Show.hs | haskell | # LANGUAGE TypeOperators #
---------------------------------------------------------------------------
|
Module : Generics.Regular.Functions.Show
License : BSD3
Stability : experimental
Portability : non-portable
Summary: Generic show. This module is not exported by
-------------------------... | # LANGUAGE FlexibleContexts #
Copyright : ( c ) 2008 Universiteit Utrecht
Maintainer :
" Generics . Regular . Functions " to avoid clashes with " Prelude " .
module Generics.Regular.Functions.Show (
Show (..),
show, shows
) where
import Generics.Regular.Base
import Prelude hiding (Show, show,... |
f2489ec18a8355de6c15a33ba3587950b43ddcfa0b2bdb4076a5b2eebf137f63 | ygmpkk/house | Base.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.Array.Base
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
-- Portability : non-porta... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/base/Data/Array/Base.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Array.Base
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable
------------------------------------------------------------------... | Copyright : ( c ) The University of Glasgow 2001
Basis for IArray and MArray . Not intended for external consumption ;
use IArray or MArray instead .
module Data.Array.Base where
import Prelude
import Data.Ix ( Ix, range, index, rangeSize )
import Data.Int
import Data.Word
import Foreign.Ptr
import For... |
dc63d0c7624acb1e3856cf27f4aa02101d8c65d8a096c33001e0f0292b86a12e | wenkokke/dep2con | Parse.hs | # LANGUAGE RankNTypes , FlexibleContexts #
module Language.Structure.Constituency.Parse (pTree) where
import Prelude hiding (Word)
import Control.Applicative ((<$>),(<|>),(<*>))
import Language.POS (POS(POS))
import Language.Structure.Constituency (Tree(..))
import Language.Word (Word(Word))
import Text.ParserCombinat... | null | https://raw.githubusercontent.com/wenkokke/dep2con/eec24bc8e1a4db5b1582f0fd933ab02f8a6ce041/src/Language/Structure/Constituency/Parse.hs | haskell | should really do this with a supply monad | # LANGUAGE RankNTypes , FlexibleContexts #
module Language.Structure.Constituency.Parse (pTree) where
import Prelude hiding (Word)
import Control.Applicative ((<$>),(<|>),(<*>))
import Language.POS (POS(POS))
import Language.Structure.Constituency (Tree(..))
import Language.Word (Word(Word))
import Text.ParserCombinat... |
00b31e55b1a925c4e6daa65387abb3179429d19dc7c6b8f8a5fdbe60c696b8c8 | Kappa-Dev/KappaTools | bigbuffer.ml | (**************************************************************************)
(* *)
(* (From) OCaml *)
(* *)
and ... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/dataStructures/bigbuffer.ml | ocaml | ************************************************************************
(From) OCaml
... | and , projet Cristal , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
module BA = Bigarray.Array1
type bigstring =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Arr... |
db95eeb177256676800fc3e84242bf15ad0350552d62a34ccf55dc9d219a75ac | heechul/crest-z3 | lexerhack.ml |
module E = Errormsg
(* We provide here a pointer to a function. It will be set by the lexer and
* used by the parser. In Ocaml lexers depend on parsers, so we we have put
* such functions in a separate module. *)
let add_identifier: (string -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized add_... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/frontc/lexerhack.ml | ocaml | We provide here a pointer to a function. It will be set by the lexer and
* used by the parser. In Ocaml lexers depend on parsers, so we we have put
* such functions in a separate module. |
module E = Errormsg
let add_identifier: (string -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized add_identifier"))
let add_type: (string -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized add_type"))
let push_context: (unit -> unit) ref =
ref (fun _ -> E.s (E.bug "You cal... |
d848e0240c0f0a59172df5135dfafdd6c0d50d8ce418f8795891cda54e2365ca | FreeProving/free-compiler | Base.hs | | This module contains the Coq identifiers of types , constructors and
-- functions defined in the Base library that accompanies the compiler.
module FreeC.Backend.Coq.Base
( -- * Base Library Import
imports
, baseLibName
, generatedLibName
-- * Free Monad
, free
, shape
, pos
, idShape
, id... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/Backend/Coq/Base.hs | haskell | functions defined in the Base library that accompanies the compiler.
* Base Library Import
* Free Monad
* Partiality
* Tracing
* Non-Determinism
* Modules
* Sharing
* Effect Selection
* Tactics
* Reserved Identifiers
-----------------------------------------------------------------------------
Base Librar... | | This module contains the Coq identifiers of types , constructors and
module FreeC.Backend.Coq.Base
imports
, baseLibName
, generatedLibName
, free
, shape
, pos
, idShape
, idPos
, freePureCon
, freeImpureCon
, freeBind
, freeArgs
, shapeIdent
, posIdent
, forFree
, partial
, par... |
603a01a168ab5def2997e2b2524918305f9f79bb546d025b228bd0e8e890ae57 | themattchan/advent-of-code | day2.hs | #! /usr/bin/env runhaskell -i../../
import Utils
checksum1 :: [[Int]] -> Int
checksum1 = sum . map (uncurry (-) . (maximum &&& minimum))
-- is there a fancy number theoretic method for this
checksum2 :: [[Int]] -> Int
checksum2 = sum . map divisor
where
divisor xs = head [x `div` y | x <- xs, y <- xs, x /= y, x... | null | https://raw.githubusercontent.com/themattchan/advent-of-code/0b08a4fbadf7e713d40044523af3debb7d0cb6b9/2017/day2/day2.hs | haskell | is there a fancy number theoretic method for this | #! /usr/bin/env runhaskell -i../../
import Utils
checksum1 :: [[Int]] -> Int
checksum1 = sum . map (uncurry (-) . (maximum &&& minimum))
checksum2 :: [[Int]] -> Int
checksum2 = sum . map divisor
where
divisor xs = head [x `div` y | x <- xs, y <- xs, x /= y, x `mod` y == 0]
main :: IO ()
main = do
ss <- numbe... |
8a08c4a4be0f87177037a50f39dd699d37cf08c73c8ce7bfecf8853d9b04062e | supki/libjenkins | Method.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
-- | Jenkins REST API methods
module Jenkins.Rest.Method
( -- * Construct URLs
-- ** Path
text
, int
, (-/-)
-- ** Query
, (-=-)
, (-&-)
, query
-- ** Put together the segments and the query
, (-?-)
-... | null | https://raw.githubusercontent.com/supki/libjenkins/2f3dfd8a5dff3a15250c0fe096e251f1aa9a98b0/src/Jenkins/Rest/Method.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
| Jenkins REST API methods
* Construct URLs
** Path
** Query
** Put together the segments and the query
** Format
* Shortcuts
* Types
$setup
>>> :set -XDataKinds
>>> :set -XOverloadedStrings
>>> instance P Complete where pp = render
>>> instance P Quer... | # LANGUAGE DataKinds #
module Jenkins.Rest.Method
text
, int
, (-/-)
, (-=-)
, (-&-)
, query
, (-?-)
, Formatter
, json
, xml
, python
, plain
job
, build
, view
, queue
, overallLoad
, computer
, Method
, Type(..)
, Format(..)
) where
import Data.Text (Text)
import Jen... |
6f5d40d2ed2e2bae223b476ab7c27434389de0e094d290e2fd4539e43678526f | foreverbell/project-euler-solutions | 173.hs | import Common.Utils (isqrt)
root d | d <= 0 = 0
| otherwise = isqrt d
solve :: Int -> Int
solve n = sum [ count a | a <- [1 .. n `div` 4 + 1] ]
where
count a = (a - k) `div` 2
where k = 1 + (isqrt $ a*a - n - 1)
main = print $ solve 1000000
| null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/173.hs | haskell | import Common.Utils (isqrt)
root d | d <= 0 = 0
| otherwise = isqrt d
solve :: Int -> Int
solve n = sum [ count a | a <- [1 .. n `div` 4 + 1] ]
where
count a = (a - k) `div` 2
where k = 1 + (isqrt $ a*a - n - 1)
main = print $ solve 1000000
| |
7968d0785460fd145fc32696f51d0d2e79b8974c6370e08af3420842605310b7 | triffon/fp-2022-23 | 02-map-tree.rkt | #lang racket
Разглеждаме двоично дърво от функции с представяне по избор .
;; Прилагане на дърво от функции към число се нарича последователното прилагане
на функциите от корена до някое листо над числото ,
като за са възможни толкова , колкото листа има то .
Да се реализира функция mapTree , едномес... | null | https://raw.githubusercontent.com/triffon/fp-2022-23/9e338fbd687870c665ab127e895a2bbe6b028c91/exercises/inf2/exams/02-exam/exam-2022-2023/02-map-tree.rkt | racket | Прилагане на дърво от функции към число се нарича последователното прилагане | #lang racket
Разглеждаме двоично дърво от функции с представяне по избор .
на функциите от корена до някое листо над числото ,
като за са възможни толкова , колкото листа има то .
Да се реализира функция mapTree , едноместни числови функции и
дадено число от резултатите от дървото над числото... |
185a4bdf012df17feec0538b72daee98ef767451c428f70a32ef7e5f34ca7226 | Helium4Haskell/helium | InfixCon1.hs | module InfixCon1 where
data Tree a = Leaf a | Tree a :+: Tree a
main :: Int
main = firstLeaf (Leaf 3 :+: Leaf 4)
firstLeaf :: Tree a -> a
firstLeaf (Leaf x) = x
firstLeaf (l :+: _) = firstLeaf l
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/correct/InfixCon1.hs | haskell | module InfixCon1 where
data Tree a = Leaf a | Tree a :+: Tree a
main :: Int
main = firstLeaf (Leaf 3 :+: Leaf 4)
firstLeaf :: Tree a -> a
firstLeaf (Leaf x) = x
firstLeaf (l :+: _) = firstLeaf l
| |
56784a903e5135d2a9f005de856b53b4de8cca7b639316cd79643915bf0f6cb5 | aligusnet/astro | Aberration.hs | |
Module : Data . Astro . Effects . Aberration
Description : Calculation effects of aberration .
Copyright : , 2016
Calculation effects of aberration .
Module: Data.Astro.Effects.Aberration
Description: Calculation effects of aberration.
Copyright: Alexander Ignatyev, 2016
Calculation effects of aberratio... | null | https://raw.githubusercontent.com/aligusnet/astro/a8c951885061ccef98299af053fdc1a1cc808f17/src/Data/Astro/Effects/Aberration.hs | haskell | | Includes aberration effect.
Returns apparent ecliptic coordinates. | |
Module : Data . Astro . Effects . Aberration
Description : Calculation effects of aberration .
Copyright : , 2016
Calculation effects of aberration .
Module: Data.Astro.Effects.Aberration
Description: Calculation effects of aberration.
Copyright: Alexander Ignatyev, 2016
Calculation effects of aberratio... |
08f493acc9df04a163c37f5cdac2fcbbf356f889cc9f5b5e592c1fc0679c5210 | Eduap-com/WordMat | autol.lisp | (in-package :maxima)
;; These are the helper functions for autoloading.
;; The actual autoloading data is in src/max_ext.lisp
( aload " plot.o " )
(defun aload (file &aux *load-verbose* tem)
(let ((*read-base* 10.)
($system (list '(mlist)
#+kcl (concatenate 'string si::*system-directory*
"../src/foo... | null | https://raw.githubusercontent.com/Eduap-com/WordMat/83c9336770067f54431cc42c7147dc6ed640a339/Windows/ExternalPrograms/maxima-5.45.1/share/maxima/5.45.1/src/autol.lisp | lisp | These are the helper functions for autoloading.
The actual autoloading data is in src/max_ext.lisp
foo(x,y):=..
foo(x,y):=.. | (in-package :maxima)
( aload " plot.o " )
(defun aload (file &aux *load-verbose* tem)
(let ((*read-base* 10.)
($system (list '(mlist)
#+kcl (concatenate 'string si::*system-directory*
"../src/foo.{o,lsp,lisp}"))))
(declare (special $system))
(setq tem ($file_search1 file '((mlist)
$f... |
4b3928b66a64de59878697a7a7718acd5cb085501f40e14145121cbf8b1da41f | kaznum/programming_in_ocaml_exercise | max_list.ml | let max_list list =
let rec max_and_list max list =
match list with
[] -> max
| x::xs when x > max -> max_and_list x xs
| _::xs -> max_and_list max xs in
match list with
x::xs -> max_and_list x xs;;
max_list [7; 9; 0; -5];;
| null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ex5.2/max_list.ml | ocaml | let max_list list =
let rec max_and_list max list =
match list with
[] -> max
| x::xs when x > max -> max_and_list x xs
| _::xs -> max_and_list max xs in
match list with
x::xs -> max_and_list x xs;;
max_list [7; 9; 0; -5];;
| |
09283cffb726341c2e0a462f203986032698463df28c70ce657911f1fd684025 | sbcl/sbcl | values.lisp | ;;;
Written by
;;;
Converted for SPARC by .
;;;
(in-package "SB-VM")
(define-vop (reset-stack-pointer)
(:args (ptr :scs (any-reg)))
(:generator 1
(move csp-tn ptr)))
sparc version translated to ppc by with help from # lisp .
(define-vop (%%nip-values)
(:args (last-nipped-ptr :scs (any-reg) :tar... | null | https://raw.githubusercontent.com/sbcl/sbcl/c2553627fd06ce24eb35ef3c0d8d924e1a4b03f1/src/compiler/ppc64/values.lisp | lisp |
Push some values onto the stack, returning the start and number of values
argument locations. Nvals is the number of values to push.
The generator cost is pseudo-random. We could get it right by defining a
operand, but this seems unworthwhile.
Push a list of values on the stack, returning Start and Count as... | Written by
Converted for SPARC by .
(in-package "SB-VM")
(define-vop (reset-stack-pointer)
(:args (ptr :scs (any-reg)))
(:generator 1
(move csp-tn ptr)))
sparc version translated to ppc by with help from # lisp .
(define-vop (%%nip-values)
(:args (last-nipped-ptr :scs (any-reg) :target dest)
... |
eceac9f28aa00fa8ce1b7f519823d03a66287ef8962b42621accb53ec482de71 | Metaxal/bazaar | board-paint.rkt | #lang racket/gui
(require bazaar/gui/board)
;;; A small example demonstrating usage of the board module.
(define frame1 (new frame% [label "Board"]))
(define board1
(new board%
[parent frame1]
[num-cell-x 10] ; number of cells on the board
[cell-dx 48] ; size of a cell
pixels between two cel... | null | https://raw.githubusercontent.com/Metaxal/bazaar/8432d3c5398225a4bfb5ed5c25a1beffa06409ec/gui/examples/board-paint.rkt | racket | A small example demonstrating usage of the board module.
number of cells on the board
size of a cell
change color of current cell when left button pressed
create pictures the size of a cell of a given color
decide what cells to show at place (i, j) of value v | #lang racket/gui
(require bazaar/gui/board)
(define frame1 (new frame% [label "Board"]))
(define board1
(new board%
[parent frame1]
pixels between two cells ( can be 0 )
(λ(xc yc)
(board-update! board1 xc yc (λ(v)(- 1 v)))
(send board1 draw)
(sleep/yield 0.1))]))
(se... |
3c084035c3e39d071fb6a7ce4e19833e57b4a73c5d991ef1b06b0a5a84114682 | commsor/titanoboa | exp.clj | Copyright ( c ) Commsor Inc. All rights reserved .
; The use and distribution terms for this software are covered by the
; GNU Affero General Public License v3.0 (/#AGPL)
; which can be found in the LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; th... | null | https://raw.githubusercontent.com/commsor/titanoboa/ffe3e1e58f89169092d7b6a3a45e1707a0ecc9ee/src/clj/titanoboa/exp.clj | clojure | The use and distribution terms for this software are covered by the
GNU Affero General Public License v3.0 (/#AGPL)
which can be found in the LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice,... | Copyright ( c ) Commsor Inc. All rights reserved .
(ns titanoboa.exp
(:require [clojure.walk :as walk]
[cognitect.transit :as transit]
[clojure.java.classpath :as cp]
[clojure.tools.logging :as log]
[cognitect.transit :as transit]
[taoensso.nippy :as nipp... |
0a02f1aeec46fd2477e52c4497704095e86df2711ab1414b358fcd821609ad29 | froggey/Mezzano | memory.lisp | ;;;; Raw memory related primitives.
(in-package :mezzano.compiler.backend.arm64)
(defmacro with-memory-effective-address ((effective-address additional-inputs base-address index scale) &body body)
"Generate an effective address that deals properly with scaling and constant indices."
(check-type scale (member 1 2 ... | null | https://raw.githubusercontent.com/froggey/Mezzano/087be4fa325619f61b2e6864277aaf83c4d1d80d/compiler/backend/arm64/memory.lisp | lisp | Raw memory related primitives. |
(in-package :mezzano.compiler.backend.arm64)
(defmacro with-memory-effective-address ((effective-address additional-inputs base-address index scale) &body body)
"Generate an effective address that deals properly with scaling and constant indices."
(check-type scale (member 1 2 4 8))
(let ((unboxed-address (gens... |
edc5f97acee6944b10b4dede2026ce9d4f2885072f9a262031019beb45ba8568 | CloudI/CloudI | folsom_sup.erl | %%
Copyright 2011 , Boundary
%%%
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 applicable law or agreed to in writing, software
distr... | null | https://raw.githubusercontent.com/CloudI/CloudI/3e45031c7ee3e974ead2612ea7dd06c9edf973c9/src/external/cloudi_x_folsom/src/folsom_sup.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 or implied.
See the License for the specific language governing per... | Copyright 2011 , Boundary
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(folsom_sup).
-behaviour(supervisor).
-export([start_link/0, create_tables/0]).
-export([init/1]).
-include("folso... |
6672ac19120eb29f6d1a87e2dbe6ec3781bd89e2128f72de78186756b6650e08 | otto-de/tesla-microservice | configuring.clj | (ns de.otto.tesla.stateful.configuring
"This component is responsible for loading the configuration."
(:require [com.stuartsierra.component :as component]
[clojurewerkz.propertied.properties :as p]
[clojure.tools.logging :as log]
[clojure.java.io :as io]
[de.otto.tesl... | null | https://raw.githubusercontent.com/otto-de/tesla-microservice/eb2190dacc1634f625ed216186cad00fc9853868/src/de/otto/tesla/stateful/configuring.clj | clojure | Load config on startup.
The hostname and port visble from the outside are different for
different environments.
see above | (ns de.otto.tesla.stateful.configuring
"This component is responsible for loading the configuration."
(:require [com.stuartsierra.component :as component]
[clojurewerkz.propertied.properties :as p]
[clojure.tools.logging :as log]
[clojure.java.io :as io]
[de.otto.tesl... |
977bd5dc642dbbf8281a3f70c91dbfab9a5250e7d9f809f990afe1f5c9604bc7 | rabbitmq/ra-examples | ra_process_set_app.erl | -module(ra_process_set_app).
-behaviour(application).
%% API exports
-export([start/2, stop/1]).
%%====================================================================
%% API
%%====================================================================
start(_StartType, _StartArgs) ->
ra_proces_set_sup:start_link().
... | null | https://raw.githubusercontent.com/rabbitmq/ra-examples/8e1e904d72ac14d357422adadb5f43cd5ff322d8/process_set/src/ra_process_set_app.erl | erlang | API exports
====================================================================
API
====================================================================
====================================================================
==================================================================== | -module(ra_process_set_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
ra_proces_set_sup:start_link().
stop(_State) ->
ok.
Internal functions
|
34d1f6a2ccac90599ffe4e4f118543f9907a4575f1a0973b2ecb039ba0374eeb | cdepillabout/world-peace | Docs.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE... | null | https://raw.githubusercontent.com/cdepillabout/world-peace/0596da67d792ccf9f0ddbe44b5ce71b38cbde020/example/Docs.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
This module prints out documentation for 'Api'.
We don't have to directly worry about writing instances for 'Envelope'.
| Print the documentation rendered as markdown to stdout. | # LANGUAGE DataKinds #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# OPTIONS... |
8ba0f34bc851bc68c17a3e56ba144f6d9fffee86e970d0b0b46bcf3268729f7f | sicmutils/sicmutils | adaptive.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.numerical.quadrature.adaptive
(:require [sicmutils.numerical.quadrature.common :as qc]
[sicmutils.util.aggregate :as ua]))
# # Adaptive Quadrature
;;
;; This namespace holds an implementation of "adaptive quadrature" usable with
;; any quadrature meth... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/ce763b31153eb9253f165bd5b4e4e6a6087bf730/src/sicmutils/numerical/quadrature/adaptive.cljc | clojure |
This namespace holds an implementation of "adaptive quadrature" usable with
any quadrature method in the library.
The implementation was inspired by the `numerics/quadrature/rational.scm`
file in
package. In that library, adaptive quadrature was special-cased to the
## Overview
Most of the integrators in `qu... | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.numerical.quadrature.adaptive
(:require [sicmutils.numerical.quadrature.common :as qc]
[sicmutils.util.aggregate :as ua]))
# # Adaptive Quadrature
the [ scmutils]( / mac / users / gjs/6946 / refman.txt )
Bulirsch - Stoer algorithm , ported in ` bu... |
5784d92424bff9dc3db6e3f63bb9f1f335ced2bd0c2762ba151009c83c59b27e | finnishtransportagency/harja | grid.cljs | (ns harja.ui.grid
"Gridin ja muokkausgridin koottu rajapinta."
(:require [harja.ui.grid.protokollat :as protokollat]
[harja.ui.grid.perus :as perus]
[harja.ui.grid.muokkaus :as muokkaus]))
(def gridia-muokataan? protokollat/gridia-muokataan?)
(def grid-ohjaus protokollat/grid-ohjaus)
(def o... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/6170c269fefe11ce5bf93932e85b5c9a9edb4879/src/cljs/harja/ui/grid.cljs | clojure | UI | (ns harja.ui.grid
"Gridin ja muokkausgridin koottu rajapinta."
(:require [harja.ui.grid.protokollat :as protokollat]
[harja.ui.grid.perus :as perus]
[harja.ui.grid.muokkaus :as muokkaus]))
(def gridia-muokataan? protokollat/gridia-muokataan?)
(def grid-ohjaus protokollat/grid-ohjaus)
(def o... |
2f4caaf36e9dbeccaf93da9af1bf708bbda064d4ec5665e87439a60583efabeb | xclerc/ocamljava | misc.ml |
* This file is part of OCaml - Java optimizer .
* Copyright ( C ) 2007 - 2015 .
*
* optimizer 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 ; either version 3 of the License , o... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/optimizer/src/misc.ml | ocaml |
* This file is part of OCaml - Java optimizer .
* Copyright ( C ) 2007 - 2015 .
*
* optimizer 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 ; either version 3 of the License , o... | |
ea526c196c8677dd5304b4a59e7f3dacae21e99daff145cbe31db1ece85f123c | freckle/stackctl | ScopeSpec.hs | module Stackctl.AWS.ScopeSpec
( spec
) where
import Stackctl.Prelude
import Stackctl.AWS.CloudFormation
import Stackctl.AWS.Core
import Stackctl.AWS.Scope
import Test.Hspec
spec :: Spec
spec = do
describe "awsScopeSpecStackName" $ do
let
scope = AwsScope
{ awsAccountId = AccountId "123"
... | null | https://raw.githubusercontent.com/freckle/stackctl/fdb99c911dd118dee4a46358da98ceedcebc2e09/test/Stackctl/AWS/ScopeSpec.hs | haskell | module Stackctl.AWS.ScopeSpec
( spec
) where
import Stackctl.Prelude
import Stackctl.AWS.CloudFormation
import Stackctl.AWS.Core
import Stackctl.AWS.Scope
import Test.Hspec
spec :: Spec
spec = do
describe "awsScopeSpecStackName" $ do
let
scope = AwsScope
{ awsAccountId = AccountId "123"
... | |
9312bc42ecd21df14c4c9d7454e81c29d4610bcd0daa87adbf5683445148926c | TheLortex/protocaml | job_id.mli | type t
val compare : t -> t -> int
val next : unit -> t
val to_int : t -> int
val of_int : int -> t
| null | https://raw.githubusercontent.com/TheLortex/protocaml/7ab6cac93a0405c160457d91d8f849cc3d8c24c0/9/job_id.mli | ocaml | type t
val compare : t -> t -> int
val next : unit -> t
val to_int : t -> int
val of_int : int -> t
| |
48b03070f9efcda24608b37653dad6748f126a0c29abd9f69fc9479a24745dc8 | GaloisInc/saw-core | TypedTerm.hs | |
Module : . TypedTerm
Description : SAW - Core terms paired with Cryptol types .
License : : huffman
Stability : provisional
Module : SAWScript.TypedTerm
Description : SAW-Core terms paired with Cryptol types.
License : BSD3
Maintainer : huffman
Stability : provisional
-}
mo... | null | https://raw.githubusercontent.com/GaloisInc/saw-core/6e32c659fdadfcf99d3d586e7dcda2b7bd9a0e10/cryptol-saw-core/src/Verifier/SAW/TypedTerm.hs | haskell | Typed terms -----------------------------------------------------------------
expressions.
| Deprecated.
| Apply a function-typed 'TypedTerm' to an argument. This operation
type.
| Apply a 'TypedTerm' to a list of arguments. This operation fails
sufficient arity.
| Create an abstract defined constant with the s... | |
Module : . TypedTerm
Description : SAW - Core terms paired with Cryptol types .
License : : huffman
Stability : provisional
Module : SAWScript.TypedTerm
Description : SAW-Core terms paired with Cryptol types.
License : BSD3
Maintainer : huffman
Stability : provisional
-}
mo... |
2948e4562fcc13f60511adc604d07b71f810cdb7a37ca8ae9b5dfc98d4b745b0 | ymherklotz/verismith | Verismith.hs | {-# OPTIONS_GHC -Wno-unused-top-binds #-}
-- |
Module :
-- Description : Verismith
Copyright : ( c ) 2018 - 2022 ,
-- License : GPL-3
-- Maintainer : yann [at] yannherklotz [dot] com
-- Stability : experimental
-- Portability : POSIX
module Verismith
( defaultMain,
-- * Types
Opts (..... | null | https://raw.githubusercontent.com/ymherklotz/verismith/5e2a3ca343da105c589f41da6208349d6788edb6/src/Verismith.hs | haskell | # OPTIONS_GHC -Wno-unused-top-binds #
|
Description : Verismith
License : GPL-3
Maintainer : yann [at] yannherklotz [dot] com
Stability : experimental
Portability : POSIX
* Types
* Run functions
* Verilog generation functions
* Extra modules
| Randomly remove an option by setting it to 0.
can be seen... |
Module :
Copyright : ( c ) 2018 - 2022 ,
module Verismith
( defaultMain,
Opts (..),
SourceInfo (..),
runEquivalence,
runSimulation,
runReduce,
draw,
procedural,
proceduralIO,
proceduralSrc,
proceduralSrcIO,
randomMod,
module Verismith.Verilog,
m... |
efe38fb9392ed4b54622b807e9421c05d9f941ed100cee63251b557ce20c231b | zcaudate/hara | write.clj | (ns hara.object.framework.write
(:require [clojure.walk :as walk]
[hara.core.base.enum :as enum]
[hara.data :as data]
[hara.protocol.object :as protocol.object]
[hara.object.query :as query]
[hara.object.element.util :as element.util]
[hara.strin... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/src/hara/object/framework/write.clj | clojure | => #test.Cat{:name \"spike\", :species \"cat\"}
If there is a direct match
Special case for Enums
If there is a vector
If input is a string and there is a from-string method
If input is a string and there is a from-string method
If the input is a map | (ns hara.object.framework.write
(:require [clojure.walk :as walk]
[hara.core.base.enum :as enum]
[hara.data :as data]
[hara.protocol.object :as protocol.object]
[hara.object.query :as query]
[hara.object.element.util :as element.util]
[hara.strin... |
5c455f53fa4ed9f0ce4442a3f9298a1e17a50def385ad784b72f34d27e49b090 | racket/drracket | browser.rkt | #lang racket
(require racket/unit
racket/gui
mred/mred-sig
setup/plt-installer-sig
setup/plt-installer
net/tcp-sig
net/url-sig
net/url
"browser-sig.rkt"
"browser-unit.rkt")
(provide-signature-elements browser^)
(define-values/invoke-unit... | null | https://raw.githubusercontent.com/racket/drracket/2d7c2cded99e630a69f05fb135d1bf7543096a23/drracket/browser/browser.rkt | racket | #lang racket
(require racket/unit
racket/gui
mred/mred-sig
setup/plt-installer-sig
setup/plt-installer
net/tcp-sig
net/url-sig
net/url
"browser-sig.rkt"
"browser-unit.rkt")
(provide-signature-elements browser^)
(define-values/invoke-unit... | |
c73dacb5035d3f449ba0cc4723c0ea3a4f15e5e6039d9776556f76c788792cc9 | bennguvaye/flu | sss.mli | (** Single strain stochastic simulation module *)
* Integration uses a very simple algorithm .
We assume that events happen much faster than the infectivity beta varies
We assume that events happen much faster than the infectivity beta varies *)
(** Module for parameter values *)
module type PARS =
sig
... | null | https://raw.githubusercontent.com/bennguvaye/flu/5dbae212405b74917ee91392684fd2ee10ab1e58/src/sss.mli | ocaml | * Single strain stochastic simulation module
* Module for parameter values
* Functor initializing the module associated to parameter values
* Reasonable algorithm parameter values |
* Integration uses a very simple algorithm .
We assume that events happen much faster than the infectivity beta varies
We assume that events happen much faster than the infectivity beta varies *)
module type PARS =
sig
val n : float
val r0 : float
val e : float
val etaN : float
val g ... |
ec6b9351bdc634113dfa1e437e31bf7800c0478d48e9c9d86b2dc7e3bacceca6 | openbadgefactory/salava | ext_endorsement.cljs | (ns salava.badge.ui.ext-endorsement
(:require
[clojure.string :refer [blank?]]
[reagent.core :refer [atom cursor]]
[reagent-modals.modals :as m]
[reagent.session :as session]
[salava.badge.ui.endorsement :as end :refer [process-text profile toggle-delete-dialogue confirm-delete]]
[salava.core.ui.aja... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljs/salava/badge/ui/ext_endorsement.cljs | clojure | (init-ext-endorser id state)
.col-md-12
(delete-endorsement nil state nil)}
:id (or endorsee_id issuer_id requester_id requestee_id)
| (ns salava.badge.ui.ext-endorsement
(:require
[clojure.string :refer [blank?]]
[reagent.core :refer [atom cursor]]
[reagent-modals.modals :as m]
[reagent.session :as session]
[salava.badge.ui.endorsement :as end :refer [process-text profile toggle-delete-dialogue confirm-delete]]
[salava.core.ui.aja... |
3f704462372b61c7e7c47619a9e9826dfefd971d35cde93bb5b2002cd3615bd3 | coccinelle/coccinelle | unify_ast.mli |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/parsing_cocci/unify_ast.mli | ocaml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | |
04ec7ad2049ae846f5ebd930727f362842c99f428b3298237a1753f18be78b9e | svenssonjoel/Obsidian | SeqLoop.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GADTs #-}
2013 .. 2017
sequential loops with state
sequential loops with state
-}
module Obsidian.SeqLoop where
import Obsidian.Program
import Obsidian.Exp
import... | null | https://raw.githubusercontent.com/svenssonjoel/Obsidian/90886a0ef513cdaa58bb63765c230fa193d1ef10/Obsidian/SeqLoop.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
TODO: Rename module to something better
-------------------------------------------------------------------------
-------------------------------------------------------------------------
| Sequential reduction of Pull array. Results in a for loop in generated code.
--... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
2013 .. 2017
sequential loops with state
sequential loops with state
-}
module Obsidian.SeqLoop where
import Obsidian.Program
import Obsidian.Exp
import Obsidian.Array
import Obsidian.Memory
import Obsidian.N... |
00f2793ac8bfa176083abe0cbffdbbe7c805cf8e45fdb4e844423e459b24258f | flavioc/cl-hurd | open-modes.lisp |
(in-package :hurd)
(defconstant +honored-open-modes+ '(:append :async :fsync :nonblock))
(defconstant +honored-get-modes+ (append +honored-open-modes+
'(:write :exec :read)))
(defcfun ("io_set_all_openmodes" %io-set-all-openmodes)
err
(file port)
(newbits open-flags))
... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/hurd/io/open-modes.lisp | lisp |
(in-package :hurd)
(defconstant +honored-open-modes+ '(:append :async :fsync :nonblock))
(defconstant +honored-get-modes+ (append +honored-open-modes+
'(:write :exec :read)))
(defcfun ("io_set_all_openmodes" %io-set-all-openmodes)
err
(file port)
(newbits open-flags))
... | |
72b6c096e10ecbd69a3b567801b56cb1f2dad1f2791063b06a28fce077a00fad | sanette/oplot | logistique.ml | (* Oplot example of User object: bifurcation diagram for the logistic map *)
#use "topfind";;
#thread;;
#require "oplot";;
open Oplot.Plt;;
open Oplot.Points.Point2;;
let rec iterate r x_init i =
if i == 1 then x_init
else
let x = iterate r x_init (i - 1) in
r *. x *. (1.0 -. x)
let rec trace ~progress... | null | https://raw.githubusercontent.com/sanette/oplot/5473fd2683109acd6e80c51aa966677db4d13379/top/logistique.ml | ocaml | Oplot example of User object: bifurcation diagram for the logistic map
we force showing the picture in progress:
BUG: Freeze prevents proper rescaling of the window | #use "topfind";;
#thread;;
#require "oplot";;
open Oplot.Plt;;
open Oplot.Points.Point2;;
let rec iterate r x_init i =
if i == 1 then x_init
else
let x = iterate r x_init (i - 1) in
r *. x *. (1.0 -. x)
let rec trace ~progress x0 x1 step v dev =
if x0 > x1 then ()
else
let imax = int_of_float (... |
339feeffa3ba669feab2bc35c01105632ef3d31e238e08e20831aca3395c2380 | input-output-hk/cardano-explorer | EpochPage.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NamedFieldPuns #
module Explorer.Web.Api.Legacy.EpochPage
( epochPage
) where
import Cardano.Chain.Slotting (EpochNumber (..))
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Trans.Reader (ReaderT)
import Data.Byte... | null | https://raw.githubusercontent.com/input-output-hk/cardano-explorer/3abcb32339edac7c2397114a1d170cc76b82e9b6/cardano-explorer-webapi/src/Explorer/Web/Api/Legacy/EpochPage.hs | haskell | # LANGUAGE OverloadedStrings #
Example queries:
| # LANGUAGE NamedFieldPuns #
module Explorer.Web.Api.Legacy.EpochPage
( epochPage
) where
import Cardano.Chain.Slotting (EpochNumber (..))
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Trans.Reader (ReaderT)
import Data.ByteString (ByteString)
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.