Coder Social home page Coder Social logo

mumuki-haskell-runner's Introduction

Build Status Code Climate Test Coverage

mumuki-haskell-runner

Run the server

RACK_ENV=development rackup -p 4567

mumuki-haskell-runner's People

Contributors

flbulgarelli avatar julian-berbel avatar aguspina avatar afska avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar Federico Scarpa avatar Gustavo Trucco avatar Javier Casaubón avatar  avatar  avatar Luis Cannavó avatar MumukiBot avatar

mumuki-haskell-runner's Issues

some functions wont show properly on the console

Right now, when we write for example length in the console, it gives the following output:

<interactive>:2:1:
No instance for (Foldable t0) arising from a use of ‘it’
The type variable ‘t0’ is ambiguous
Note: there are several potential instances:
instance Foldable (Either a) -- Defined in ‘Data.Foldable’
instance Foldable Data.Proxy.Proxy -- Defined in ‘Data.Foldable’
instance GHC.Arr.Ix i => Foldable (GHC.Arr.Array i)
-- Defined in ‘Data.Foldable’
...plus three others
In the first argument of ‘print’, namely ‘it’
In a stmt of an interactive GHCi command: print it

instead of the desired <function>

this does not happen for every function.

putting function signature after definition may cause exercise to fail

take for example: https://mumuki.io/exercises/1684-programacion-funcional-practica-listas-promedio

Submission

largo = fromIntegral.length
largo:: (Foldable t, Num a) => t x -> a

promedio numeros = (sum numeros) / (largo numeros)
promedio:: Foldable t => t Int -> Int

will fail with a Could not deduce (Fractional Int) compiler error.

If, however, the type signature for largo is put before its definition, it passes just fine.

Tested this behaviour on GHC 8.0.2 with GHCi and a file with the previous content and this did not happen.

We're importing unwanted functions

Take https://mumuki.io/exercises/4258-programacion-funcional-practica-valores-y-funciones-comienzacona

A student submitted the following solution:

comienzaConA auja = head (auja) == 'a'
comienzaConA bote = head (bote) === 'a'

Said solution is not failing because a function === exists in the package Test.QuickCheck, which we are importing in the test hook.
This would also normally fail with a type error, because the return type of === and == do not coincide, but since we're deferring type errors and the second line is never evaluated given that the first pattern catches any value, an error never comes up.

We should probably change the imports in the test hook to import only the functions we actually need.

Also, this gave me an idea for a new smell... shouldn't we warn the student when they have unreachable code like in the given example? Thoughts @flbulgarelli ?

Add feedback feature

It should provide feedback for the following compilation problems:

  • Type errors
  • Application order: detect wrong expressions like 1 succ
  • Using and and or instead of && and ||. Please notice that and and or are valid Prelude functions, but with different types.
  • Using div in prefix form french quotes
  • Using incorrect parenthesis like foo (2 3)

Adding a commented line makes orange exercises turn green

A couple of students showed be that when they kept as comment some previous version of some function in the editor, an exercise that is orange (warning) passes. For instance say that the following has a warning:

f = blabla

the following has not (passes):

f = blabla
-- bla

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.