mumuki-haskell-runner
RACK_ENV=development rackup -p 4567
License: MIT License
From Issue mumuki/mumuki-laboratory#482
In GHCi, I can do:
Prelude> :t "hola"
"hola" :: [Char]
Yet in Mumuki console I get:
Prelude> :t "hola"
/tmp/compilation58:7:22: parse error on input ‘:’
Nothing I can't live without, but it's a cool tool for teaching and type debugging.
3.4 and -8.7 tests are failing, the first test is being run on both cases.
Currently the editor is deferring type errors, while console not. This behaviour should be consistent
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.
Ejercicio: Pattern Matching con Tuplas - Lección 7
Solución:
poderSoldado (_, str, dex) = str * dex
Estado: passed_with_warnings
Objetivos que no se cumplieron:
Expectation Has Anonymous Variable
Parece ser que la expectation del _ no estaría funcionando
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.
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 ?
It should provide feedback for the following compilation problems:
1 succ
and
and or
instead of &&
and ||
. Please notice that and
and or
are valid Prelude functions, but with different types.div
in prefix form french quotesfoo (2 3)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.