ubuntu,haskell,vim,ubuntu-14.04,cabal , issues with installing newer cabal version for haskell vim now

issues with installing newer cabal version for haskell vim now


Tag: ubuntu,haskell,vim,ubuntu-14.04,cabal

I would like to install this vim plugin: https://github.com/begriffs/haskell-vim-now

When trying to run the suggested installation script:

curl -o - https://raw.githubusercontent.com/begriffs/haskell-vim-now/master/install.sh | bash

I get:

--- Cabal version 1.18 or later is required. Aborting.

I then try to install a newer version of cabal:

[email protected]:~/Downloads/cabal-install-$ ./bootstrap.sh

The response I get:

Installed cabal-install-

But when getting the version:

cabal --version

cabal-install version
using version 1.16.0 of the Cabal library 

How do I get this plugin running? https://github.com/begriffs/haskell-vim-now

edit: I've left out an important piece of information. when running:

cabal install cabal cabal-install

I get the following output

Installing executable(s) in /home/me/.cabal/bin
Installed cabal-install-


Your $PATH variable seems to be broken. In a comment you said it was


This means that your shell (assumed to be bash) will look in the following directories


when looking for executable. If you look at the second item in your path it is /.cabal/bin. It should be $HOME/.cabal/bin (where $HOME is your home directory)

Most likely your ~/.bash_profile has a line that looks something like


you should add a $HOME to the above so that the PATH variable is set properly.


Before your shell was looking for cabal in /.cabal/bin/cabal however it isn't there.

Other information on PATH: http://www.linfo.org/path_env_var.html


How do I respond to a prompt for password in a shell script?

I'm writing a shell script to set a VNC password using vncpasswd. The only way to use vncpasswd is in interactive mode (enter password, return, confirm password, return). How can I respond to the prompts in my shell script so I can set the password automatically? (i.e. non-interactive). Thanks! Chris....

How do I avoid writing this type of Haskell boilerplate code

I run into this situation often enough for it to be annoying. Let's say I have a sum type which can hold an instance of x or a bunch of other things unrelated to x - data Foo x = X x | Y Int | Z String | ...(other...

Haskell: When declaring a class, how can I use a type variable that is not immediately in the constructors?

