_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 |
|---|---|---|---|---|---|---|---|---|
23f858fe73527aed54b7ea8c01b7b900d7f6273917ee97c1743312e3476b6cbd | cubix-framework/cubix-tutorial | Main.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE Templ... | null | https://raw.githubusercontent.com/cubix-framework/cubix-tutorial/7d4538911c8e12d848ad43feecddf9fb4fcd1421/tutorial/ex2/Main.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE EmptyDataDecls #
# LANGUAGE FlexibleContexts #
# LANGUAGE PatternSynonyms #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
# LANGUAGE TypeSynonymInstances #
In this exercise, you'll write a small... | # LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
| Cubix tutorial : Exercise 2
You 'll initially write it just for a toy language , , but then extend it to a real language .
module Main where
import Cubix.Essentials
im... |
b05ba9674b50704063c344d33f494f80649dad187f1f461bf295e3a4cd0b9222 | rd--/hsc3 | Render.hs | -- | Non-realtime score rendering.
module Sound.Sc3.Server.Nrt.Render where
import System.FilePath {- filepath -}
import System.Process {- process -}
import Sound.Sc3.Server.Enum
import Sound.Sc3.Server.Nrt
{- | Minimal Nrt rendering parameters.
The sound file type is inferred from the file name extension.
Structur... | null | https://raw.githubusercontent.com/rd--/hsc3/4b3a4ea1f1198b7598bfde79fbaaff701c16fd1a/Sound/Sc3/Server/Nrt/Render.hs | haskell | | Non-realtime score rendering.
filepath
process
| Minimal Nrt rendering parameters.
The sound file type is inferred from the file name extension.
Structure is:
Osc file name,
input audio file name and input number of channels (use ("_",0) for no input file),
output audio file name and output number of channels,... | module Sound.Sc3.Server.Nrt.Render where
import Sound.Sc3.Server.Enum
import Sound.Sc3.Server.Nrt
type Nrt_Param_Plain = (FilePath,(FilePath,Int),(FilePath,Int),Int,SampleFormat,[String])
nrt_param_plain_to_arg :: Nrt_Param_Plain -> [String]
nrt_param_plain_to_arg (osc_nm,(in_sf,in_nc),(out_sf,out_nc),sr,sf,param) ... |
3ed6881abcfeac8d94d84d6ac728ff3ce41d278d9237c3c51559ade3331c731c | crategus/cl-cffi-gtk | gobject.glib-defcallback.lisp | ;;; ----------------------------------------------------------------------------
;;; gobject.glib-defcallback.lisp
;;;
This file contains code from a fork of cl - gtk2 .
;;; See -lisp.net/project/cl-gtk2/
;;;
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2012
;;;
;;; This program is free software: you ca... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/22156e3e2356f71a67231d9868abcab3582356f3/gobject/gobject.glib-defcallback.lisp | lisp | ----------------------------------------------------------------------------
gobject.glib-defcallback.lisp
See -lisp.net/project/cl-gtk2/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License for Lisp
License, or (at your option) any la... | This file contains code from a fork of cl - gtk2 .
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2012
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for use
GNU Lesser General Public License for more details .
... |
bb5cf0f03685d80db6382200983aaf5868c24aea3adc5a2402fefe4e40d9fdf9 | patrikja/AFPcourse | Interpreter3.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
| Version 3 of the interpreter
module Interpreter3 where
import qualified Control.Applicative as CA (Applicative(..))
import qualified Control.Monad as CM
import qualified Control.Monad.Identity as CMI
import qualified Control.Mon... | null | https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/L5/src/Interpreter3.hs | haskell | new
| Finally, we add a way to catch exceptions arising from
unbound variables and dereferencing non-existent pointers.
new
^ dangerous language: any 'Value' can be used as a 'Ptr'
| An environment maps variables to values.
| We need to keep track of the store containing the values of
our references. We also re... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
| Version 3 of the interpreter
module Interpreter3 where
import qualified Control.Applicative as CA (Applicative(..))
import qualified Control.Monad as CM
import qualified Control.Monad.Identity as CMI
import qualified Control.Mon... |
ab706e63861f1590da47905ffbf2c8ceba7df7e3a8611cee587e53a7398e30d0 | JustusAdam/language-haskell | T0118.hs | SYNTAX TEST " source.haskell " " Record fields with extra spaces "
data Record a b =
Record
{ short :: a
^^^^^ variable.other.member.definition.haskell
^ variable.other.generic-type.haskell
, longer :: b
-- ^^^^^^ variable.other.member.definition.haskell
^ variable.ot... | null | https://raw.githubusercontent.com/JustusAdam/language-haskell/c9ee1b3ee166c44db9ce350920ba502fcc868245/test/tickets/T0118.hs | haskell | ^^^^^^ variable.other.member.definition.haskell
^^^^^^^^ variable.other.member.definition.haskell | SYNTAX TEST " source.haskell " " Record fields with extra spaces "
data Record a b =
Record
{ short :: a
^^^^^ variable.other.member.definition.haskell
^ variable.other.generic-type.haskell
, longer :: b
^ variable.other.generic-type.haskell
, tiny :: a
^^^^ v... |
de96caa62886dd633d7992ab629c91df26089a2145bc49774009aed8c04a5b51 | mariaschett/ppltr | optz_generator.ml | Copyright 2020 and
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/mariaschett/ppltr/67f45f9e329800e6c39094d7c3c3af8d168638da/lib/optz_generator.ml | ocaml | careful, find expects column to be there | Copyright 2020 and
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... |
69ed3d3d7098cc8901086cc85ad125ed7f9798503f8efa62ad39cd5d72215893 | solatis/haskell-network-anonymous-tor | Protocol.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Protocol description
--
Defines functions that handle the advancing of the Tor control protocol .
--
-- __Warning__: This function is used internally by 'Network.Anonymous.Tor'
-- and using these functions directly is unsupported. The
-- interfa... | null | https://raw.githubusercontent.com/solatis/haskell-network-anonymous-tor/d2bac315ffec642689480348d4447b042677ed20/src/Network/Anonymous/Tor/Protocol.hs | haskell | # LANGUAGE OverloadedStrings #
| Protocol description
__Warning__: This function is used internally by 'Network.Anonymous.Tor'
and using these functions directly is unsupported. The
interface of these functions might change at any time without
prior notice.
^ The ... |
Defines functions that handle the advancing of the Tor control protocol .
module Network.Anonymous.Tor.Protocol ( Availability (..)
, isAvailable
, socksPort
, connect
... |
bdb6ca168a2f9770770dee0b03af778314482bd83b8b25c60f46b94fe7870c74 | marcoheisig/Petalisp | lazy-array.lisp | © 2016 - 2023 - license : GNU AGPLv3 -*- coding : utf-8 -*-
(in-package #:petalisp.core)
(defstruct (delayed-action
(:predicate delayed-action-p)
(:copier nil)
(:constructor nil)))
(defstruct (lazy-array
(:predicate lazy-array-p)
(:copier nil))... | null | https://raw.githubusercontent.com/marcoheisig/Petalisp/b124ff1133a3f1f71c591608460cc993bdc0ec3c/code/core/lazy-array.lisp | lisp | The shape of a lazy array describes the set of indices for which the
lazy array has associated values.
The ntype of a lazy array is a conservative estimate on the the type
of each individual element.
The depth of a lazy array that is the result of wrapping an actual
The refcount of a lazy array is an integer that... | © 2016 - 2023 - license : GNU AGPLv3 -*- coding : utf-8 -*-
(in-package #:petalisp.core)
(defstruct (delayed-action
(:predicate delayed-action-p)
(:copier nil)
(:constructor nil)))
(defstruct (lazy-array
(:predicate lazy-array-p)
(:copier nil))... |
fb4ed7ab6931008ec44b2c8d842808e45c0301c5c384aa6de9eaf7a37724427b | mirage/mirage-tcpip | vnetif_common.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/mirage-tcpip/4bae5497c5ef76c1dc3532bb0e4d6ad466051c50/test/vnetif_common.ml | ocaml | TODO Some of these modules and signatures could eventually be moved
to mirage-vnetif
* Create a new backend
* Create a new stack connected to an existing backend
* Disable a listener function
* Records pcap data from the backend while running the specified
function. Disables the pcap recorder when the fun... |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
a0e33c84d6944e4b3602740991e4976dcb0fab17bd40879fbf8678c5e142e4a6 | msantos/verx | verx_client_unix_tests.erl | Copyright ( c ) 2012 - 2021 , < >
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
%%
%% Redistributions of source code must retain the above copyright
%% notice, this list of condition... | null | https://raw.githubusercontent.com/msantos/verx/b80ad5cb28ffa09b0fb1808e3fe8f44287699331/test/verx_client_unix_tests.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in bi... | Copyright ( c ) 2012 - 2021 , < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
COPYRIGHT HOLDER OR FOR ANY DIRECT , INDIRECT ,
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,
BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
LOSS OF U... |
511963788c9799cc0397ce30acb7ffe78f0749ff1655a94babc3f94ba744f908 | ddmcdonald/sparser | ns-unknown-rd-items-phase3-11601-12000.lisp |
(IN-PACKAGE :SP)
(DEFPARAMETER SPARSER::*NS-RD-PHASE3-11601-12000*
'("43B2" "6B6" "A+A" "A-351G" "A-C" "A-CDK2" "A-D" "A-GVGD" "A-allele"
"A-bands" "A-loop" "A-to-I" "A-treated" "A1" "A14L" "A15" "A159E" "A15V"
"A172F" "A18C" "A18G" "A19E" "A2508Fluc" "A375Fluc" "A4" "A50V" "A8" "A9"
"AA-NAT" "AARPs" "AA... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/304bd02d0cf7337ca25c8f1d44b1d7912759460f/Sparser/code/s/tools/ns-stuff/old-unknown/ns-unknown-rd-items-phase3-11601-12000.lisp | lisp |
(IN-PACKAGE :SP)
(DEFPARAMETER SPARSER::*NS-RD-PHASE3-11601-12000*
'("43B2" "6B6" "A+A" "A-351G" "A-C" "A-CDK2" "A-D" "A-GVGD" "A-allele"
"A-bands" "A-loop" "A-to-I" "A-treated" "A1" "A14L" "A15" "A159E" "A15V"
"A172F" "A18C" "A18G" "A19E" "A2508Fluc" "A375Fluc" "A4" "A50V" "A8" "A9"
"AA-NAT" "AARPs" "AA... | |
8925016487c443539f2e04e3ccac4cc8ab3ff3e02e3a0d7092f94404d7323f73 | YoshikuniJujo/funpaala | growable0.hs | class Growable g where
grow :: g -> Maybe g
add :: g -> g -> g
growingSum :: Growable g => g -> g
growingSum g = case grow g of
Just g' -> g `add` growingSum g'
Nothing -> g
instance Growable Integer where
grow n | n < 100 = Just $ n + 1
| otherwise = Nothing
add = (+)
| null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/26_type_class/growable0.hs | haskell | class Growable g where
grow :: g -> Maybe g
add :: g -> g -> g
growingSum :: Growable g => g -> g
growingSum g = case grow g of
Just g' -> g `add` growingSum g'
Nothing -> g
instance Growable Integer where
grow n | n < 100 = Just $ n + 1
| otherwise = Nothing
add = (+)
| |
97cfd01404e42c31e5fc8c664c09bd1e2b2bf2895286d7a121699878c06245a6 | tamarit/edd | vigenere_ok.erl | Erlang implementation of Vigenère cipher
% Code from Rosetta Code
% #Erlang
-module(vigenere_ok).
-export([encrypt/2, decrypt/2, from_pos/1, to_pos/1, encrypt/2]).
-import(lists, [append/2, filter/2, map/2, zipwith/3]).
% Utility functions for character tests and conversions
isupper([C|_]) -> isupper(C);
isupper(C... | null | https://raw.githubusercontent.com/tamarit/edd/867f287efe951bec6a8213743a218b86e4f5bbf7/examples/vigenere/vigenere_ok.erl | erlang | Code from Rosetta Code
#Erlang
Utility functions for character tests and conversions
modulo function that normalizes into positive range for positive divisor
convert letter to position in alphabet (A=0,B=1,...,Y=24,Z=25).
convert position in alphabet back to letter
encode the given letter given the single-letter... | Erlang implementation of Vigenère cipher
-module(vigenere_ok).
-export([encrypt/2, decrypt/2, from_pos/1, to_pos/1, encrypt/2]).
-import(lists, [append/2, filter/2, map/2, zipwith/3]).
isupper([C|_]) -> isupper(C);
isupper(C) -> (C >= $A) and (C =< $Z).
islower([C|_]) -> islower(C);
islower(C) -> (C >= $... |
2a03bd00fa50edfbded7717e2c8f5acbe6b022ea508e41fd297288ba0beb24b4 | maiste/equinoxe | equinoxe_cohttp.ml | (*****************************************************************************)
(* Open Source License *)
Copyright ( c ) 2021 - present < >
(* *)
(* Permission is hereby gra... | null | https://raw.githubusercontent.com/maiste/equinoxe/ab5735056d97f4a9ca318e23255ee84625e5626b/src/backend/equinoxe_cohttp.ml | ocaml | ***************************************************************************
Open Source License
Permission is hereby granted, free of charge, to any person obtaining a
copy of this so... | Copyright ( c ) 2021 - present < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN ACT... |
859f822308381ea9e36c3153ee952a09488834dcfefac6aac283ac42dc116767 | scalaris-team/scalaris | yaws_html.erl |
%% File: parse_html.erl
Author :
Created : Tue Nov 25 20:53:36 2003
Purpose : Transform html to an erlang represention ( ehtml )
-module('yaws_html').
-author('').
-export([parse/1,parse/2,h2e/1]).
parse(Name) ->
{ok, B} = file:read_file(Name),
h2e(binary... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/contrib/yaws/src/yaws_html.erl | erlang | File: parse_html.erl
ignore
'<' <id> <sp>+ [<id><sp>*['='<val>]]* ['/'] '>'
bad html
bad html
bad html
|
Author :
Created : Tue Nov 25 20:53:36 2003
Purpose : Transform html to an erlang represention ( ehtml )
-module('yaws_html').
-author('').
-export([parse/1,parse/2,h2e/1]).
parse(Name) ->
{ok, B} = file:read_file(Name),
h2e(binary_to_list(B)).
parse(Name,Out) ->
... |
4c36d60e791c94d825dc0a883d38963b384c1f4353a855312ce1d4bf153d9d23 | clojure-interop/google-cloud-clients | Type$Code.clj | (ns com.google.cloud.spanner.Type$Code
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.spanner Type$Code]))
(def BOOL
"Enum Constant.
type: com.google.cloud.spanner.Type$Code"
Type$Code/BOOL)
(def INT64
"Enum Constant.
type: com.google.cloud.spanner.Type$Code"
Type$Code/I... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.spanner/src/com/google/cloud/spanner/Type%24Code.clj | clojure | (ns com.google.cloud.spanner.Type$Code
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.spanner Type$Code]))
(def BOOL
"Enum Constant.
type: com.google.cloud.spanner.Type$Code"
Type$Code/BOOL)
(def INT64
"Enum Constant.
type: com.google.cloud.spanner.Type$Code"
Type$Code/I... | |
8bfc04b7c63506e031e46dafe4ba5ec858a88636162155a9f389d5df03fb42ff | Bodigrim/arithmoi | Testing.hs | -- |
Module : Math . . Primes . Testing
Copyright : ( c ) 2011
Licence : MIT
Maintainer : < >
--
Primality tests .
module Math.NumberTheory.Primes.Testing
( -- * Standard tests
isPrime
, isCertifiedPrime
-- * Partial tests
, bailliePSW
, millerRabinV
, is... | null | https://raw.githubusercontent.com/Bodigrim/arithmoi/df789d23341247e9cdb4f690595ea99c89836d09/Math/NumberTheory/Primes/Testing.hs | haskell | |
* Standard tests
* Partial tests
* Trial division | Module : Math . . Primes . Testing
Copyright : ( c ) 2011
Licence : MIT
Maintainer : < >
Primality tests .
module Math.NumberTheory.Primes.Testing
isPrime
, isCertifiedPrime
, bailliePSW
, millerRabinV
, isStrongFermatPP
, isFermatPP
, trialDivisionPrimeTo
... |
086285d85ac1b3eb2072039e46bc8713875843712155ac790598a87e617ccb3f | haskell-tools/haskell-tools | Tuple.hs | module Refactor.GenerateTypeSignature.Tuple where
tuple x y = (x,y)
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/GenerateTypeSignature/Tuple.hs | haskell | module Refactor.GenerateTypeSignature.Tuple where
tuple x y = (x,y)
| |
ccaa37c1d5e5b75121dc73b648c605f0a5551e1007fa78fc4a70c7ce2e0e6ccc | democracyworks/datomic-toolbox | core.clj | (ns datomic-toolbox.core
(:require [clojure.tools.logging :as log]
[datomic.api :as d]
[datomic-toolbox.migration :as migration])
(:refer-clojure :exclude [partition]))
(def default-uri (atom nil))
(def default-partition (atom nil))
(def default-connection
"In theory this shouldn't be nee... | null | https://raw.githubusercontent.com/democracyworks/datomic-toolbox/670d6da7d8b3195df18616ad1e4c292146859ab5/src/datomic_toolbox/core.clj | clojure | (ns datomic-toolbox.core
(:require [clojure.tools.logging :as log]
[datomic.api :as d]
[datomic-toolbox.migration :as migration])
(:refer-clojure :exclude [partition]))
(def default-uri (atom nil))
(def default-partition (atom nil))
(def default-connection
"In theory this shouldn't be nee... | |
5388e33e7b502bfb65ad076a36b3a0c28cad168a15f71ce679be1b2d7c0398e1 | jnear/compiler-construction-assignments | run-tests-A3.rkt | #! /usr/bin/env racket
#lang racket
(require "utilities.rkt")
(require "interp-R1.rkt")
(require "compiler-A3.rkt")
(debug-level 1)
Define the passes to be used by interp - tests and the grader
;; Note that your compiler file (or whatever file provides your passes)
;; should be named "compiler.rkt"
(define r1-passe... | null | https://raw.githubusercontent.com/jnear/compiler-construction-assignments/17a1edbd59627341622203056180d9af7830756d/run-tests-A3.rkt | racket | Note that your compiler file (or whatever file provides your passes)
should be named "compiler.rkt" | #! /usr/bin/env racket
#lang racket
(require "utilities.rkt")
(require "interp-R1.rkt")
(require "compiler-A3.rkt")
(debug-level 1)
Define the passes to be used by interp - tests and the grader
(define r1-passes
`( ("uniquify" ,uniquify ,interp-R1)
("remove-complex-opera*" ,remove-complex-opera* ,interp-R1)
... |
dd7cebabedc4838357d1a15a4b1551719cf709b759789bac6a0df522e9d04ff3 | digitallyinduced/ihp | View.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE GADTs #-}
|
Module : . Dashboard . View
Description : Views for Job dashboard
Module: IHP.Job.Dashboard.View
Description: Views for Job dashboard
-}
module IHP.Job.Dashboard.View where
import IHP.Prelude
import IHP.ViewPrelude (JobStatus(..), ControllerContext, ... | null | https://raw.githubusercontent.com/digitallyinduced/ihp/d0cda9a2d3b0038c44ebf9d4e0e5af0a84352a50/IHP/Job/Dashboard/View.hs | haskell | # LANGUAGE GADTs #
| Provides a type-erased view. This allows us to specify a view as a return type without needed
to know exactly what type the view will be, which in turn allows for custom implmentations of
almost all the view functions in this module. Go GADTs!
| Since the only constructor for 'SomeView' require... | # LANGUAGE AllowAmbiguousTypes #
|
Module : . Dashboard . View
Description : Views for Job dashboard
Module: IHP.Job.Dashboard.View
Description: Views for Job dashboard
-}
module IHP.Job.Dashboard.View where
import IHP.Prelude
import IHP.ViewPrelude (JobStatus(..), ControllerContext, Html, View, hsx, html, ... |
8ec457a5e4a82c12a5dba1627e692578e8310bb339fab37231cdfa5e01505521 | twashing/edgaru | core.clj | (ns edgaru.five.core
(:require [clj-time.core :as tc]
[clj-time.coerce :as tco]))
;;
(defn random-in-range [lower upper]
(let [r (rand upper)]
(if (>= r lower)
r
(+ (rand (- upper lower))
lower))))
(defn stochastic-k [last-price low-price high-price]
(let [hlrange (- high... | null | https://raw.githubusercontent.com/twashing/edgaru/7a6bb30eee5fa2dfdf3baabe8b25e9bcc5019181/src/edgaru/five/core.clj | clojure |
(println (str "[" last " | " low " | " high "] <=> k[" k "] / kPM[" kPM "] / newprice[" newprice "]"))
generate a raw infinite list of floats within a given range
generate a timeseries based on thoe numbers | (ns edgaru.five.core
(:require [clj-time.core :as tc]
[clj-time.coerce :as tco]))
(defn random-in-range [lower upper]
(let [r (rand upper)]
(if (>= r lower)
r
(+ (rand (- upper lower))
lower))))
(defn stochastic-k [last-price low-price high-price]
(let [hlrange (- high-pr... |
7f8c59275ac31bec527bcef902f7e89755300154223a660cdb3ab80dfcd16c06 | arttuka/reagent-material-ui | local_fire_department_rounded.cljs | (ns reagent-mui.icons.local-fire-department-rounded
"Imports @mui/icons-material/LocalFireDepartmentRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def ... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/local_fire_department_rounded.cljs | clojure | (ns reagent-mui.icons.local-fire-department-rounded
"Imports @mui/icons-material/LocalFireDepartmentRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def ... | |
e3ead24f25f5c9f408936bad896a7afad17f72ab357ffa464776f65b4ed3cc9d | osstotalsoft/functional-guy | 02.SumTypes.hs | --simple sum types
data Bool' = True' | False' deriving (Show)
data Sex = Male | Female
--pattern matching on data constructors
greet :: Sex -> String
greet Male = "Sir"
greet Female = "M'lady"
--mixing type synonims with sum types
data PaymentMethod' = CreditCard' (String, String) | Cash'
type CardNumber = String
... | null | https://raw.githubusercontent.com/osstotalsoft/functional-guy/c02a8b22026c261a9722551f3641228dc02619ba/Chapter3.%20Haskell's%20Type%20System/Exercises/02.%20Types%20algebra/02.SumTypes.hs | haskell | simple sum types
pattern matching on data constructors
mixing type synonims with sum types
pattern matching on data constructors | data Bool' = True' | False' deriving (Show)
data Sex = Male | Female
greet :: Sex -> String
greet Male = "Sir"
greet Female = "M'lady"
data PaymentMethod' = CreditCard' (String, String) | Cash'
type CardNumber = String
type CVC = String
type CardInfo = (CardNumber, CVC)
data PaymentMethod = CreditCard CardInfo |... |
9244d68e586a2958ed66bc2d5ab16078d1f3e59a1d60fe8462b473c940b60a29 | gebi/jungerl | matrix44.erl | -module(matrix44).
-author('').
%% ---------------------------------------------------------------------
Created : 92 - 01 - 29 by Tobbe ( )
%%
matrix44 - 4x4 Matrix operations , suitable for
%% 3D-Graphics transformations
%%
%% Data structure: Matrix ::= {X11,X12,X13,X14,X21,...,X44}
%% ... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/ex11/src/matrix44.erl | erlang | ---------------------------------------------------------------------
3D-Graphics transformations
Data structure: Matrix ::= {X11,X12,X13,X14,X21,...,X44}
Vector ::= {X1,X2,X3,X4}
Useful functions:
multiply44( Matrix_X , Matrix_Y )
resulting matrix.
multiply14( Vec... | -module(matrix44).
-author('').
Created : 92 - 01 - 29 by Tobbe ( )
matrix44 - 4x4 Matrix operations , suitable for
Multiplies two 4 by 4 matrices and returns the
Multiplies a vector ( with 4 elements ) with a Matrix and
mk_rotate_matrix ( Axis , Angle )
Returns a Vector in homog... |
0210ff6ed04363941501de56757f700852e329e323e41ac98b59fe1258b40719 | Ericson2314/lighthouse | Interrupts.hs | module Kernel.Interrupts
( registerIRQHandler
, callIRQHandler
, interruptHandler
) where
import H.Monad(H,liftIO)
import H.Mutable(HArray,newArray,readArray,writeArray)
import H.Unsafe(unsafePerformH)
import H.Interrupts(IRQ(..),enableIRQ,eoiIRQ)
import LwConc.Conc(timerHandler)
import Foreign... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/kernel/Kernel/Interrupts.hs | haskell | timerHandler isn't registered in the table. I suppose it could be.
Note that this can reenter. | module Kernel.Interrupts
( registerIRQHandler
, callIRQHandler
, interruptHandler
) where
import H.Monad(H,liftIO)
import H.Mutable(HArray,newArray,readArray,writeArray)
import H.Unsafe(unsafePerformH)
import H.Interrupts(IRQ(..),enableIRQ,eoiIRQ)
import LwConc.Conc(timerHandler)
import Foreign... |
ac80972bb72dff9e29b768de14cd48bf82ec44e579e5319afedf8c467cbda17e | vorotynsky/Kroha | Stack.hs | module Kroha.Stack where
import Control.Comonad (duplicate, extract, ($>))
import Data.List (mapAccumL)
import Data.Maybe (fromJust)
import Kroha.Syntax.Syntax
import Kroha.Types
type StackRange = (Int, Int) {-offset, size-}
stackVar :: TypeCo... | null | https://raw.githubusercontent.com/vorotynsky/Kroha/e5d11c5f3612d3ea9b0701c7945ff8cc51ea12d6/src/Kroha/Stack.hs | haskell | offset, size | module Kroha.Stack where
import Control.Comonad (duplicate, extract, ($>))
import Data.List (mapAccumL)
import Data.Maybe (fromJust)
import Kroha.Syntax.Syntax
import Kroha.Types
stackVar :: TypeConfig -> FrameElement d -> Int
stackVar tc (Var... |
9412546785c1681cb756131d0aec42fabbe23871cc44b0ed00219970dd09f4b9 | ninjudd/jiraph | formats.clj | (ns flatland.jiraph.formats
(:use [flatland.useful.experimental :only [lift-meta]]
[flatland.useful.map :only [update update-each]]
[flatland.useful.utils :only [copy-meta]])
(:require [flatland.ego.core :as ego]
[flatland.schematic.core :as schema]
[flatland.jiraph.codex :as... | null | https://raw.githubusercontent.com/ninjudd/jiraph/e2897cf4770ead40e574261cd294d2c6701703e8/src/flatland/jiraph/formats.clj | clojure | read revisions just by discarding the rest
never write with this codec | (ns flatland.jiraph.formats
(:use [flatland.useful.experimental :only [lift-meta]]
[flatland.useful.map :only [update update-each]]
[flatland.useful.utils :only [copy-meta]])
(:require [flatland.ego.core :as ego]
[flatland.schematic.core :as schema]
[flatland.jiraph.codex :as... |
d71d04382b971b364dcbbe3ed000c6343e8bdd8f485e702807803c4e7eba63fb | jfaure/Irie-lang | Builtins.hs | -- Builtins: the interface to compiler primitives is a (hardcoded) standard importable module
! the Prelude supplies mixfixes and more convenient access to these primitives
-- * constructs a vector of primitives
* a ( Map HName IName ) to resolve names to indexes
module Builtins (primBinds , primMap , typeOfLit , ... | null | https://raw.githubusercontent.com/jfaure/Irie-lang/186640a095d14560ff102ef613648e558e5b3f1e/compiler/3_Core/Builtins.hs | haskell | Builtins: the interface to compiler primitives is a (hardcoded) standard importable module
* constructs a vector of primitives
mkExtTy x = [THExt x]
, uncurry ExtFn <$> extFnBinds
Primitive Labels
* Predicates must return labels so if_then_else_ can fuse
Primitive field Names
! Indexes here are of vital importa... | ! the Prelude supplies mixfixes and more convenient access to these primitives
* a ( Map HName IName ) to resolve names to indexes
module Builtins (primBinds , primMap , typeOfLit , primLabelHNames , primLabelMap , primFieldHNames , primFieldMap , builtinFalse , builtinTrue) where
import Prim
import CoreSyn
import... |
5cb9773c5b573bf73d852d5a96b3e0f942cc0db64918c6e8429b79e33957de58 | bhauman/devcards | om_next.cljs | (ns devdemos.om-next
(:require
[devcards.core]
[om.next :as om :refer-macros [defui ui]]
[om.next.protocols :as p]
[om.dom :as dom :include-macros true]
[clojure.string :as string]
[sablono.core :as sab :include-macros true]
[cljs.test :as t :include-macros true :refer-macros [tes... | null | https://raw.githubusercontent.com/bhauman/devcards/65caa84c9438dd8bdf8cd21964e6033b1a22c178/example_src/devdemos/om_next.cljs | clojure | Notice that I am not including the 'devcards.core namespace | (ns devdemos.om-next
(:require
[devcards.core]
[om.next :as om :refer-macros [defui ui]]
[om.next.protocols :as p]
[om.dom :as dom :include-macros true]
[clojure.string :as string]
[sablono.core :as sab :include-macros true]
[cljs.test :as t :include-macros true :refer-macros [tes... |
f58c7ba47a3aade65ef0ec9f210a26fed0ac0b1b524deda1e58241a1db6b8abb | johnyob/dromedary | test_pr7230.ml | open! Import
open Util
let%expect_test "" =
let str =
{|
type 'a t =
| Int constraint 'a = int
;;
external raise : 'a. exn -> 'a = "%raise";;
exception Not_found;;
exception Assert_false;;
let _ =
match (raise Not_found : float t) with ( _ -> raise Assert... | null | https://raw.githubusercontent.com/johnyob/dromedary/a9359321492ff5c38c143385513e673d8d1f05a4/test/typing/gadts/test_pr7230.ml | ocaml | open! Import
open Util
let%expect_test "" =
let str =
{|
type 'a t =
| Int constraint 'a = int
;;
external raise : 'a. exn -> 'a = "%raise";;
exception Not_found;;
exception Assert_false;;
let _ =
match (raise Not_found : float t) with ( _ -> raise Assert... | |
156ba484549d4dddeaba33f91ee56d08c781377fe9eff721a39cede0c51d06c5 | cbd/edis | edis_client_mgr.erl | %%%-------------------------------------------------------------------
@author < >
@author < >
( C ) 2011 InakaLabs SRL
%%% @doc Edis client manager
%%% @end
%%%-------------------------------------------------------------------
-module(edis_client_mgr).
-author('Fernando Benavides <>').
-author('Chad DePu... | null | https://raw.githubusercontent.com/cbd/edis/aad89352f25a7f3737242ddc9bc913def75a517a/src/edis_client_mgr.erl | erlang | -------------------------------------------------------------------
@doc Edis client manager
@end
-------------------------------------------------------------------
====================================================================
External functions
=============================================================... | @author < >
@author < >
( C ) 2011 InakaLabs SRL
-module(edis_client_mgr).
-author('Fernando Benavides <>').
-author('Chad DePue <>').
-include("edis.hrl").
-behaviour(supervisor).
-export([start_link/1, start_client/0, init/1]).
-spec start_link(atom()) -> ignore | {error, term()} | {ok, pid()}.
start... |
f68c8091486b720eefc5e81556d72252bb21e0b694dddbd0b18609a275f2a705 | donatello/minio-hs-archived | Time.hs | module Network.Minio.Data.Time
(
awsTimeFormat
, awsTimeFormatBS
, awsDateFormat
, awsDateFormatBS
, awsParseTime
) where
import Data.ByteString.Char8 (pack)
import qualified Data.Time as Time
import Lib.Prelude
awsTimeFormat :: UTCTime -> [Char]
awsTimeFormat = Time.formatTime T... | null | https://raw.githubusercontent.com/donatello/minio-hs-archived/c808dc1be2a5b15c2c714c0052f1d6a7bc98a809/src/Network/Minio/Data/Time.hs | haskell | module Network.Minio.Data.Time
(
awsTimeFormat
, awsTimeFormatBS
, awsDateFormat
, awsDateFormatBS
, awsParseTime
) where
import Data.ByteString.Char8 (pack)
import qualified Data.Time as Time
import Lib.Prelude
awsTimeFormat :: UTCTime -> [Char]
awsTimeFormat = Time.formatTime T... | |
91d445278e23eee282f7322dbb2c42a7edd300f562fcf901944039ff46cab830 | cmoid/erlbutt | ssb_client.erl | SPDX - License - Identifier : GPL-2.0 - only
%%
Copyright ( C ) 2018 Dionne Associates , LLC .
-module(ssb_client).
-include("ssb.hrl").
-import(utils, [concat/1,
combine/2,
send_data/4]).
-behaviour(gen_server).
%% API
-export([start_link/2, send/2]).
%% gen_server callbacks
-e... | null | https://raw.githubusercontent.com/cmoid/erlbutt/8d8e593e8f32ac9125f0554b0eaf0347a0929ed4/apps/ssb/src/ssb_client.erl | erlang |
API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
=============================================================... | SPDX - License - Identifier : GPL-2.0 - only
Copyright ( C ) 2018 Dionne Associates , LLC .
-module(ssb_client).
-include("ssb.hrl").
-import(utils, [concat/1,
combine/2,
send_data/4]).
-behaviour(gen_server).
-export([start_link/2, send/2]).
-export([init/1, handle_call/3, hand... |
8b0fd91256ac8c6fda7676ff68aa511ea8d77ce831224795655b3066c206fd61 | day8/re-frame-10x | console.cljs | (ns day8.re-frame-10x.tools.console)
(defn spy
([x]
(js/console.log x)
x)
([label x]
(js/console.log label x)
x)) | null | https://raw.githubusercontent.com/day8/re-frame-10x/dad02ff85793119f6ccfeeb9df328cfe91ec6354/src/day8/re_frame_10x/tools/console.cljs | clojure | (ns day8.re-frame-10x.tools.console)
(defn spy
([x]
(js/console.log x)
x)
([label x]
(js/console.log label x)
x)) | |
6abe2487455dade368c1fd435152cac6c1e07f253c793877b136350a8cc9e54f | jsermeno/amby | Style.hs | # LANGUAGE StandaloneDeriving #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE CPP #
module Amby.Style
( setThemeStyles
, setDefaultThemeStyles
, scaledAxisCustom
, categoricalAxisData
)
where
import qualified Data.List as L
... | null | https://raw.githubusercontent.com/jsermeno/amby/3c73501c75926eca8f3f7cc4274bc7751fc49788/src/Amby/Style.hs | haskell | TODO: Chart does not give a way to specify space between axis
tick labels and axis label
- | Equalizes precision for all labels.
----------------------
Scaling
----------------------
| Taken from the 'Chart' package with minor modifications.
Needed to enforce 'xlim' and 'ylim' maximum and minimum limits.
Default ... | # LANGUAGE StandaloneDeriving #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE CPP #
module Amby.Style
( setThemeStyles
, setDefaultThemeStyles
, scaledAxisCustom
, categoricalAxisData
)
where
import qualified Data.List as L
... |
0a73cc2926f761385002bc142968a110fe6c5f477101c11deaa56a6fb28bf6ee | webyrd/n-grams-for-synthesis | arithmetic-util.scm | ; This file is part of the reference implementation of the R6RS Arithmetic SRFI.
; See file COPYING.
Utilities for implementing higher - level arithmetic
(define (make-typo-op/2 proc type)
(lambda (a b)
(error "type mismatch" proc type a b)))
(define (never x)
#f)
(define (always x)
#t)
(define (make-t... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-77/arithmetic-reference/arithmetic-util.scm | scheme | This file is part of the reference implementation of the R6RS Arithmetic SRFI.
See file COPYING. |
Utilities for implementing higher - level arithmetic
(define (make-typo-op/2 proc type)
(lambda (a b)
(error "type mismatch" proc type a b)))
(define (never x)
#f)
(define (always x)
#t)
(define (make-typo-op/1 proc type)
(lambda (a)
(error "type mismatch" proc type a)))
(define (id x) x)
(defi... |
f8a541a9195fc53735b9b8ce3186b68fe6fed4fe23a5742c3ae56ab7cfc0b1d5 | nilenso/time-tracker | core_test.clj | (ns time-tracker.core-test
(:require [clojure.test :refer :all]
[time-tracker.core :refer :all]))
| null | https://raw.githubusercontent.com/nilenso/time-tracker/054d0dc6d6b89a4ed234d8f0b0a260b6deeef9e3/test/clj/time_tracker/core_test.clj | clojure | (ns time-tracker.core-test
(:require [clojure.test :refer :all]
[time-tracker.core :refer :all]))
| |
bf992f9e9e9eac275f7d1782efa5d69a8acb5fb5f3e394d03a49e7bddb2357ea | MrEbbinghaus/fulcro-material-ui-wrapper | input.cljc | (ns mui.inputs.input
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs
[["@mui/material/Input" :default Input]
["@mui/material/InputBase" :default InputBase]
["@mui/material/InputAdornment" :default InputAdornment]
["@mui/material/InputLabel" ... | null | https://raw.githubusercontent.com/MrEbbinghaus/fulcro-material-ui-wrapper/058f1dd4b85542914f92f48a4010ea9ad497e48f/src/mui/inputs/input.cljc | clojure | (ns mui.inputs.input
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs
[["@mui/material/Input" :default Input]
["@mui/material/InputBase" :default InputBase]
["@mui/material/InputAdornment" :default InputAdornment]
["@mui/material/InputLabel" ... | |
2362b4414f33647e2200aa29e30f0cc771f5c3cbabac8305057e31a8249a5813 | facebook/pyre-check | revealTypeTest.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/3d74c17236e2fec273108c717c8ca13ffb6bc96b/source/analysis/test/integration/revealTypeTest.ml | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
73b3b64f3d7f38bfec38449998a83db66606a9287032379350e03885365fe04f | dradtke/Lisp-Text-Editor | menu-item.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; menu-item.lisp --- GtkMenuItem
;;;
Copyright ( C ) 2011 , < >
;;;
(in-package :gtk-cffi)
(defclass menu-item (bin)
())
(defcfun gtk-menu-item-new :pointer)
(defcfun gtk-menu-item-new-with-label :pointer (label gtk-string))
(defcfun gtk-menu-item-new-with-... | null | https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/gtk-cffi-20120208-cvs/gtk/menu-item.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
menu-item.lisp --- GtkMenuItem
| Copyright ( C ) 2011 , < >
(in-package :gtk-cffi)
(defclass menu-item (bin)
())
(defcfun gtk-menu-item-new :pointer)
(defcfun gtk-menu-item-new-with-label :pointer (label gtk-string))
(defcfun gtk-menu-item-new-with-mnemonic :pointer (label gtk-string))
(defmethod gconstructor ((menu-item menu-item)
... |
9529ffffab9917d6a84274d52b45aecff8d892e357244394fdea739e6b928e68 | nomeata/haskell-rec-def | Bool.hs | # LANGUAGE TypeApplications #
| The type @RBool@ is like ' ' , but allows recursive definitions :
> > > : {
let x = RB.true
y = x RB . & & z
z = y RB.|| RB.false
in RB.get x
:}
True
This finds the least solution , i.e. prefers ' False ' over ' True ' :
> > > : {
let x = x R... | null | https://raw.githubusercontent.com/nomeata/haskell-rec-def/43f75f1e495379fc66805949ff9a7ba1ee13df5a/Data/Recursive/Bool.hs | haskell | $setup
>>> :set -XFlexibleInstances
>>> import Test.QuickCheck
>>> instance Arbitrary RB.RBool where arbitrary = RB.mk <$> arbitrary
>>> instance Show RB.RBool where show = show . RB.get
| Extracts the value of a 'RBool'
| prop> RB.get (RB.mk b) === b
| prop> RB.get RB.true == True
| prop> RB.get RB.false ==... | # LANGUAGE TypeApplications #
| The type @RBool@ is like ' ' , but allows recursive definitions :
> > > : {
let x = RB.true
y = x RB . & & z
z = y RB.|| RB.false
in RB.get x
:}
True
This finds the least solution , i.e. prefers ' False ' over ' True ' :
> > > : {
let x = x R... |
d8aa220ff683918fb2b24cbd067fcff2a32e7518cd141959ec1f70708a2d4a28 | jrh13/hol-light | decid.ml | (* ========================================================================= *)
Decision procedure for the provability logic GL .
(* *)
( c ) Copyright , , 2020 - 2022 .
(* ========================... | null | https://raw.githubusercontent.com/jrh13/hol-light/ab57c07ff0105fef75a9fcdd179eda0d26854ba3/GL/decid.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
---------------... | Decision procedure for the provability logic GL .
( c ) Copyright , , 2020 - 2022 .
Lemmata .
let HOLDS_NNFC_UNFOLD = prove
(`(!V w:W. ~holds (W,R) V False w) /\
(!V w. holds (W,R) V True w) /\
... |
20c150aa06431a860051578b64a90269f9507d97cc87a13b4e85bb8531352ad5 | c4-project/c4f | atomic_store.ml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/fuzz_actions/test/atomic_store.ml | ocaml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | |
56018b00b17a68f94c08a29471ba12bb2030be2a12cf5fc25bd19fd2f9940dac | jeromesimeon/Galax | streaming_ordered_context.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/streaming/streaming_ordered_context.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : streaming_ordered_context.mli , v 1.5 2007/02/01 22:08:54 simeon Exp $
type streaming_ordered_context
val build_streaming_ordered_context :
Nodeid.docid -> Nodeid_context.nodeid_context -> streaming_ordered_context
val g... |
e7344f687ee2036cb4942e5e404cd1c46a674aa572902b50f5b2f9b20f010045 | mauny/the-functional-approach-to-programming | load.ml | #directory "../MLGRAPH.DIR";;
#open "MLgraph";;
load_object "MLgraph";;
load_object "permutations";;
#open "permutations";;
load_object "complex";;
#open "complex";;
load_object "pavages1";;
#open "pavages1";;
load_object"pavages2";;
#open "pavages2";;
| null | https://raw.githubusercontent.com/mauny/the-functional-approach-to-programming/1ec8bed5d33d3a67bbd67d09afb3f5c3c8978838/cl-75/Geom/load.ml | ocaml | #directory "../MLGRAPH.DIR";;
#open "MLgraph";;
load_object "MLgraph";;
load_object "permutations";;
#open "permutations";;
load_object "complex";;
#open "complex";;
load_object "pavages1";;
#open "pavages1";;
load_object"pavages2";;
#open "pavages2";;
| |
62ccc772cbd5f2f29dff9be738eef74adba09f40ec365a1e96bbe93dbb21f487 | hemmi/coq2scala | numbers_syntax.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/hemmi/coq2scala/d10f441c18146933a99bf2088116bd213ac3648d/coq-8.4pl2-old/plugins/syntax/numbers_syntax.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
int31 stuff
bigN stuff
number of... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
digit - based syntax for in... |
021f5f6b4f38aa2f7e24e4b5735f952d1b4b3128050ce97e6e9bdc4e0916cf31 | rmloveland/scheme48-0.53 | s48-channel.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
; Implementation of OS channels in Scheme.
;
; A channel an index into a vector of ports in the underlying Scheme
; implementation.
; Vector mapping indicies to ports.
(define *channels* '#())
(define (vector-posq vec thing)
(let loop ((i 0))
(cond... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/vm/s48-channel.scm | scheme | Implementation of OS channels in Scheme.
A channel an index into a vector of ports in the underlying Scheme
implementation.
Vector mapping indicies to ports.
Add PORT to the vector of channels, reusing a slot if possible.
The default ports
These just open or close the appropriate port and coerce it to a channel... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
(define *channels* '#())
(define (vector-posq vec thing)
(let loop ((i 0))
(cond ((= i (vector-length vec))
#f)
((eq? thing (vector-ref vec i))
i)
(else
(loop (+ i 1))))))
(define (channel->port channel)
(vector-ref *channels* ... |
4a8921227dd7efa9fb87115e0159ff58c87e1507af46ee629e457e51ada75e27 | agda/agda | RangeMap.hs | # LANGUAGE TemplateHaskell #
module Internal.Utils.RangeMap
( tests
, overlaps
, toListProperty
, coveringRangeProperty
)
where
import Agda.Interaction.Highlighting.Range
import Agda.Utils.Null
import Agda.Utils.RangeMap
import Agda.Utils.Tuple
import Prelude hiding (null, splitAt)
import qualified Data... | null | https://raw.githubusercontent.com/agda/agda/cbba4e4c6f658e8d9d332ed6173caf98ea075904/test/Internal/Utils/RangeMap.hs | haskell | ----------------------------------------------------------------------
Helper definitions
classified as \"overlapping\".
| Classifies test cases based on whether the intersection of the
range and the 'RangeMap' is non-empty, and whether any range in the
internal representation of the 'RangeMap' is \"split\" by the... | # LANGUAGE TemplateHaskell #
module Internal.Utils.RangeMap
( tests
, overlaps
, toListProperty
, coveringRangeProperty
)
where
import Agda.Interaction.Highlighting.Range
import Agda.Utils.Null
import Agda.Utils.RangeMap
import Agda.Utils.Tuple
import Prelude hiding (null, splitAt)
import qualified Data... |
8fc2309c9496d34b3cba548d98725849c98a3a15b48a999d7f1fc8722c76dd6f | Alotor/ghoul-reader | opml_test.cljs | (ns ghoul.parser.opml-test
(:require [cljs.test :refer-macros [deftest testing is]]
[ghoul.parser.opml :as opml]
[ghoul.parser.opml-test-xml :as test]))
(deftest ompl-parsing
(testing "Parse a basic opml document"
(let [result (opml/parse-document test/document-basic)
expecte... | null | https://raw.githubusercontent.com/Alotor/ghoul-reader/ea0f2095e143bfd8a526905761f2cfd87324ad71/src/test/ghoul/parser/opml_test.cljs | clojure | (ns ghoul.parser.opml-test
(:require [cljs.test :refer-macros [deftest testing is]]
[ghoul.parser.opml :as opml]
[ghoul.parser.opml-test-xml :as test]))
(deftest ompl-parsing
(testing "Parse a basic opml document"
(let [result (opml/parse-document test/document-basic)
expecte... | |
b3c851cc19dd996de00e31eed06632fd6339c7e92a2abc7b6efc1e516d24c661 | jumper149/go | GameId.hs | module Go.Run.GameId ( GameId
) where
import GHC.Generics
import Data.Aeson
import Servant.API (FromHttpApiData, ToHttpApiData)
newtype GameId = GameId { unwrapGameId :: Integer }
deriving (Enum, Eq, Generic, Ord, Read, Show, FromHttpApiData, ToHttpApiData)
instance FromJSON GameId
instance T... | null | https://raw.githubusercontent.com/jumper149/go/603e61f64e8e7c890bbc914fef6033b5ed7dd005/src/Go/Run/GameId.hs | haskell | module Go.Run.GameId ( GameId
) where
import GHC.Generics
import Data.Aeson
import Servant.API (FromHttpApiData, ToHttpApiData)
newtype GameId = GameId { unwrapGameId :: Integer }
deriving (Enum, Eq, Generic, Ord, Read, Show, FromHttpApiData, ToHttpApiData)
instance FromJSON GameId
instance T... | |
082d8d1211a6031e383fdd0b5f6a4ad71ff71e0e1421027877e43dbf1ee701a8 | ramsay-t/mu2 | mu2_case_mutations.erl | -module(mu2_case_mutations).
-export([all/0, case_mutations/0, random_not_n/2, swap/3]).
-include("../include/mutations.hrl").
-compile(nowarn_shadow_vars).
all() ->
case_mutations().
all_constant(P) ->
case api_refac:type(P) of
atom ->
true;
underscore ->
true;
integer ->
true;
tuple ->... | null | https://raw.githubusercontent.com/ramsay-t/mu2/fd84a1966e81921f08f510e8876e6ad9b6eb89b1/src/mu2_case_mutations.erl | erlang | We must have no all-constant entries
We need at least non-constant patterns
begin
%% Put everything back...
end
)), | -module(mu2_case_mutations).
-export([all/0, case_mutations/0, random_not_n/2, swap/3]).
-include("../include/mutations.hrl").
-compile(nowarn_shadow_vars).
all() ->
case_mutations().
all_constant(P) ->
case api_refac:type(P) of
atom ->
true;
underscore ->
true;
integer ->
true;
tuple ->... |
580a090617e2cb090a7d8c3efc63c0fb3b2432fe85d873b310693638b026646d | MarcKaufmann/congame | identity.rkt | #lang racket/base
(require component
(only-in congame/components/study
make-study-meta
study-meta-id
make-study-instance
study-instance-id)
congame-web/components/user
congame-web/dynamic
db
deta
... | null | https://raw.githubusercontent.com/MarcKaufmann/congame/19cdd2971d4d0d5e25fcaf92dded4521f5f9b40c/congame-tests/congame/identity.rkt | racket | #lang racket/base
(require component
(only-in congame/components/study
make-study-meta
study-meta-id
make-study-instance
study-instance-id)
congame-web/components/user
congame-web/dynamic
db
deta
... | |
5c5ec1367c372b0ccfa7594c75f1bb7b7d8b52e2babe1715f2152fa33d3186eb | craigfe/brands | ppx_brands.ml | open Ppxlib
module type S = sig
val inject_type_operators : core_type -> core_type
val expand_str_type_decl :
rec_flag * type_declaration list -> structure_item list
val expand_sig_type_decl :
rec_flag * type_declaration list -> signature_item list
end
let branded_maker = Printf.sprintf "Brands.Brande... | null | https://raw.githubusercontent.com/craigfe/brands/9054197120a4f1acdfd6937a31d7097014000f67/src/ppx_brands/ppx_brands.ml | ocaml | open Ppxlib
module type S = sig
val inject_type_operators : core_type -> core_type
val expand_str_type_decl :
rec_flag * type_declaration list -> structure_item list
val expand_sig_type_decl :
rec_flag * type_declaration list -> signature_item list
end
let branded_maker = Printf.sprintf "Brands.Brande... | |
cf8998f3113710d4da6144a315492793e7365bd8655eb3d2e7811a02085cb7f7 | jrheard/quinto | grid.cljs | (ns quinto.grid
(:require [com.rpl.specter :refer [select collect-one selected? INDEXED-VALS FIRST LAST ALL]]
[clojure.spec.alpha :as s]
[quinto.specs :as sp :refer [MAX-RUN-LENGTH GRID-HEIGHT GRID-WIDTH]]
[quinto.specter :refer [grid-values indexed-grid-values]]
[quint... | null | https://raw.githubusercontent.com/jrheard/quinto/24078ce72aefd5fbe69be0a3220c4e62ad615ef3/src/quinto/grid.cljs | clojure | committed to making a move that's either vertical or horizontal.
It's vertical!
It's horizontal!
that cell is not in fact playable for this move.
Blocked cells are empty, and moves can't have an empty cell in the middle.
Special case to support calculating a player's tentative score if they place
A move's score ... | (ns quinto.grid
(:require [com.rpl.specter :refer [select collect-one selected? INDEXED-VALS FIRST LAST ALL]]
[clojure.spec.alpha :as s]
[quinto.specs :as sp :refer [MAX-RUN-LENGTH GRID-HEIGHT GRID-WIDTH]]
[quinto.specter :refer [grid-values indexed-grid-values]]
[quint... |
6d08b2963e7a9a1221037b8bddf644a8d6fea24ffe060aca5d17824432a86cf4 | aartaka/nyxt-config | style.lisp | (in-package #:nyxt-user)
;; This automatically darkens WebKit-native interfaces and sends the
;; "prefers-color-scheme: dark" to all the supporting websites.
(setf (uiop:getenv "GTK_THEME") "Adwaita:dark")
My color preferences were n't satisfied by any Emacs theme , so I
;; wrote mine: Laconia (). This
file is si... | null | https://raw.githubusercontent.com/aartaka/nyxt-config/b0b38667b5e058345bad015918d6960134faccba/style.lisp | lisp | This automatically darkens WebKit-native interfaces and sends the
"prefers-color-scheme: dark" to all the supporting websites.
wrote mine: Laconia (). This
backwards-compatible solution, see previous versions of this
file.
Dark-mode is a simple mode for simple HTML pages to color those in
a darker palette. I do... | (in-package #:nyxt-user)
(setf (uiop:getenv "GTK_THEME") "Adwaita:dark")
My color preferences were n't satisfied by any Emacs theme , so I
file is simply a translation of Laconia colors to Nyxt interface .
This only works on the versions of Nyxt after 3.0 . For the
(define-configuration browser
((theme (make-... |
c8e0cbcbd50698b80a090bc0e89a369be2e2482de6edc25399cc024dad9fd66e | knsd/crypto-pubkey-openssh | Setup.hs | import Distribution.Simple
main = defaultMain | null | https://raw.githubusercontent.com/knsd/crypto-pubkey-openssh/d8daa59a9424f08ec74c3ad43bf79e9906410875/Setup.hs | haskell | import Distribution.Simple
main = defaultMain | |
7955ca50f9159a0e6a0527e5b9d6752db52b132fbef9f455b3cf3d755ca16eef | batterseapower/supercompilation-by-evaluation | X2N1.hs | import Complex
#include "../Prelude.hs"
f :: Int -> Complex Double
f n = mkPolar 1 ((2 Prelude.* Prelude.pi) / Prelude.fromIntegral n) Prelude.^ n
realPart'Double = realPart :: Complex Double -> Double
add'ComplexDouble = (Prelude.+) :: Complex Double -> Complex Double -> Complex Double
lit0'ComplexDouble = 0 :: Com... | null | https://raw.githubusercontent.com/batterseapower/supercompilation-by-evaluation/daeb3e12ca8319a5144dd48a763cf7e7825a1999/examples/imaginary/X2N1.hs | haskell | import Complex
#include "../Prelude.hs"
f :: Int -> Complex Double
f n = mkPolar 1 ((2 Prelude.* Prelude.pi) / Prelude.fromIntegral n) Prelude.^ n
realPart'Double = realPart :: Complex Double -> Double
add'ComplexDouble = (Prelude.+) :: Complex Double -> Complex Double -> Complex Double
lit0'ComplexDouble = 0 :: Com... | |
4b304a10106549c3bdbefff4d65f29a8b4175af0b720ef1be1a27b35f776416a | arttuka/reagent-material-ui | video_chat_rounded.cljs | (ns reagent-mui.icons.video-chat-rounded
"Imports @mui/icons-material/VideoChatRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def video-chat-rounded (c... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/video_chat_rounded.cljs | clojure | (ns reagent-mui.icons.video-chat-rounded
"Imports @mui/icons-material/VideoChatRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def video-chat-rounded (c... | |
50356457a88c8d097786a440cd3171384079a11ccbb29b7a683b59980b1987b6 | takikawa/racket-ppa | http-client.rkt | #lang racket/base
(require racket/contract/base
racket/match
racket/list
racket/string
racket/port
(rename-in racket/tcp
[tcp-connect plain-tcp-connect]
[tcp-abandon-port plain-tcp-abandon-port])
openssl
"win32-ssl.rk... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/collects/net/http-client.rkt | racket | Lib
At this point, we have a tunneled socket to the remote
host/port: we do not need to address it; ignore host-bs,
only use port for conn-port-usual?
use
native OS X tools
(define-values (log-i log-o) (make-pipe))
(thread (λ () (copy-port log-i to (current-error-port))))
Doesn't seem necessary because on a re... | #lang racket/base
(require racket/contract/base
racket/match
racket/list
racket/string
racket/port
(rename-in racket/tcp
[tcp-connect plain-tcp-connect]
[tcp-abandon-port plain-tcp-abandon-port])
openssl
"win32-ssl.rk... |
cd7466b158d6cbb15581948131ba53b9cd416eab54fb102a863c2d8e05f2c7b5 | ucsd-progsys/dsolve | quicksort-simple.ml | fun('a)
par cmp (x, l, r, xs) =
case xs of
[] => (l, r)
| x' :: xs' => if cmp(x', x) then par cmp (x, x' :: l, r, xs')
else par cmp (x, l, x' :: r, xs')
withtype ('a * 'a -> bool) ->
{p:nat,q:nat,r:nat} <r> =>
'a * 'a list(p) * 'a list(q) * 'a list(r) ->
[p':... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/xiog/DMLex/quicksort-simple.ml | ocaml | fun('a)
par cmp (x, l, r, xs) =
case xs of
[] => (l, r)
| x' :: xs' => if cmp(x', x) then par cmp (x, x' :: l, r, xs')
else par cmp (x, l, x' :: r, xs')
withtype ('a * 'a -> bool) ->
{p:nat,q:nat,r:nat} <r> =>
'a * 'a list(p) * 'a list(q) * 'a list(r) ->
[p':... | |
b5befb73856e7c2441aefbb0e2787a1bb57b94af98601bee69acd11882e1f580 | andreas/ocaml-graphql-server | ast.ml | type const_value =
[ `Null
| `Int of int
| `Float of float
| `String of string
| `Bool of bool
| `Enum of string
| `List of const_value list
| `Assoc of (string * const_value) list ]
type value =
[ `Null
| `Int of int
| `Float of float
| `String of string
| `Bool of bool
| `Enum of string
... | null | https://raw.githubusercontent.com/andreas/ocaml-graphql-server/520ccd4013943ee0b2557aa66367b83aaa67084c/graphql_parser/src/ast.ml | ocaml | type const_value =
[ `Null
| `Int of int
| `Float of float
| `String of string
| `Bool of bool
| `Enum of string
| `List of const_value list
| `Assoc of (string * const_value) list ]
type value =
[ `Null
| `Int of int
| `Float of float
| `String of string
| `Bool of bool
| `Enum of string
... | |
3745c226680c75b62016d083868bf8dfd3665ae1a6f2440592f6fe3f0bb8e239 | ocaml-multicore/domainslib | game_of_life.ml | let n_times = try int_of_string Sys.argv.(1) with _ -> 20
let board_size = try int_of_string Sys.argv.(2) with _ -> 16
let rg =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let rg' =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let buf... | null | https://raw.githubusercontent.com/ocaml-multicore/domainslib/5ea17b0afd36568dedd1151d13c671ea55515a5e/test/game_of_life.ml | ocaml | lonely
overcrowded
lives
get birth
0, (0|1|2|4|5|6|7|8)
barren | let n_times = try int_of_string Sys.argv.(1) with _ -> 20
let board_size = try int_of_string Sys.argv.(2) with _ -> 16
let rg =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let rg' =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let buf... |
84b9a1a924230ed1d27b7fb69960e4d9a7d6ae25bf7f787189f7c4e4dc4fb780 | TorXakis/TorXakis | PurpId.hs |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
-- ------------------------------------... | null | https://raw.githubusercontent.com/TorXakis/TorXakis/038463824b3d358df6b6b3ff08732335b7dbdb53/sys/defs/src/PurpId.hs | haskell | ----------------------------------------------------------------------------------------- --
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
capid |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
module PurpId
where
import ... |
46a339241d8e5c2e10b1ffad7224f8d262ec5ec55ee782b590c5a54a050fe09a | ocaml/ocaml | bufchan.ml | (* TEST
* hassysthreads
include systhreads
** bytecode
** native
*)
open Event
type 'a buffer_channel = {
input: 'a channel;
output: 'a channel;
thread: Thread.t;
}
let new_buffer_channel() =
let ic = new_channel() in
let oc = new_channel() in
let rec buffer_process front rear =
match (front, rear)... | null | https://raw.githubusercontent.com/ocaml/ocaml/55da58ca6c9144331c7fa56a5d0083cb97b50925/testsuite/tests/lib-threads/bufchan.ml | ocaml | TEST
* hassysthreads
include systhreads
** bytecode
** native
Test |
open Event
type 'a buffer_channel = {
input: 'a channel;
output: 'a channel;
thread: Thread.t;
}
let new_buffer_channel() =
let ic = new_channel() in
let oc = new_channel() in
let rec buffer_process front rear =
match (front, rear) with
| (["EOF"], []) -> raise Thread.Exit
| ([], []) -> buffe... |
44af9f9a045317b5894367e47aa9125840065925379f990ea78a2d82e356dd67 | coq/coq | pp_diff.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/d7ed9861173ad684744c4458c4ecc49c3c84ebf8/lib/pp_diff.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
cc315554703a59a89f7828fc79c3d795f3ea6ebcbe39a39a585c8e707ec0cb26 | fpottier/stores | StoreMap.ml | (***************************************************************************)
(* *)
(* UnionFind *)
(* *)
... | null | https://raw.githubusercontent.com/fpottier/stores/0752321be1ba6c355a7008ebb210bbd91a77e001/src/StoreMap.ml | ocaml | *************************************************************************
UnionFind
... | , Paris
. All rights reserved . This file is distributed under
the terms of the GNU Library General Public License version 2 , with a
module type INTMAP = sig
type 'a t
val empty: 'a t
val find: int -> 'a t -> 'a
val add: int -> 'a -> 'a t -> 'a t
en... |
15cee7ace1dcfdd2d7934e33fd61a14ad1bfe93bbc15e5d51535c454f931af23 | mooreryan/ocaml_python_bindgen | run.ml | open Examples_attributes_lib
let () = Py.initialize ()
let cat = Cat.create ~name:"Sam" ()
let () = Cat.climb cat ~how_high:20 ()
let () = Cat.eat_part cat ~num_mice:0.2 ()
let () = Cat.eat cat ~num_mice:2 ()
let () = print_endline @@ Cat.to_string cat ()
let () =
print_endline
@@ Cat.say_this cat ~w:"first"... | null | https://raw.githubusercontent.com/mooreryan/ocaml_python_bindgen/31ff34a6ca9fe68486cd34c5a3b73e4aff2bb040/examples/attributes/run.ml | ocaml | open Examples_attributes_lib
let () = Py.initialize ()
let cat = Cat.create ~name:"Sam" ()
let () = Cat.climb cat ~how_high:20 ()
let () = Cat.eat_part cat ~num_mice:0.2 ()
let () = Cat.eat cat ~num_mice:2 ()
let () = print_endline @@ Cat.to_string cat ()
let () =
print_endline
@@ Cat.say_this cat ~w:"first"... | |
b18557ee3f3b96e1f843cb74b452a9fb2def725a819cbde847472f2f20adedb3 | Gopiandcode/petrol | test_utils.ml | let () = Printexc.register_printer (function (Failure msg) -> Some msg | _ -> None)
let run expr =
match Lwt_main.run expr with
| Ok _ -> ()
| Error (`Newer_version_than_supported _) ->
failwith ("Attempted to use a newer database than supported")
| Error (#Caqti_error.t as err) -> failwith ((Caqti_error.s... | null | https://raw.githubusercontent.com/Gopiandcode/petrol/076edd5a63e287b758df4e9d0c270853799a4538/test/test_utils.ml | ocaml | let () = Printexc.register_printer (function (Failure msg) -> Some msg | _ -> None)
let run expr =
match Lwt_main.run expr with
| Ok _ -> ()
| Error (`Newer_version_than_supported _) ->
failwith ("Attempted to use a newer database than supported")
| Error (#Caqti_error.t as err) -> failwith ((Caqti_error.s... | |
b8e9f645d559bd3f831eb4e2c379017ac3798e79c96da4b30ec89b6bbccb92d0 | lambe-lang/compiler | main_test.ml | let () =
let open Alcotest in
run "checker"
[
Kind_test.test_cases
; Type_test.test_cases
; Term_test.test_cases
; Entity_test.test_cases
; Sources_test.test_cases
]
| null | https://raw.githubusercontent.com/lambe-lang/compiler/79d7937c06ca30e231855ec4ce99012ca0395cd5/attic/test/parser/main_test.ml | ocaml | let () =
let open Alcotest in
run "checker"
[
Kind_test.test_cases
; Type_test.test_cases
; Term_test.test_cases
; Entity_test.test_cases
; Sources_test.test_cases
]
| |
b10beb04745b86b33ceb191fd0935307134f034763435b421bc47d6f4689895a | reflectionalist/S9fES | fluid-let.scm | Scheme 9 from Empty Space , Function Library
By , 2009,2012
; Placed in the Public Domain
;
; (fluid-let ((variable expression) ...) expression ...) ==> object
;
; Bind variables dynamically, i.e. assign a dynamic (rather than
; a lexical/static) value to each given variable. The variables
; must be defined ou... | null | https://raw.githubusercontent.com/reflectionalist/S9fES/0ade11593cf35f112e197026886fc819042058dd/lib/fluid-let.scm | scheme | Placed in the Public Domain
(fluid-let ((variable expression) ...) expression ...) ==> object
Bind variables dynamically, i.e. assign a dynamic (rather than
a lexical/static) value to each given variable. The variables
must be defined outside of FLUID-LET. The difference between
LET and FLUID-LET is as follow... | Scheme 9 from Empty Space , Function Library
By , 2009,2012
( let ( ( a 1 ) ) ( fluid - let ( ( a 1 ) )
( f ) ) ) ) = = > 0 ( f ) ) ) ) = = > 1
( fluid - let ( ( a 1 ) )
( f ) ) ) ) = = > 1
try ... |
6dcb16d9fe3ba2caad95c643f0a4f6ffbe26f56380cafbf877d7282c6dea4d48 | DanielG/kvm-in-a-box | ParserUtils.hs | # LANGUAGE FlexibleContexts #
module ParserUtils where
import Data.Char
import Text.Parsec hiding (parse)
import Text.Parsec.Char
import Text.Parsec.Prim hiding (parse)
import Text.Parsec.Combinator
nonNewline :: Stream s m Char => ParsecT s u m Char
nonNewline = satisfy (/='\n') <?> "non-newline"
nonNewlineSpa... | null | https://raw.githubusercontent.com/DanielG/kvm-in-a-box/6bf71bb389a19806fac2f32a2c6d92261fb649e1/src/ParserUtils.hs | haskell | # LANGUAGE FlexibleContexts #
module ParserUtils where
import Data.Char
import Text.Parsec hiding (parse)
import Text.Parsec.Char
import Text.Parsec.Prim hiding (parse)
import Text.Parsec.Combinator
nonNewline :: Stream s m Char => ParsecT s u m Char
nonNewline = satisfy (/='\n') <?> "non-newline"
nonNewlineSpa... | |
bfaddaa79cb8c0134b114e8f0f7051bf9b3bb625a9f345300b1f1bf158898834 | camllight/camllight | time_travel.mli | (**************************** Time travel ***********************)
#open "primitives";;
exception Current_checkpoint_lost;;
value new_checkpoint : int -> IO_CHANNEL -> unit;;
value set_file_descriptor : int -> IO_CHANNEL -> bool;;
value kill_all_checkpoints : unit -> unit;;
value forget_process : IO_CHANNEL -> int -... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/debugger/time_travel.mli | ocaml | *************************** Time travel ********************** |
#open "primitives";;
exception Current_checkpoint_lost;;
value new_checkpoint : int -> IO_CHANNEL -> unit;;
value set_file_descriptor : int -> IO_CHANNEL -> bool;;
value kill_all_checkpoints : unit -> unit;;
value forget_process : IO_CHANNEL -> int -> unit;;
value recover : unit -> unit;;
value go_to : int -> unit;... |
ac166c1a41e42aead566fff9072f5605431bafcc25fb0124c7d072ecbcd08809 | iand675/hs-opentelemetry | Baggage.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveLift #-}
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
-----------------------------------------------------------------------------
---------------------------------------------------------------------... | null | https://raw.githubusercontent.com/iand675/hs-opentelemetry/b08550db292ca0d8b9ce9156988e6d08dd6a2e61/api/src/OpenTelemetry/Baggage.hs | haskell | # LANGUAGE DeriveLift #
---------------------------------------------------------------------------
---------------------------------------------------------------------------
* Constructing 'Baggage' structures
* Modifying 'Baggage'
* Encoding and decoding 'Baggage'
| An entry into the baggage
Ripped from file-em... | # LANGUAGE CPP #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
|
Module : OpenTelemetry . Baggage
Copyright : ( c ) , 2021
License : BSD-3
Description : Serializable annotations to add user - defined... |
70399ce6ceda94bc75c3301da08bba8cc2163b59dc396fb305a3c0c66cde779b | typelead/eta | T7171.hs | # LANGUAGE FlexibleInstances #
module T7171 where
import T7171a
import Data.ByteString
-- this works
: : [ Int ] - > [ Int ]
-- test1 = test
-- this fails
test2 :: ByteString -> ByteString
test2 = test
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/T7171/T7171.hs | haskell | this works
test1 = test
this fails | # LANGUAGE FlexibleInstances #
module T7171 where
import T7171a
import Data.ByteString
: : [ Int ] - > [ Int ]
test2 :: ByteString -> ByteString
test2 = test
|
7f2a54338a9fbe012f37fba6e8dcf37b8f46969e049d901652fce907e69deb5d | cyga/real-world-haskell | HttpRequestParser.hs | file : ch16 / HttpRequestParser.hs
module HttpRequestParser
(
HttpRequest(..)
, Method(..)
, p_request
, p_query
) where
import ApplicativeParsec
import Numeric (readHex)
import Control.Monad (liftM4)
import System.IO (Handle)
file : ch16 / HttpRequestParser.hs
data Method = Get | Post
... | null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch16/HttpRequestParser.hs | haskell | file : ch16 / HttpRequestParser.hs
module HttpRequestParser
(
HttpRequest(..)
, Method(..)
, p_request
, p_query
) where
import ApplicativeParsec
import Numeric (readHex)
import Control.Monad (liftM4)
import System.IO (Handle)
file : ch16 / HttpRequestParser.hs
data Method = Get | Post
... | |
1467ca1fa9d0c6ef8afe8c21a4af31a36193b427d0d24cebb98625db48f50f94 | altenwald/eimap | eimap_command_compress_tests.erl | Copyright 2014 Kolab Systems AG ( )
%%
( Kolab Systems ) < seigo a kolabsys.com >
%%
%% This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation , either version 3 of the License , or
%% (at ... | null | https://raw.githubusercontent.com/altenwald/eimap/cfa94c2e1303b240d8582b30546fd666a7ad128b/test/eimap_command_compress_tests.erl | erlang |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library Gener... | Copyright 2014 Kolab Systems AG ( )
( Kolab Systems ) < seigo a kolabsys.com >
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Library General Public License
-module(... |
97188bef6acfd2b62ff3bd8ec1eb0473665d46760fa95fb9e2e2d781e6906496 | ssadler/zeno | TestDistributed.hs |
module TestDistributed where
import TestUtils
--
import Control . . Reader
import qualified Data . ByteString as BS
--
import qualified StmContainers . Map as STM
--
import Network . Distributed
import Network . Distributed . Remote
-- import qualified Network.Transport as NT
import Network . Transp... | null | https://raw.githubusercontent.com/ssadler/zeno/9f715d7104a7b7b00dee9fe35275fb217532fdb6/test/TestDistributed.hs | haskell |
import qualified Network.Transport as NT
import qualified Network.Transport.TCP as TCP
import UnliftIO
runTestProc :: ReaderT (ProcessData ()) IO () -> ProcessData () -> IO ()
runTestProc = runReaderT
test_process = testGroup "process management"
[
testCase "startNode" do
Node{..} <- crea... |
module TestDistributed where
import TestUtils
import Control . . Reader
import qualified Data . ByteString as BS
import qualified StmContainers . Map as STM
import Network . Distributed
import Network . Distributed . Remote
import Network . Transport . InMemory
BS.length salt @?= 32
sal... |
3465ee85a0349a2bfad7e1fb935ed82d6ed60a6000210ef0e6b0055d89bac49d | mk270/archipelago | world.ml |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2012
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... | null | https://raw.githubusercontent.com/mk270/archipelago/4241bdc994da6d846637bcc079051405ee905c9b/src/server/world.ml | ocaml | (int_of_string (s_of_so id))
((s_of_so state),
(s_of_so trapped),
(int_of_string (s_of_so accessor))) |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2012
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... |
3d23982ccb240ebdc1fdf8d45a592e21586ba830364f9f6bb4fb028a538086a4 | leahneukirchen/schell | schell.scm | (macroexpand '(with (a 5 b 3) (pp a b)))
(define-syntax $
(syntax-rules ()
((_ name)
(getenv (str (quote name))))))
(def *status* 0)
(def *pipestatus* '())
(def (set-status! status)
(if (pair? status)
(do
(set! *pipestatus* status)
(set! *status* (last status)))
(set! *pipesta... | null | https://raw.githubusercontent.com/leahneukirchen/schell/9951240207fafe35a58edafc8fb48f3d40067416/libschell/schell.scm | scheme | ?? (set-non-blocking! (car p))
XXX May be Linux-specific!
hack
blocking wait until all processes of the pipe have exited
reap everything else en passant | (macroexpand '(with (a 5 b 3) (pp a b)))
(define-syntax $
(syntax-rules ()
((_ name)
(getenv (str (quote name))))))
(def *status* 0)
(def *pipestatus* '())
(def (set-status! status)
(if (pair? status)
(do
(set! *pipestatus* status)
(set! *status* (last status)))
(set! *pipesta... |
967e29e02e154e1863b7be8d4ead6ceaf4d5dcdea8cd1688909f263540f907b5 | mumuki/mulang | DuplicationSpec.hs | module DuplicationSpec (spec) where
import Test.Hspec
import Language.Mulang.Inspector.Smell.Duplication
import Language.Mulang.Parsers.JavaScript
spec :: Spec
spec = do
describe "hasCodeDuplication" $ do
describe "with bodys Exactly equals" $ do
it "is False when two procedu... | null | https://raw.githubusercontent.com/mumuki/mulang/2479b0d7e3d8d13ad98d0c7190684b5512cebdd5/spec/DuplicationSpec.hs | haskell | module DuplicationSpec (spec) where
import Test.Hspec
import Language.Mulang.Inspector.Smell.Duplication
import Language.Mulang.Parsers.JavaScript
spec :: Spec
spec = do
describe "hasCodeDuplication" $ do
describe "with bodys Exactly equals" $ do
it "is False when two procedu... | |
e1c398b2e472be2c96aa48f7dd8baed89f39b34d08c68ede1d1023cbdc77ba63 | onyx-platform/onyx | seq.clj | (ns onyx.tasks.seq
(:require [onyx.schema :as os]
[onyx.plugin.seq]
[schema.core :as s])
(:import [java.io FileReader BufferedReader]))
(s/defn input-serialized
[task-name :- s/Keyword opts sequential]
{:task {:task-map (merge {:onyx/name task-name
:onyx/pl... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/tasks/seq.clj | clojure | (ns onyx.tasks.seq
(:require [onyx.schema :as os]
[onyx.plugin.seq]
[schema.core :as s])
(:import [java.io FileReader BufferedReader]))
(s/defn input-serialized
[task-name :- s/Keyword opts sequential]
{:task {:task-map (merge {:onyx/name task-name
:onyx/pl... | |
b754e7c18abeabde3e62d00e5e3995541d0b4588b391ab1bf95ff765f04a814f | EMSL-NMR-EPR/Haskell-MFAPipe-Executable | Command.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE UndecidableInstances #
-----------------------------------------------------------------------------
-- |
-- Module : MFAPipe.Command
Copyr... | null | https://raw.githubusercontent.com/EMSL-NMR-EPR/Haskell-MFAPipe-Executable/8a7fd13202d3b6b7380af52d86e851e995a9b53e/MFAPipe/app/MFAPipe/Command.hs | haskell | # LANGUAGE DeriveDataTypeable #
---------------------------------------------------------------------------
|
Module : MFAPipe.Command
License : ECL-2.0 (see the LICENSE file in the distribution)
Maintainer :
Stability : experimental
Portability : portable
application.
-----------------------... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE UndecidableInstances #
Copyright : 2016 - 17 Pacific Northwest National Laboratory
This module exports types for modes of the \"mfaPipe\ " command line
module MFAPipe.Comman... |
c6a9151517b90a90cb22a25ccffbf61e3681e61ad70a8e553ece6d6d959fbfcc | slyrus/mcclim-old | make-docstrings.lisp | (cl:defvar *output-dir* #P"docstrings/")
(cl:defvar *mcclim-documentee*
(cl:make-instance 'cl-docextractor:documentee
:name "McCLIM"
:output-directory *output-dir*
:packages '(:clim :drei :drei-buffer :drei-undo :drei-kill-ring
... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Doc/make-docstrings.lisp | lisp | (cl:defvar *output-dir* #P"docstrings/")
(cl:defvar *mcclim-documentee*
(cl:make-instance 'cl-docextractor:documentee
:name "McCLIM"
:output-directory *output-dir*
:packages '(:clim :drei :drei-buffer :drei-undo :drei-kill-ring
... | |
37e45818211af8a3b1d1b7c56e5693db7cd33a20a6bcb4d4f72d7626dff2a8c7 | bellissimogiorno/nominal | SpecUtilities.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
# OPTIONS_GHC -Wno - orphans #
module Language.Nominal.SpecUtilities
(
) where
import System.IO.Unsafe (unsafePerformIO)
import Data.Unique (Unique, newUnique)
import Test.QuickCheck
import Lang... | null | https://raw.githubusercontent.com/bellissimogiorno/nominal/ab3306ee349dc481d2e2e6d103d90ffdd14ccaa9/test/Language/Nominal/SpecUtilities.hs | haskell | # LANGUAGE TypeSynonymInstances #
| We only care about short and simple strings
# OVERLAPPING #
arbitrary = getPrintableString <$> arbitrary
| Pick an atom
Gen monad
# OVERLAPPING #
Gen monad
- instance Arbitrary (Name ()) where
arbitrary = do -- Gen monad
a <- arbitrary
return $ Name (Just (), ... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# OPTIONS_GHC -Wno - orphans #
module Language.Nominal.SpecUtilities
(
) where
import System.IO.Unsafe (unsafePerformIO)
import Data.Unique (Unique, newUnique)
import Test.QuickCheck
import Language.Nominal.Names
import Language.Nom... |
b9823811371a01fe0f776d8867a517e4f082a1b37c51e4e50137cd40abcc907f | fgalassi/cs61a-sp11 | start-logo.scm | (load "load-simply")
(load "obj.scm")
(load "logo.scm")
(load "logo-meta.scm")
(initialize-logo)
| null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/projects/logo/start-logo.scm | scheme | (load "load-simply")
(load "obj.scm")
(load "logo.scm")
(load "logo-meta.scm")
(initialize-logo)
| |
1b60f88bf38762dc79040681b30d694d3bfa2786f8e5d9fe71b73eff047f4657 | jtdaugherty/vty | Rogue.hs | module Main where
import Graphics.Vty
import Data.Array
import Control.Applicative
import Control.Monad
import Control.Monad.RWS
import System.Random
data Player = Player
{ playerCoord :: Coord
} deriving (Show,Eq)
data World = World
{ player :: Player
, level :: Level
}
deriving (Show,Eq)... | null | https://raw.githubusercontent.com/jtdaugherty/vty/a4cb4cfc386a4bc0e46921d878b808e76567ebc9/examples/Rogue.hs | haskell | through greater lengths to avoid the need to cache images.
|Generate a level randomly using the specified difficulty. Higher
difficulty means the level will have more rooms and cover a larger area.
next the empty spaces that make the rooms
for this we generate a number of center points
generate rooms for all tho... | module Main where
import Graphics.Vty
import Data.Array
import Control.Applicative
import Control.Monad
import Control.Monad.RWS
import System.Random
data Player = Player
{ playerCoord :: Coord
} deriving (Show,Eq)
data World = World
{ player :: Player
, level :: Level
}
deriving (Show,Eq)... |
789310a8b456b9e8ea903cc6b2a56c9b8dc17546ef9149797dfb1e79f2d20b27 | jesperes/aoc_erlang | aoc2021_day15.erl | -module(aoc2021_day15).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 15,
name =... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/527a63531313edd5675c2a1687b009d2fc1c3ea6/src/2021/aoc2021_day15.erl | erlang | {Dist, {X, Y}} tuple. This seems to gain a bit in performance.
actual cost to position
Cost of moving to a coordinate.
A* implementation
This path is better than previously known | -module(aoc2021_day15).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 15,
name =... |
99dd81b0a08aab56c3f1ccbfee1e8c9d3970d9a099bcaadfcb5062b9702be69f | clojerl/clojerl | clojerl_Reduced_SUITE.erl | -module(clojerl_Reduced_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ deref/1
, hash/1
, str/1
, complete_coverage/1
]).
-spec all() -> [atom()].
all() -> clj_test_utils:all(... | null | https://raw.githubusercontent.com/clojerl/clojerl/aa35847ca64e1c66224867ca4c31ca6de95bc898/test/clojerl_Reduced_SUITE.erl | erlang | ------------------------------------------------------------------------------
Test Cases
------------------------------------------------------------------------------ | -module(clojerl_Reduced_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ deref/1
, hash/1
, str/1
, complete_coverage/1
]).
-spec all() -> [atom()].
all() -> clj_test_utils:all(... |
3fec9345566a691c3d50648b616a09da940e082f579462d4bf8b5c1eb57f43d9 | acl2/acl2 | axe-syntax-functions-bv@useless-runes.lsp | (UNQUOTE-IF-POSSIBLE)
(GET-TYPE-OF-BV-EXPR-AXE
(2470 76 (:REWRITE NATP-OF-NTH-FROM-ALL-NATP))
(2204 38 (:REWRITE ALL-NATP-WHEN-NAT-LISTP))
(2090 38 (:DEFINITION NAT-LISTP))
(608 76 (:REWRITE INTEGERP-OF-NTH-WHEN-ALL-DARGP))
(532 76 (:REWRITE INTEGERP-OF-NTH-WHEN-ALL-INTEGERP))
(456 228 (:REWRITE LEN-OF-NTH-WHEN-A... | null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/kestrel/axe/.sys/axe-syntax-functions-bv%40useless-runes.lsp | lisp | (UNQUOTE-IF-POSSIBLE)
(GET-TYPE-OF-BV-EXPR-AXE
(2470 76 (:REWRITE NATP-OF-NTH-FROM-ALL-NATP))
(2204 38 (:REWRITE ALL-NATP-WHEN-NAT-LISTP))
(2090 38 (:DEFINITION NAT-LISTP))
(608 76 (:REWRITE INTEGERP-OF-NTH-WHEN-ALL-DARGP))
(532 76 (:REWRITE INTEGERP-OF-NTH-WHEN-ALL-INTEGERP))
(456 228 (:REWRITE LEN-OF-NTH-WHEN-A... | |
8fe11e4cd7fca99fe1dcde6b3cb46347afc564a93bc1d12157bd2d567996932b | m4b/elf2json | E2j_Json.ml | exception Escape of ((int * int) * (int * int)) * Jsonm.error
type json =
[ `Null | `Bool of bool | `Float of float| `String of string
| `A of json list | `O of (string * json) list ]
let to_hex i =
let hex = Printf.sprintf "0x%x" i in
`String hex
let to_number i = `Float (float_of_int i)
let to_byte_arra... | null | https://raw.githubusercontent.com/m4b/elf2json/72dfb62e797f68e4ad24cf3e74547ef91f8a1e62/lib/E2j_Json.ml | ocaml | TODO: decide what to do | exception Escape of ((int * int) * (int * int)) * Jsonm.error
type json =
[ `Null | `Bool of bool | `Float of float| `String of string
| `A of json list | `O of (string * json) list ]
let to_hex i =
let hex = Printf.sprintf "0x%x" i in
`String hex
let to_number i = `Float (float_of_int i)
let to_byte_arra... |
bf53cc19932b63783ad9d875835d93ffc31737325f8b04d809522373eedfab60 | hyperledger-labs/fabric-chaincode-ocaml | init.ml | open GRPC
module Core = struct
open Core
let () =
let slice = slice_of_string "Test" in
print_endline @@ string_of_slice slice
let () = print_endline (grpc_version_string ())
let () = print_endline (grpc_g_stands_for ())
end
let server = Server.create ~listening:"unix:init_socket" ()
let () =
ma... | null | https://raw.githubusercontent.com/hyperledger-labs/fabric-chaincode-ocaml/bef9008ce8a20fb5155a855dc860f9062340b829/grpc/tests/init.ml | ocaml | open GRPC
module Core = struct
open Core
let () =
let slice = slice_of_string "Test" in
print_endline @@ string_of_slice slice
let () = print_endline (grpc_version_string ())
let () = print_endline (grpc_g_stands_for ())
end
let server = Server.create ~listening:"unix:init_socket" ()
let () =
ma... | |
2ebb43a5f35c6f9f73ad4f01d220305336a86bf8f68ab3a2ce9c627561c0c87d | gebi/jungerl | ucs.erl | %%% -*- Erlang -*-
%%%-------------------------------------------------------------------
Author : < >
%%%
%%% Description: Some minimal support for encoding, decoding, and
manipulating strings of ISO-10646 characters ( i.e. Unicode ) .
%%%-------------------------------------------------------------------
%%% ... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/ucs/src/ucs.erl | erlang | -*- Erlang -*-
-------------------------------------------------------------------
Description: Some minimal support for encoding, decoding, and
-------------------------------------------------------------------
Note:
- The ucs server must be started before any call to:
test predicates. The server will current... | Author : < >
manipulating strings of ISO-10646 characters ( i.e. Unicode ) .
to_unicode/2 , from_unicode/2 , , getCharset/1 and all the charset
-module(ucs).
-vsn('0.3').
-author('').
-modified_by('').
-compile([verbose,report_warnings,warn_unused_vars]).
Force start of ucs server
-export([start_server... |
77d3b2e8ce87debd7a007bc770b73c3e052a4af7be1ebea4310196c5f016ed2d | reborg/clojure-essential-reference | 6.clj | < 1 >
< 2 >
(def l2 (map trace (list 3 4 5)))
(def l1+l2 (concat l1 l2)) ; <3>
< 4 >
evaluating 1
1 | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/SequentialGeneration/OtherGenerators/concatandlazy-cat/6.clj | clojure | <3> | < 1 >
< 2 >
(def l2 (map trace (list 3 4 5)))
< 4 >
evaluating 1
1 |
1b8724bd16b232382c1848697badbeef49bdf6a8caeeb08a28dec78208809318 | herd/herdtools7 | sexp.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
jade alglave , university college london , uk .
lu... | null | https://raw.githubusercontent.com/herd/herdtools7/daedd7431cb00884afea2ec39749222e2c367c6b/internal/lib/sexp.ml | ocaml | **************************************************************************
the diy toolsuite
en automatique and ... | jade alglave , university college london , uk .
luc marange_inclusivet , inria paris - rocquencourt , france .
copyright 2010 - present institut national de recherche en informatique et
this software is governed by the - b license under french law and
license a... |
9e807dedba12542c78e281ca287f43687d735b3b94fc72825e8be0945c6ffcd0 | footprintanalytics/footprint-web | js_test.cljs | (ns metabase.mbql.js-test
(:require [cljs.test :as t]
[metabase.mbql.js :as mbql.js]))
(t/deftest normalize-test
(t/testing "normalize should preserve keyword namespaces"
(let [js-query #js {"database" 1
"type" "query"
"query" #js {"source-tabl... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/shared/test/metabase/mbql/js_test.cljs | clojure | (ns metabase.mbql.js-test
(:require [cljs.test :as t]
[metabase.mbql.js :as mbql.js]))
(t/deftest normalize-test
(t/testing "normalize should preserve keyword namespaces"
(let [js-query #js {"database" 1
"type" "query"
"query" #js {"source-tabl... | |
a28516698717ccb9bf59e214c11cf286e1ed5839e5f95c26999279dfaf7217a4 | nikita-volkov/ptr | List.hs | module Ptr.List where
import Ptr.Prelude
# INLINE reverseDigits #
reverseDigits ::
Integral a =>
-- | Radix
a ->
-- | Number
a ->
[a]
reverseDigits radix =
let loop x = case divMod x radix of
(next, digit) -> digit : if next <= 0 then [] else loop next
in loop
| null | https://raw.githubusercontent.com/nikita-volkov/ptr/82e1f3ef67e5b1c6d3803a8f19c3ef1b5bd8d181/library/Ptr/List.hs | haskell | | Radix
| Number | module Ptr.List where
import Ptr.Prelude
# INLINE reverseDigits #
reverseDigits ::
Integral a =>
a ->
a ->
[a]
reverseDigits radix =
let loop x = case divMod x radix of
(next, digit) -> digit : if next <= 0 then [] else loop next
in loop
|
6bedc6c8d82d71a87282e1b6cc10bfada5732ba07b473f8aaef10e84ac0d0db3 | ghorn/Plot-ho-matic | HistoryChannel.hs | # OPTIONS_GHC -Wall #
{-# Language ScopedTypeVariables #-}
{-# Language DeriveFunctor #-}
module PlotHo.HistoryChannel
( Meta
, XAxisType(..)
, newHistoryChannel
, newHistoryChannel'
) where
import qualified Control.Concurrent as CC
import Control.Lens ( (^.) )
import Control.Monad ... | null | https://raw.githubusercontent.com/ghorn/Plot-ho-matic/7bd9e8825787b0aa4212fe7490a8c15d4922578c/src/PlotHo/HistoryChannel.hs | haskell | # Language ScopedTypeVariables #
# Language DeriveFunctor #
^ message index
^ message index, normalized to 0 (to reduce plot jitter)
| Simplified time-series channel which automatically generates the signal tree
based on 'Accessors.Lookup'.
You have to recompile the plotter if the types change.
The plotter will p... | # OPTIONS_GHC -Wall #
module PlotHo.HistoryChannel
( Meta
, XAxisType(..)
, newHistoryChannel
, newHistoryChannel'
) where
import qualified Control.Concurrent as CC
import Control.Lens ( (^.) )
import Control.Monad ( unless, when )
import qualified Data.Foldable as F
import qualifie... |
09cb9985870afc6d880cbe99142d28e709205331a07269be726cff8ce936cb8d | noteed/mojito | ExprBuilder.hs | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleContexts #
module Language.Mojito.Syntax.ExprBuilder where
import Control.Monad.Except
import Control.Monad.State
import Data.List (partition)
import Language.Mojito.Syntax.SExpr
import Language.Mojito.Syntax.Expr
import Language.Mojito.Syntax.Types
------------------... | null | https://raw.githubusercontent.com/noteed/mojito/893d1d826d969b0db7bbc8884df3b417db151d14/Language/Mojito/Syntax/ExprBuilder.hs | haskell | --------------------------------------------------------------------
should be done separately from the buildExpr function.
--------------------------------------------------------------------
Translates only ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^.
Turns a list of s-expressions into:
- a list of identifiers for ... | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleContexts #
module Language.Mojito.Syntax.ExprBuilder where
import Control.Monad.Except
import Control.Monad.State
import Data.List (partition)
import Language.Mojito.Syntax.SExpr
import Language.Mojito.Syntax.Expr
import Language.Mojito.Syntax.Types
S - expressions ... |
a2f9d37d39da2cbde2c89aa87e27f3cd2f5f040a8f6b234587234af6e80be999 | fission-codes/fission | Store.hs | module Fission.CLI.WebNative.Mutation.Auth.Store
( getBy
, getRootUCAN
, getRootUserProof
, module Fission.CLI.WebNative.Mutation.Auth.Store.Class
) where
import qualified Data.Yaml as YAML
import RIO.Map as Map
import ... | null | https://raw.githubusercontent.com/fission-codes/fission/ae177407dccc20be67948a901956b99f40d37ac8/fission-cli/library/Fission/CLI/WebNative/Mutation/Auth/Store.hs | haskell | NOTE You may be root, hence Maybe | module Fission.CLI.WebNative.Mutation.Auth.Store
( getBy
, getRootUCAN
, getRootUserProof
, module Fission.CLI.WebNative.Mutation.Auth.Store.Class
) where
import qualified Data.Yaml as YAML
import RIO.Map as Map
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.