corollary icon indicating copy to clipboard operation
corollary copied to clipboard

Translate into pointful function

Open tcr opened this issue 8 years ago • 0 comments

This translates incorrectly. We should look at the type signature, and if there are extra arguments in its type that are not in the function arguments, it should be rewritten as pointful.

Save this as test.hs:

module Test()
where

-- error.hs:49
isHardError :: (Error ex) => ex -> Bool
isHardError = ( > LevelWarn) . errorLevel

Running cargo run --manifest-path corollary/Cargo.toml -- test.hs currently outputs this:

// Original file: "test.hs"
// File auto-generated using Corollary.

#[macro_use] use corollary_support::*;

pub fn isHardError() -> bool {
    ((() > LevelWarn(errorLevel)))
}

Expected output:

pub fn isHardError(ex: Error) -> bool {
   errorLevel(ex) > LevelWarn
}

tcr avatar Jun 03 '17 14:06 tcr