I want to define a function, <-? to check whether an element is in a list/set/map. module Test where import qualified Data.Map as Map import qualified Data.Set as Set class Memberable a where (<-?) :: b -> a -> Bool instance Memberable [x] where (<-?) = elem instance Memberable (Map.Map...

Error installing gem twitter on Ubuntu 15.04

Am trying to install twitter gem on Ubuntu 15.04 and this error keeps popping up gem install twitter Building native extensions. This could take a while... ERROR: Error installing twitter: ERROR: Failed to build gem native extension. /usr/bin/ruby2.1 extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed,...

Python3 input() error: can't initialize sys standard streams

I'm running Python 3.4.3 on Ubuntu 15.04 and just encountered a very strange problem when trying to use the input() function. To isolate the problem Iv'e created a file called test.py contaning: print(input()) When running it, I receive this error: $ python3 test.py Fatal Python error: Py_Initialize: can't initialize sys...

Best practice for handling data types from 3rd party libraries in Haskell?

I'm just getting into my first real Haskell project of size (a web app), and I'm starting to run into issues with types from 3rd party libraries leaking all over my code. Here is a quick example: My Parser module imports Test.Parsec, and the exports a function (parseConfig) that returns...

Haskell - generate and use the same random list

In Haskell, I'd like to generate a random list of Ints and use it throughout my program. My current solution causes the array to be created randomly each time I access/use it. How can I overcome this problem?...

Pretty URLs aren't working after upgrade to Mediawiki 1.24.2

So I am moving a Mediawiki site of mine to a new server. The version 1.20.3 worked fine on the old server running Ubuntu 12.04. However, when I copied everything over to my new server running Ubuntu 14.04 it didn't. So after messing with it for a while I decided...

Thread blocked indefinitely in an MVar operation

I have been attempting to debug a problem when using multiple MVars, however to no luck. My code uses two MVars: one to store the servers current state, and another to pass network events to and from the client threads. However after connecting and disconnecting several times, the server stops...

Why is f <$> g <$> x equivalent to (f . g) <$> x although <$> is not right-associative?

Why is f <$> g <$> x equivalent to (f . g) <$> x although <$> is not right-associative? (This kind of equivalence is valid in a popular idiom with plain $, but currently $ is right-associative!) <*> has the same associativity and precedence as <$>, but behaves differently! Example:...

Replace all [ ] with {} - as short as possible [on hold]

Given the code below: import Data.List; main = (readLn :: IO [Integer]) >>= print . subsequences It takes a list of integers from standard input (for example [1,2,3]) and outputs something like: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]] I want it to be like this: {},{1},{2},{1,2},{3},{1,3},{2,3},{1,2,3}} so my goal is to replace every [ and...

Would using Vagrant be overkill? [on hold]

I'm a developer-hobbyist running Windows 8.1 on a Yoga 2 Pro. I mostly do Python/Django work but I think I'm gonna pick up Ruby soon. The thing is, Windows always seems to be the limiting factor for any project I want to pick up. Last time I tried to install...

IO Monad Example

Consider the following IO code: ghci> let x = return 100 :: IO Int ghci> :t do { a <- x; print a; return 500 } do { a <- x; print a; return 500 } :: Num b => IO b My understanding of do notation/bind is that the...

issues with installing newer cabal version for haskell vim now

I would like to install this vim plugin: https://github.com/begriffs/haskell-vim-now When trying to run the suggested installation script: curl -o - https://raw.githubusercontent.com/begriffs/haskell-vim-now/master/install.sh | bash I get: --- Cabal version 1.18 or later is required. Aborting. I then try to install a newer version of cabal: [email protected]:~/Downloads/cabal-install-$ ./bootstrap.sh The response I get:...

Decremented value called in the recursion in Haskell

So, I have this function that aligns the text to the left for a given column width. I have already fixed some of its problems, but I am unable to make it not use the decremented parameter once it is called, but to return to the starting value of n....

Boost unit test dynamic linking on Ubuntu

I am trying to build a unit test using Boost's unit test framework. I would like to dynamically link test suite libraries with the auto generated test module that Boost provides. Here is the basic construction I've been using: test_main.cpp: #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #include <boost/test/unit_test.hpp> lib_case.cpp: #define BOOST_TEST_DYN_LINK #include...

Write Access for user on all repos on Gitolite

I'm trying to add access to read, write and create new repos from my local to a gitolite server. I have the following config on my gitolite server, but it doesn't want to let me push to a new repo: repo @all RW+ = git repo gitolite-admin RW+ = git...

Haskell IO - read from standard input directly to list

Haskell IO system is super hard to understand for me so i have question : How to read from standard input to list ? I know that there is function getLine :: IO String and interact. But i do not know how to convert the input to list so I...

connect to mysql database which is in ubuntu server

I am using below code to connect MySQL database in PHP. try { shell_exec("ssh -f -L 3307: [email protected]_ip sleep 60 >> logfile"); $this->_conn = $this->dbh = new PDO('mysql:host=;dbname=my_db', DB_USER, DB_PASS); $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { die("Couldn't connect to database. Please try again!"); } I want to direct connect...

First three items of a list in Haskell

I am very new to Haskell, and struggling a bit with a function here. The premise is simple enough: Run through a list, and combine each 3 items next to each other with another function and return a list with the results. The problem is to do it in a...

Ubuntu 14.04 - An error occurred while installing pg (0.18.2), and Bundler cannot continue

This issue doesn't let me go ahead and I don't know whether it's possible for me to deploy my Rails App ever on Heroku. When I try bundle install by having gem 'pg' in my Gemfile it gives following error. An error occurred while installing pg (0.18.2), and Bundler cannot...

Unable to connect to mariadb database server with qt 4.8.5 and Ubuntu 12.04

I use the following code to connect to a MySQL server database. QSqlDatabase db_Server = QSqlDatabase::database("Test"); //find mysql driver db_Server = QSqlDatabase::addDatabase("QMYSQL","Test"); db_Server.setHostName("188.**.***.***"); db_Server.setPort(3306); db_Server.setDatabaseName("Test"); db_Server.setUserName("Test"); db_Server.setPassword("*********"); bool ret = db_Server.open(); if(ret) qDebug() << "Database open" else qDebug() << db_Server.lastError().text(); Lately they changed the server to mariadb and I assumed...

Get each fibbonacci value in haskell

I'm learning haskell and I have the following code: fib a b = a : fib b (a + b) findFibSum = sum [x | x <- fib 1 2, mod x 2 == 0 && x < 100] If I run findFibSum nothing happens, it just sits there. Shouldn't...

Can't install Composer on Ubuntu behind proxy

I'm trying to install Composer, in order to use Laravel, but I'm behind the company proxy. The proxy is already configured in the system, so wget --proxy-user=<my_user_name> --proxy-password=<my_password> https://getcomposer.org/installer works (curl doesn't!), and I get the 270kB "installer" file. Next, I'm trying to run php installer as the manual says,...

Stopping condition on a recursive function - Haskell

So, I have this function which aims to align the text on the left without cutting words(only white spaces). However my problem is that I cannot find a stopping condition of the function and it goes infinitely. f n "" = "" --weak condition f n s = if n...

Error execute studio.sh unrecognized vm option 'MaxPermSize=350m' on Ubuntu 14.04

Error to Execute/Install studio.sh on Ubuntu: [email protected]:~$ cd android-studio/bin [email protected]:~/android-studio/bin$ ./studio.sh Unrecognized VM option 'MaxPermSize=350m' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. And with some knowledge after searching on search engines, I open the studio.vmoptions file in edit mode and...

Haskell make recipe fails for Paradox theorem prover using GHC

I am trying to install the paradox theorem prover sourced from here. When I run the makefile this is the command that runs: ghc -optl -static -lstdc++ -I../instantiate -I../minisat/current-base ../minisat/current-base/Solver.or ../minisat/current-base/Prop.or ../instantiate/MiniSatWrapper.or ../instantiate/MiniSatInstantiateClause.or -fglasgow-exts -O2 -static -threaded -main-is Paradox.Main.main --make Paradox.Main -o paradox And it results in several errors like...

Implementing map on a tree using fold

I am trying to implement a map using fold. I could do so in Haskell data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show) foldTree :: Tree a -> b -> (b -> a -> b -> b) -> b foldTree EmptyTree d _ =...

Keep track of loop without a counter

Say, I got a list which length can be odd or even. Every iteration , I remove two items from the list. If there is one or no item at the end, I end the execution. If I store (length list)/2 every loop, I will get e.g. [5,4,3...] for a...

JFrame wrong location with Ubuntu (Unity ?)

It seems that there is a bug with Ubuntu (maybe only unity). The decoration of the JFrame is taken into account for getLocation() and getSize(), but not for setLocation() and setSize(). This leads to weird behaviour. For instance, if you use pack() after the frame is displayed and the dimensions...

How do I make all files executable that have the file extension .cgi?

My server downloads its files from git hub to make sure they are up to date and make it easier for me to edit the files. I have set up a cron job that will update the files every few minutes. However I am having a problem as the CGI...

Combining Event and an attribute in threepenny-gui

I have an Event String which I want to sink into a textarea. This works fine, but now I want to combine the current value of a checkbox selection to this string. First I did this by using checkedChange of the checkbox which works, but has a problem. If the...

Access binaries inside docker

I am using Meteor and Meteur Up package to push a bundle to server. It uses docker. The problem is that I cannot access graphicsmagick or imagemagick from inside a docker to use it in my app. However it is installed on the server and I can access it when...

Can not increase max_open_files for Mysql max-connections in Ubuntu 15

I am running this version of Mysql Ver 14.14 Distrib 5.6.24, for debian-linux-gnu (x86_64) On this version of Ubuntu Distributor ID: Ubuntu Description: Ubuntu 15.04 Release: 15.04 Codename: vivid This is the config I set for Mysql: key_buffer_size = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 innodb_buffer_pool_size=20G...

Cannot set PHP include_path

I have uploaded all my files in var/www/html and in one of my php files I have this line : require_once('libraries/stripe/init.php'); the structure of my folders are list this: www -html/ -libraries -> Stripe -> init.php -register.php I keep getting this error message: Warning: require_once(libraries/Stripe/init.php): failed to open stream: No...

Is it possible to dump the core but not exit the process?

I want to be able to generate a core dump but not exit the process afterwards. I don't need it to continue execution, just not die. This is a C++ Ubuntu process. I believe I'm dumping the core in a pretty standard way: I catch the offending signal via setting...

apply a transformation with function inline

Starting from a simple case of "fold" (I used (+) but can be anything else): Prelude.foldl (+) 0 [10,20,30] is it possible apply an inline transformation similar to (that doesn't work): Prelude.foldl ((+) . (\x -> read x :: Int)) 0 ["10","20","30"] In case not, is there an alternative to...

Haskell return lazy string from file IO

Here I'm back again with a (for me) really strange behaviour of my newest masterpiece... This code should read a file, but it doesn't: readCsvContents :: String -> IO ( String ) readCsvContents fileName = do withFile fileName ReadMode (\handle -> do contents <- hGetContents handle return contents ) main...

logical expression evaluator Haskell

I wrote the following logical expression evaluator. It works for simple 2-member expressions, and it runs but produces a fault for expression containing other expressions as the second/first member. Here's my code. data Expression = Literal Bool | Operation Operator Expression Expression data Operator = AND | OR eval ::...

How does Frege generalize number literals?

It appears that Frege can evaluate 1/2 to return the Double value 0.5. The literal 1 is of type Int. It seems to be promoted to Double, which is a type in the Real class and thus knows the / operator. How does this happen? Is it using the Haskell...

Hook into GHC runtime system

I have been looking at how transactional memory is implemented in Haskell, and I am not sure I understand how the STM operations exposed to the programmer hook into the runtime system functions written in C. In ghc/libraries/base/GHC/Conc/Sync.hs of the git repo, I see the following definitions: -- |A monad...

C++ Ubuntu select() if serial interface has data on asynchronous read

I´m writing an asynchronous serial data reader class for Ubuntu using C++ and termios and I´m facing difficulties checking is there is data available. Here is my code: #include <iostream> #include <string> #include <sstream> #include <vector> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <termios.h> class MySerialClass { public: MySerialClass(std::string port);...

Fold over a heterogeneous, compile time, list

I have a list of heterogeneous types (or at least that's what I have in mind): data Nul data Bits b otherBits where BitsLst :: b -> otherBits -> Bits b otherBits NoMoreBits :: Bits b Nul Now, given an input type b, I want to go through all the...

Recursion scheme in Haskell for repeatedly breaking datatypes into “head” and “tail” and yielding a structure of results

In Haskell, I recently found the following function useful: listCase :: (a -> [a] -> b) -> [a] -> [b] listCase f [] = [] listCase f (x:xs) = f x xs : listCase f xs I used it to generate sliding windows of size 3 from a list, like...

How can I express foldr in terms of foldMap for type-aligned sequences?

I'm playing around with type-aligned sequences, and in particular I'm messing around with the idea of folding them. A foldable type-aligned sequence looks something like this: class FoldableTA fm where foldMapTA :: Category h => (forall b c . a b c -> h b c) -> fm a b...

Ubuntu down load a package and all of its dependencies without installing them

I need to download a package and all of its dependencies without installing any of them. I'm looking for a command like apt-get -R --download-only install package-name Or any solution that would produce the same result. Based on my research I could not find a solution that produces this and...

Idiomatic list construction

I'm very new to Haskell and functional programming in general, so I don't really know how to make this code idiomatic: type Coord = Double data Point = Point Coord Coord Coord deriving Show type Polyline = [Point] -- Add a point to a polyline addPoint :: Polyline -> Point...

How to “wrap” monadic return value

I have the following code: data APNSIdentifier = NoIdentifier | Identifier Word32 deriving (Show, Eq) newtype APNSItem = Item Put createNotificationIdentifierItem :: APNSIdentifier -> APNSItem <--- here createNotificationIdentifierItem (Identifier identifier) = do putWord8 3 putWord16be 4 putWord32be identifier How can I "wrap" the Put monad with an APNSItem? Do I...

Haskell do clause with multiple monad types

I'm using a graphic library in Haskell called ThreePennyUI. In this library the main function returns a UI monad object. This causes me much headache as when I attempt to unpack IO values into local variables I receive errors complaining of different monad types. Here's an example of my problem:...