I read such a piece of code in plfa.
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎)
but _≡⟨_⟩_ is not in PropositionalEquality
The module Eq.≡-Reasoning doesn't export the following: _≡⟨_⟩_
when scope checking the declaration
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎)
I only find it in Function.Related and Relation.Binary.HeterogeneousEquality. What is happening?
_≡⟨_⟩_ is a syntax notation for step-≡ as you can see in Relation.Binary.PropositionalEquality.Core.
So if you want to control what you are importing, you need to refer to step-≡
instead.
Related
I am using agda in Emacs mode. I am trying to start a project which relies on the cubical library. I want to import the module Cubical.Core.Everything. I have only written the following
{-# OPTIONS --without-K #-}
open import Cubical.Core.Everything
When I try to load the file I receive the following error
/home/rymndbkr/myHoTT/Agda/intro.agda:3,1-36
Importing module Cubical.Core.Everything using the
--cubical/--erased-cubical flag from a module which does not.
when scope checking the declaration
open import Cubical.Core.Everything
/home/rymndbkr/myHoTT/Agda/intro.agda:3,1-36
Importing module Cubical.Core.Everything using the --two-level flag
from a module which does not.
when scope checking the declaration
open import Cubical.Core.Everything
I've read through the relevant agda documentation and I don't see anything that addresses this. Does anyone have an idea of whats happening here?
The Cubical Agda libraries can only be used from Cubical Agda. The error message is telling you to change your source file to use Cubical mode:
{-# OPTIONS --cubical #-}
I am trying to use the Select.HtmlToPdf library https://www.nuget.org/packages/Select.HtmlToPdf/20.2.0
#r "nuget: Select.HtmlToPdf, 20.2.0"
open Select.HtmlToPdf
After sending the reference to the FSI, it returns a path to ...\Project.fsproj.fsx and namespace FSI_0004.Project
After sending the open statement to FSI, I get
The namespace or module "Select" is not defined.
I am pretty new to F#, hope somebody can explain how I have to do this.
Thanks
EDIT: I use Visual Studio Code and/or Jupyter lab
The library is called Select.HtmlToPdf, but the namespace it uses is SelectPdf, so this should work:
#r "nuget: Select.HtmlToPdf, 20.2.0"
open SelectPdf
I want to create a printer extension for OCaml using camlp5. My code would look like the example of this tutorial but instead of creating my own extension of the grammar, I would like to use OCaml's grammar to parse a program.
For that, I would like to use the Pcaml module to parse the given string with OCaml's grammar. Unfortunately, each time I try to use it, I get the:
Required module 'Pcaml' is unavailable
This is the part of my code where I load and open modules, as well as part of the code that uses Pcaml:
#load "pa_extprint.cmo";;
#load "q_MLast.cmo";;
#load "pa_o.cmo";;
open Pcaml;;
open Pprintf;;
let pa_ocaml = Grammar.Entry.create Pcaml.gram "pcaml_gram";;
I tried multiple command to run the program, like for example:
ocamlc -pp camlp5o -I +camlp5 gramlib.cma <my_file>.ml
What do I need to be able to use Pcaml and Pcaml.gram?
I recommend to use ocamlfind to build and link your programs. The only reason for newcomer against it, is that thing could become buggy when you use Windows without WSL. The compilation command without error is below
ocamlfind c -syntax camlp5o -package camlp5 -linkpkg a.ml
#load "pa_extprint.cmo";;
#load "q_MLast.cmo";;
#load "pa_o.cmo";;
open Pcaml;;
open Pprintf;;
let pa_ocaml : int Grammar.Entry.e = Grammar.Entry.create Pcaml.gram "pcaml_gram";;
FYI, your #load commands can and should be replaced by specifying right ocamlfind's packages.
Create a new FSharp Console project via VS2015
Add FSharp.Data and FSharp.Charting nuget package.
In Program.fs import both the packages
open FSharp.Charting
open Fsharp.Data
After the import I am able to use functions provided in FSharp.Data package but not in FSharp.Charting.
NOTE: In case of script (.fsx) file, which created in the same project, I am able to use both after adding their reference.
I just wanted to to know if there are any steps i am missing for adding any reference in a .fs file. If yes then why does it work with respect to FSharp.Data package.
I think if you search SO you'll find a few examples of displaying charts with FSharp.Charting. It's not exactly clear what sort of error are you getting. Assuming you are on Windows this should work:
open FSharp.Charting
open System
[<STAThread>]
[<EntryPoint>]
let main argv =
Chart.Line [ for x in 0 .. 10 -> x, x*x ] |> Chart.Show
printfn "%A" argv
0 // return an integer exit code
You will need to add references to System.Windows.Forms, System.Windows.Forms.DataVisualization and System.Drawing.
When trying to import JAVA modules I receive an error:
// JAVA imports
import lang::java::jdt::Java;
import lang::java::jdt::JDT;
import lang::java::jdt::JavaADT;
Could not load lang::java::jdt::Java
In the console:
rascal>import lang::java::jdt::Java;
|prompt:///|(0,29,<1,0>,<1,29>): Could not import module lang::java::jdt::Java: can not find in search path
Advice: |http://tutor.rascal-mpl.org/Errors/Static/ModuleImport/ModuleImport.html|
I'm using Eclipse and am trying to use the AstNode datatype. Any ideas?
The JDT modules have been replaced a while back by the m3 model.
While they are a bit different, the AST part should be comparable.
Check the m3 ast documentation and the Measuring java recipe.
Is this an old project you are trying to get up and running?