Giter Site home page Giter Site logo

idris2-curl's People

Contributors

0xd34df00d avatar marcelinevq avatar mr-andersen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

doytsujin

idris2-curl's Issues

Can't compile minimal example

I use Idris 2, version 0.2.1-a9ff13c66, git clone'd your lib, ran make install. Compiler reported error:

1/22: Building Derive.Common (src/Derive/Common.idr)
Error: mapName is not covering.

src/Derive/Common.idr:33:1--35:8
 33 | export
 34 | mapName : (String -> String) -> Name -> Name
 35 | mapName f (UN x) = UN (f x)

Missing cases:
    mapName _ (RF _)

Error: nameStr is not covering.

src/Derive/Common.idr:26:1--28:8
 26 | export
 27 | nameStr : Name -> String
 28 | nameStr (UN x) = x

Missing cases:
    nameStr (RF _)

So I added missing cases (maybe wrong way):

diff --git a/src/Derive/Common.idr b/src/Derive/Common.idr
index 77d4604..6060d1e 100644
--- a/src/Derive/Common.idr
+++ b/src/Derive/Common.idr
@@ -29,6 +29,7 @@ nameStr (UN x) = x
 nameStr (MN x y) = x
 nameStr (NS xs x) = nameStr x
 nameStr (DN x y) = x
+nameStr (RF x) = x

 export
 mapName : (String -> String) -> Name -> Name
@@ -36,6 +37,7 @@ mapName f (UN x) = UN (f x)
 mapName f (MN x y) = MN (f x) y
 mapName f (NS x y) = NS x (mapName f y)
 mapName f (DN x y) = DN (f x) y
+mapName f (RF x) = RF (f x)

 export
 lookupType : Name -> Elab (Name, TTImp)

Now the library compiles successfully, but when compiling the following code with idris2 -p curl Main.idr -o Main.exe...

module Main

import Network.Curl.Easy

main : IO ()
main = do
    CURLE_OK <- curl_global_init | c => do
        putStrLn $ "error in curl_global_init: " ++ show c

    Just cli <- curlEasyInit | Nothing => putStrLn "error in curlEasyInit"

    CURLE_OK <- curlEasySetopt cli CURLOPT_URL "https://google.com" | c => do
        putStrLn $ "error in curlEasySetopt: " ++ show c

    curlEasyCleanup cli
    curl_global_cleanup

... I get this error:

Error: Can't pass argument of type Builtin.Void  to foreign function

Maybe, I've made a mistake in the code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.